Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,12 @@ jobs:
name: Web UI workflow
needs: get-vars
permissions:
contents: read
id-token: write # is required by nested component-check
# Required to checkout the code
contents: write
checks: write
# Required to put a comment into the pull-request
pull-requests: write
secrets:
AWS_ROLE: ${{ secrets.AWS_ROLE }}
AWS_REGION: ${{ secrets.AWS_REGION }}
Expand Down
52 changes: 46 additions & 6 deletions .github/workflows/web-ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
working-directory: "web_ui"
run: tar -czf build.tar.gz build

- uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 #v4.6.2
with:
name: webui-build
path: "web_ui/build.tar.gz"
Expand Down Expand Up @@ -95,8 +95,8 @@ jobs:
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3, 4, 5]
shardTotal: [5]
shard: [1]
shardTotal: [1]
steps:
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.2
Expand All @@ -114,7 +114,47 @@ jobs:

- name: UI Unit tests
working-directory: "web_ui"
run: npm run test:unit -- --silent --maxWorkers=2 --shard=${{ matrix.shard }}/${{ matrix.shardTotal }}
run: |
npm run test:unit -- --silent --maxWorkers=2 \
--shard=${{ matrix.shard }}/${{ matrix.shardTotal }} \
--coverage --json \
--outputFile=coverage/coverage-shard-${{ matrix.shard }}.json \
--testLocationInResults

- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 #v4.6.2
with:
name: ui-unit-test-coverage-artifacts-${{ matrix.shard }}
path: web_ui/coverage/

report-unit-coverage:
runs-on: ubuntu-latest
permissions:
# Required to checkout the code
contents: write
checks: write
# Required to put a comment into the pull-request
pull-requests: write
needs:
- unit-tests
steps:
- uses: actions/checkout@v3

- uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
with:
pattern: ui-unit-test-coverage-artifacts-*
path: coverage/
merge-multiple: true

- name: Merge coverage reports
run: |
jq 'reduce inputs as $i (.; . * $i)' coverage/coverage-shard-*.json > coverage-merged.json

- name: Publish test results
uses: ArtiomTr/jest-coverage-report-action@262a7bb0b20c4d1d6b6b026af0f008f78da72788 # v2.3.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
base-coverage-file: coverage-merged.json
coverage-file: coverage-merged.json

playwright-tests:
name: Playwright Tests (${{ matrix.shard }}/${{ matrix.shardTotal }})
Expand Down Expand Up @@ -159,7 +199,7 @@ jobs:
run: npm run test:component -- --project "chromium" --project "chromium mini viewport" --shard=${{ matrix.shard }}/${{ matrix.shardTotal }}

- name: Upload blob report to GitHub Actions Artifacts
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 #v4.6.2
if: always()
with:
name: playwright-blob-reports-${{ matrix.shard }}
Expand Down Expand Up @@ -200,7 +240,7 @@ jobs:
run: npx playwright merge-reports --reporter html ./playwright-blob-reports

- name: Upload HTML report
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 #v4.6.2
with:
name: playwright-html-report-attempt-${{ github.run_attempt }}
path: web_ui/playwright-report
Expand Down
17 changes: 17 additions & 0 deletions web_ui/packages/config/test/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,22 @@ export default {
},
moduleFileExtensions: ['web.js', 'js', 'web.ts', 'ts', 'web.tsx', 'tsx', 'json', 'web.jsx', 'jsx', 'node'],
resetMocks: false,
coveragePathIgnorePatterns: [
'src/service-worker.ts',
'src/serviceWorkerRegistration.ts',
'src/webworkers',
'src/hooks/use-worker/utils.ts',
'src/theme',
'src/report-web-vitals.ts',
'src/app.component.tsx',
'src/index.tsx',
'src/assets',
'src/e2e',
'src/intel-admin-app',
'src/sign-up',
'dev-proxy.ts',
'tests',
],
coverageReporters: ['clover', 'json', 'json-summary'],
globalSetup: path.resolve(dirname, './jest.global.js'),
};
Loading