Skip to content

Commit

Permalink
best practices
Browse files Browse the repository at this point in the history
Signed-off-by: Yash Khare <[email protected]>
  • Loading branch information
khareyash05 committed Dec 16, 2024
1 parent 9d071ff commit 983fceb
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 45 deletions.
38 changes: 1 addition & 37 deletions .github/workflows/lighthouse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,42 +25,6 @@ jobs:
run: |
npm install -g @lhci/[email protected]
lhci autorun --config=lighthouserckeploy.json
- name: List Application Reports
run: |
pwd
ls
echo "Listing Application Reports"
cd lhci-reports
ls
echo "Listing Application Reports1223"
cd app
ls
echo "Listing Application Report343"
cd ..
cd keploy.io
ls
echo "Listing Application Report78"
cd ..
cd ..
ls -la ./lhci-reports/app
- name: List Keploy.io Reports
run: ls -la ./lhci-reports/keploy.io/
- name: Compare Lighthouse Reports
run: |
pwd
ls
echo "Comparing Lighthouse Reports"
node compare-lhci-reports.js
# - name: Upload Lighthouse Reports
# uses: actions/upload-artifact@v3
# with:
# name: lhci-reports
# path: ./lhci-reports
# # After running LHCI for the Application
# - name: List Application Reports
# run: ls -la ./lhci-reports/app/latest-run/

# # After running LHCI for Keploy.io
# - name: List Keploy.io Reports
# run: ls -la ./lhci-reports/keploy.io/latest-run/
node compare-lhci-reports.js
14 changes: 8 additions & 6 deletions compare-lhci-reports.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,14 @@ const categories = ['performance', 'accessibility', 'best-practices', 'seo'];
let allPass = true;

categories.forEach(category => {
const appScore = appReport.categories[category].score;
const keployScore = keployReport.categories[category].score;
console.log(`Comparing ${category}: App=${appScore} vs Keploy.io=${keployScore}`);
if (appScore < keployScore) {
console.error(`Score for ${category} is lower in the application (${appScore}) than Keploy.io (${keployScore})`);
allPass = false;
if (category != "best-practices"){
const appScore = appReport.categories[category].score;
const keployScore = keployReport.categories[category].score;
console.log(`Comparing ${category}: App=${appScore} vs Keploy.io=${keployScore}`);
if (appScore < keployScore) {
console.error(`Score for ${category} is lower in the application (${appScore}) than Keploy.io (${keployScore})`);
allPass = false;
}
}
});

Expand Down
2 changes: 1 addition & 1 deletion lighthouserc.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"url": [
"http://localhost:3000/"
],
"numberOfRuns": 1
"numberOfRuns": 5
},
"assert": {
"assertions": {
Expand Down
2 changes: 1 addition & 1 deletion lighthouserckeploy.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"url": [
"https://www.keploy.io"
],
"numberOfRuns": 1
"numberOfRuns": 5
},
"assert": {
"assertions": {
Expand Down

0 comments on commit 983fceb

Please sign in to comment.