-
Notifications
You must be signed in to change notification settings - Fork 968
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lighthouse performance metrics setup #9304
base: main
Are you sure you want to change the base?
Changes from 9 commits
8913f15
bb50042
49713ef
fb42ef5
3c0799e
3d5dddc
063d9a1
20dbacf
6636bf9
b937c42
3f15a5f
4aa842b
33b9660
7f59b70
4b63789
20957e7
1bcb100
664d4de
f6c03a7
846bccf
5f785ae
c566adf
1f70a7b
127f17d
db60ecd
edc648f
3142bd4
5f3b91a
38a6caa
0045291
e90be27
7feae97
75591b7
c947e1b
7550500
ee1320d
f3919b7
ce194a5
fe08858
ea7c386
43b7df8
09c2fa8
403f9c4
4e0a4b6
2d46b30
22512cc
aa578dc
15c7500
19663c1
0b459c3
736374b
f4f64f7
45a28ed
49a1963
b8e941d
993f288
1b63348
1b2539a
96be570
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Performance Testing | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
lighthouse: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version-file: '.nvmrc' | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
- name: Setup Yarn | ||
run: | | ||
npm uninstall -g yarn | ||
npm i -g yarn@1.22.10 | ||
|
||
- name: Run bootstrap | ||
run: yarn osd bootstrap | ||
|
||
- name: Install Lighthouse CI | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is there not a github action that we can pull from the marketplace and run this? |
||
run: yarn global add @lhci/cli | ||
|
||
- name: Build OpenSearch Dashboards | ||
run: yarn build | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. build will build a platform distribution. are we sure we dont want to |
||
|
||
- name: Start OpenSearch Dashboards | ||
run: yarn start --no-base-path & yarn wait-on http://localhost:5601 | ||
|
||
- name: Run Lighthouse CI | ||
run: yarn lhci autorun || echo "Lighthouse assertion failed, check results" | ||
|
||
- name: Post Lighthouse Report to PR | ||
if: always() | ||
run: | | ||
echo "🚦 **Lighthouse CI Report**" > comment.txt | ||
echo "" >> comment.txt | ||
lhci upload --target=temporary-public-storage | tee lhci_output.txt | ||
REPORT_URL=$(grep -o 'https://storage.googleapis.com/lighthouse-infrastructure-.*' lhci_output.txt | head -n 1) | ||
echo "🔗 [View Full Lighthouse Report]($REPORT_URL)" >> comment.txt | ||
gh pr comment ${{ github.event.pull_request.number }} --body "$(cat comment.txt)" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
const baseUrl = 'http://localhost:5601'; | ||
ruchidh marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. baseUrl technically doesn't have to be 5601. It can be configurable to be something like 443 |
||
|
||
module.exports = { | ||
ci: { | ||
collect: { | ||
url: [`${baseUrl}`, `${baseUrl}/app/data-explorer/discover`, `${baseUrl}/app/dashboards`], // Add more URLs as needed | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Something i'm wondering about... Without some specific actions, I don't think any results would be loaded in Is it possible to start with some examples that'll load? perhaps the sample data (but even with that i think we need to modify the URL so we are hitting the correct page. For example There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1, you can actually hit the api or bulk insert saved objects and data There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, have plan to do so, updating mock data |
||
startServerCommand: 'yarn start --no-base-path', | ||
numberOfRuns: 3, | ||
settings: { | ||
chromePath: require('puppeteer').executablePath(), | ||
chromeFlags: '--no-sandbox --disable-gpu --headless', | ||
}, | ||
}, | ||
assert: { | ||
preset: 'lighthouse:recommended', | ||
assertions: { | ||
performance: ['error', { minScore: 0.9 }], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oof i think we need make the minscore much lower. and it might differ between the different URLs. For example on There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is only for testing purpose, would change in final review. |
||
'first-contentful-paint': ['warn', { maxNumericValue: 1800 }], | ||
'largest-contentful-paint': ['warn', { maxNumericValue: 2500 }], | ||
interactive: ['warn', { maxNumericValue: 5000 }], | ||
'total-blocking-time': ['warn', { maxNumericValue: 300 }], | ||
}, | ||
}, | ||
upload: { | ||
target: 'temporary-public-storage', // Required for GitHub integration | ||
}, | ||
}, | ||
}; | ||
ruchidh marked this conversation as resolved.
Show resolved
Hide resolved
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need: