|
|
@@ -40,22 +40,20 @@ pipeline {
|
|
|
}
|
|
|
|
|
|
// 2. Installation des dépendances et tests unitaires Angular
|
|
|
- stage('Unit Tests') {
|
|
|
- steps {
|
|
|
- dir('angular-client') {
|
|
|
- sh 'npm install --legacy-peer-deps'
|
|
|
- sh 'npm run test -- --no-watch --no-progress --browsers=ChromeHeadless --code-coverage'
|
|
|
- }
|
|
|
- }
|
|
|
- post {
|
|
|
- always {
|
|
|
- junit 'angular-client/coverage/**/junit-report.xml'
|
|
|
- }
|
|
|
- unsuccessful {
|
|
|
- error "Tests unitaires échoués. Arrêt du pipeline."
|
|
|
- }
|
|
|
- }
|
|
|
+ stage('Test Unitaires') {
|
|
|
+ steps {
|
|
|
+ script {
|
|
|
+ docker.image('cypress/browsers:node14.17.0-chrome91').inside {
|
|
|
+ dir('angular-client') {
|
|
|
+ sh 'npm install --legacy-peer-deps'
|
|
|
+ sh 'npm run test -- --watch=false --browsers=ChromeHeadless --code-coverage'
|
|
|
}
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // JUnit + couverture (si karma.conf.js est bien configuré)
|
|
|
+ junit 'angular-client/coverage/junit-report.xml'
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
// 3. Analyse SonarQube pour la qualité du code
|
|
|
// stage('SonarQube Analysis') {
|