Skip to content

Commit

Permalink
fix(test): test before sonarqube analysis
Browse files Browse the repository at this point in the history
- add CTRF report as PR comment
  • Loading branch information
cgawron committed Oct 3, 2024
1 parent e3c26dc commit c12d1e5
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/sonarqube.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ jobs:

# Run tests
- name: Test
run: yarn workspaces foreach --all run ci
run: yarn run ci

- name: Test Summary
run: npx github-actions-ctrf common/ctrf/ctrf-report.json
run: npx github-actions-ctrf ctrf/ctrf-report.json
if: always()

- name: Post PR Comment
run: npx github-actions-ctrf common/ctrf/ctrf-report.json --pr-comment
run: npx github-actions-ctrf ctrf/ctrf-report.json --pr-comment
if: always()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ sonar-scanner-5.0.1.3006-linux/**


*/TEST-*.xml
*
*/ctrf
2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"type": "module",
"scripts": {
"test": "vitest run src/**/*.spec.ts --coverage",
"ci": "vitest run src/**/*.spec.ts --coverage; yarn dlx junit-to-ctrf TEST-backend.xml",
"ci": "vitest run src/**/*.spec.ts --coverage; yarn dlx junit-to-ctrf -o ../crtf/backend-ctrf.json TEST-backend.xml",
"start": "node build/server.js",
"server": "nodemon src/server.ts",
"dev": "concurrently \"npm run server\" \"npm run client\"",
Expand Down
2 changes: 1 addition & 1 deletion common/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const config: Config = {
verbose: true,
reporters: [
'default',
['jest-ctrf-json-reporter', {}],
['jest-ctrf-json-reporter', { outputFile: 'common-ctrf.json', outputDir: '../crtf' }],
],
testEnvironment: "node",
transform: {
Expand Down
2 changes: 1 addition & 1 deletion common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"types": "./lib/types.d.ts",
"scripts": {
"test": "jest src/**/*.spec.ts --coverage --forceExit --detectOpenHandles",
"ci": "jest src/**/*.spec.ts --ci --coverage --forceExit --detectOpenHandles --reporters='default' --reporters='jest-ctrf-json-reporter'",
"ci": "jest src/**/*.spec.ts --ci --coverage --forceExit --detectOpenHandles",
"build": "tsc",
"doc": "jsdoc -c jsdoc.json"
},
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
},
"scripts": {
"test": "echo \"no tests yet\" && exit 0",
"ci": "yarn workspaces foreach --all run ci; yarn dlx merge-ctrf crtf",
"backend": "yarn workspace backend start",
"client": "yarn workspace client start",
"build:common": "yarn workspace common build",
Expand Down

0 comments on commit c12d1e5

Please sign in to comment.