Skip to content

Commit

Permalink
[INFRA] upload html test results in GitHub Build workflow (#622)
Browse files Browse the repository at this point in the history
Setup the html jest reporter to easily read errors both locally and as a results of run with GitHub workflows.
The test result artifacts are only uploaded on test failure.
  • Loading branch information
tbouffard authored Oct 1, 2020
1 parent fa2a135 commit 1abac6c
Show file tree
Hide file tree
Showing 5 changed files with 2,915 additions and 195 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,20 @@ jobs:
- name: Build Application
run: npm run build
- name: Test Application
id: 'test_unit'
run: npm run test:unit
- name: Upload unit test results
if: ${{ failure() && steps.test_unit.outcome == 'failure' }}
uses: actions/upload-artifact@v2
with:
name: unit-test-results-${{matrix.os.name}}-${{github.sha}}
path: build/test-report/unit
- name: Test Application End to End
id: 'test_e2e'
run: npm run test:e2e
- name: Upload e2e test results
if: ${{ failure() && steps.test_e2e.outcome == 'failure' }}
uses: actions/upload-artifact@v2
with:
name: e2e-test-results-${{matrix.os.name}}-${{github.sha}}
path: build/test-report/e2e
12 changes: 12 additions & 0 deletions jest.config.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,16 @@ module.exports = {
setupFiles: ['<rootDir>/test/e2e/config/jest.globals.ts'],
// jest-image-snapshot configuration doesn't work with setupFiles, fix with setupFilesAfterEnv: see https://github.com/testing-library/jest-dom/issues/122#issuecomment-650520461
setupFilesAfterEnv: ['<rootDir>/test/e2e/config/jest.image.ts'],
reporters: [
'default',
[
'jest-html-reporter',
{
pageTitle: 'bpmn-visualization E2E Test Report',
outputPath: 'build/test-report/e2e/index.html',
includeFailureMsg: true,
includeSuiteFailure: true,
},
],
],
};
12 changes: 12 additions & 0 deletions jest.config.unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,16 @@ module.exports = {
},
coverageReporters: ['json', 'json-summary', 'lcov', 'text', 'text-summary', 'clover'],
setupFiles: ['<rootDir>/test/unit/jest.globals.ts'],
reporters: [
'default',
[
'jest-html-reporter',
{
pageTitle: 'bpmn-visualization Unit Test Report',
outputPath: 'build/test-report/unit/index.html',
includeFailureMsg: true,
includeSuiteFailure: true,
},
],
],
};
Loading

0 comments on commit 1abac6c

Please sign in to comment.