hopefully updates the ci pipeline to run jest

i updated the gitlab ci pipeline so that hopefully it will run jest coverage stuff for sonar
This commit is contained in:
reesporte 2021-10-28 16:19:03 -05:00
parent 5b869c2810
commit cdbfcef0eb
2 changed files with 12 additions and 2 deletions

View file

@ -64,16 +64,25 @@ generate coverage html:
needs:
- job: run go tests
run jest tests:
stage: test
image: sonarsource/sonar-scanner-cli:latest
script:
- npm install
- npm test -- --coverage --testResultsProcessor=jest-sonar-reporter
- sonar-scanner
upload to sonarcloud:
stage: test
image: sonarsource/sonar-scanner-cli:4.6
variables:
SONAR_TOKEN: $SONAR_TOKEN
script:
- sonar-scanner -Dsonar.projectKey=molecula_featurebase -Dsonar.organization=molecula -Dsonar.sources=. -Dsonar.host.url=https://sonarcloud.io -Dsonar.go.coverage.reportPaths=coverage.out -Dsonar.go.tests.reportPaths=test-report.out
- sonar-scanner -Dsonar.projectKey=molecula_featurebase -Dsonar.organization=molecula -Dsonar.sources=. -Dsonar.host.url=https://sonarcloud.io -Dsonar.go.coverage.reportPaths=coverage.out -Dsonar.go.tests.reportPaths=test-report.out -Dsonar.testExecutionReportPaths=test-report.xml
needs:
- job: run go tests
- job: run go tests with output
- job: run jest tests
build for linux amd64:
stage: build
@ -121,4 +130,4 @@ build for darwin arm64:
- go build -o featurebase_darwin_arm64 ./cmd/featurebase
artifacts:
paths:
- featurebase_darwin_arm64
- featurebase_darwin_arm64

View file

@ -44,6 +44,7 @@
"@types/react-dom": "^16.9.8",
"@types/react-router": "^5.1.8",
"@types/react-router-dom": "^5.1.5",
"jest-sonar-reporter": "^2.0.0",
"node-sass": "^4.14.1",
"react-scripts": "^4.0.3",
"tslint": "^6.1.2",