1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-21 11:35:34 +01:00

Upload and process test results as an artifact and report (#4435)

This commit is contained in:
Matt Bishop 2023-01-11 09:01:02 -05:00 committed by GitHub
parent 2b67563868
commit 4be2989fec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 55 additions and 5 deletions

View File

@ -53,8 +53,16 @@ jobs:
done done
- name: Run tests - name: Run tests
run: | run: npm run test
npm run test
- name: Report test results
uses: dorny/test-reporter@c9b3d0e2bd2a4e96aaf424dbaa31c46b42318226
if: always()
with:
name: Test Results
path: "junit.xml"
reporter: jest-junit
fail-on-error: true
rust: rust:
name: rust - ${{ matrix.os }} name: rust - ${{ matrix.os }}
@ -102,6 +110,4 @@ jobs:
- name: Test Windows / macOS - name: Test Windows / macOS
if: ${{ matrix.os!='ubuntu-latest' }} if: ${{ matrix.os!='ubuntu-latest' }}
working-directory: ./apps/desktop/desktop_native working-directory: ./apps/desktop/desktop_native
run: | run: cargo test -- --test-threads=1
cargo test -- --test-threads=1

1
.gitignore vendored
View File

@ -30,6 +30,7 @@ build
# Testing # Testing
coverage coverage
junit.xml
# Misc # Misc
*.crx *.crx

View File

@ -3,6 +3,8 @@ const { pathsToModuleNameMapper } = require("ts-jest");
const { compilerOptions } = require("./tsconfig"); const { compilerOptions } = require("./tsconfig");
module.exports = { module.exports = {
reporters: ["default", "jest-junit"],
collectCoverage: true, collectCoverage: true,
coverageReporters: ["html", "lcov"], coverageReporters: ["html", "lcov"],
coverageDirectory: "coverage", coverageDirectory: "coverage",

40
package-lock.json generated
View File

@ -138,6 +138,7 @@
"html-webpack-injector": "^1.1.4", "html-webpack-injector": "^1.1.4",
"html-webpack-plugin": "^5.5.0", "html-webpack-plugin": "^5.5.0",
"husky": "^8.0.1", "husky": "^8.0.1",
"jest-junit": "^15.0.0",
"jest-mock-extended": "2.0.6", "jest-mock-extended": "2.0.6",
"jest-preset-angular": "^12.1.0", "jest-preset-angular": "^12.1.0",
"lint-staged": "^13.0.3", "lint-staged": "^13.0.3",
@ -28370,6 +28371,21 @@
"node": ">= 10.13.0" "node": ">= 10.13.0"
} }
}, },
"node_modules/jest-junit": {
"version": "15.0.0",
"resolved": "https://registry.npmjs.org/jest-junit/-/jest-junit-15.0.0.tgz",
"integrity": "sha512-Z5sVX0Ag3HZdMUnD5DFlG+1gciIFSy7yIVPhOdGUi8YJaI9iLvvBb530gtQL2CHmv0JJeiwRZenr0VrSR7frvg==",
"dev": true,
"dependencies": {
"mkdirp": "^1.0.4",
"strip-ansi": "^6.0.1",
"uuid": "^8.3.2",
"xml": "^1.0.1"
},
"engines": {
"node": ">=10.12.0"
}
},
"node_modules/jest-leak-detector": { "node_modules/jest-leak-detector": {
"version": "28.1.3", "version": "28.1.3",
"resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-28.1.3.tgz", "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-28.1.3.tgz",
@ -43046,6 +43062,12 @@
"node": ">=8" "node": ">=8"
} }
}, },
"node_modules/xml": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/xml/-/xml-1.0.1.tgz",
"integrity": "sha512-huCv9IH9Tcf95zuYCsQraZtWnJvBtLVE0QHMOs8bWyZAFZNDcYjsPq1nEx8jKA9y+Beo9v+7OBPRisQTjinQMw==",
"dev": true
},
"node_modules/xml-name-validator": { "node_modules/xml-name-validator": {
"version": "3.0.0", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz",
@ -64858,6 +64880,18 @@
} }
} }
}, },
"jest-junit": {
"version": "15.0.0",
"resolved": "https://registry.npmjs.org/jest-junit/-/jest-junit-15.0.0.tgz",
"integrity": "sha512-Z5sVX0Ag3HZdMUnD5DFlG+1gciIFSy7yIVPhOdGUi8YJaI9iLvvBb530gtQL2CHmv0JJeiwRZenr0VrSR7frvg==",
"dev": true,
"requires": {
"mkdirp": "^1.0.4",
"strip-ansi": "^6.0.1",
"uuid": "^8.3.2",
"xml": "^1.0.1"
}
},
"jest-leak-detector": { "jest-leak-detector": {
"version": "28.1.3", "version": "28.1.3",
"resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-28.1.3.tgz", "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-28.1.3.tgz",
@ -76245,6 +76279,12 @@
"integrity": "sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==", "integrity": "sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==",
"dev": true "dev": true
}, },
"xml": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/xml/-/xml-1.0.1.tgz",
"integrity": "sha512-huCv9IH9Tcf95zuYCsQraZtWnJvBtLVE0QHMOs8bWyZAFZNDcYjsPq1nEx8jKA9y+Beo9v+7OBPRisQTjinQMw==",
"dev": true
},
"xml-name-validator": { "xml-name-validator": {
"version": "3.0.0", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz",

View File

@ -103,6 +103,7 @@
"html-webpack-injector": "^1.1.4", "html-webpack-injector": "^1.1.4",
"html-webpack-plugin": "^5.5.0", "html-webpack-plugin": "^5.5.0",
"husky": "^8.0.1", "husky": "^8.0.1",
"jest-junit": "^15.0.0",
"jest-mock-extended": "2.0.6", "jest-mock-extended": "2.0.6",
"jest-preset-angular": "^12.1.0", "jest-preset-angular": "^12.1.0",
"lint-staged": "^13.0.3", "lint-staged": "^13.0.3",