Skip to content

Commit

Permalink
generate screenshots on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
vtsvetkov-splunk committed Feb 12, 2024
1 parent 9c21a69 commit 76223fc
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/storybook-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,15 @@ jobs:
run: |
npx concurrently --kill-others --success first -n "SB,TEST" \
"npx http-server storybook-static --port 6006 --silent" \
"npx wait-on tcp:6006 && yarn test-storybook"
"npx wait-on tcp:6006 && yarn test-storybook -u"
- name: Push updated screenshots
uses: actions/checkout@v4
- run: |
git config user.name github-actions
git config user.email [email protected]
git add \*.png
git commit -m "update screenshots [skip ci]"
git push
- uses: actions/upload-artifact@v4
name: 'Upload test report'
if: ${{ failure() }}
Expand Down
7 changes: 6 additions & 1 deletion ui/.storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ initialize({
},
onUnhandledRequest(req) {
const url = req.url;
const skipList = ['bundle.js', 'hot-update.js', 'http://localhost:6006/index.json'];
const skipList = [
'bundle.js',
'hot-update.js',
'http://localhost:6006/index.json',
'.woff',
];
const shouldRequestBeBypassed = skipList.some((passItem) => url.includes(passItem));
if (!shouldRequestBeBypassed) {
console.warn('Found an unhandled %s request to %s', req.method, url);
Expand Down
5 changes: 0 additions & 5 deletions ui/.storybook/test-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,6 @@ const config: TestRunnerConfig = {
customSnapshotIdentifier,
storeReceivedOnFailure: true,
customReceivedDir,
customDiffConfig: {
threshold: 0.3,
},
failureThreshold: 0.01,
failureThresholdType: 'percent',
});
},
};
Expand Down

0 comments on commit 76223fc

Please sign in to comment.