working on test and sonar
continuous-integration/drone/push Build is failing Details

WORK-RHA
Rémi REGNAULT 1 year ago
parent 50c47747e0
commit 018f274bf7

@ -41,7 +41,8 @@ steps:
commands: commands:
- cd ./API-Project - cd ./API-Project
- npm run test:coverage - npm run test:coverage
- ls - mkdir reports
- cp -r ./coverage/* ./reports
depends_on: [ api-build ] depends_on: [ api-build ]
- name: docker-build-and-push - name: docker-build-and-push
@ -103,5 +104,5 @@ steps:
- unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/ - unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
- export PATH=$SONAR_SCANNER_HOME/bin:$PATH - export PATH=$SONAR_SCANNER_HOME/bin:$PATH
- export SONAR_SCANNER_OPTS="-server" - export SONAR_SCANNER_OPTS="-server"
- sonar-scanner -X -D sonar.projectKey=LeftOvers_Api -D sonar.sources=. -D sonar.host.url=https://codefirst.iut.uca.fr/sonar -D sonar.testExecutionReportPaths=./API-Project/reports/report.test.xml - sonar-scanner -X -D sonar.projectKey=LeftOvers_Api -D sonar.sources=. -D sonar.tests=./API-Project/tests -D sonar.testExecutionReportPaths=./API-Project/reports/report.test.xml
depends_on: [ publish-jest-reports ] depends_on: [ publish-jest-reports ]

@ -37,7 +37,9 @@
}, },
"jest": { "jest": {
"preset": "ts-jest", "preset": "ts-jest",
"testMatch": ["<rootDir>/tests/**/*.spec.ts"] "testMatch": ["<rootDir>/tests/**/*.spec.ts"],
"coverageReporters": ["json", "lcov", "text", "clover"],
"coverageDirectory": "./coverage"
}, },
"jestSonar": { "jestSonar": {
"reportPath": "./reports", "reportPath": "./reports",

Loading…
Cancel
Save