|
|
@@ -40,21 +40,25 @@ pipeline {
|
|
|
}
|
|
|
|
|
|
// 2. Installation des dépendances et tests unitaires Angular
|
|
|
- stage('Test Unitaires') {
|
|
|
+ stage('Unit Tests') {
|
|
|
+ agent {
|
|
|
+ docker {
|
|
|
+ image 'node:14' // Compatible Angular 9
|
|
|
+ args '-u root:root' // Si problèmes de droits
|
|
|
+ }
|
|
|
+ }
|
|
|
steps {
|
|
|
- script {
|
|
|
- docker.image('cypress/included:9.7.0').inside {
|
|
|
- dir('angular-client') {
|
|
|
- sh 'npm install --legacy-peer-deps'
|
|
|
- sh 'npm run test -- --watch=false --no-progress --browsers=ChromeHeadless --code-coverage || true'
|
|
|
- }
|
|
|
- }
|
|
|
+ dir('angular-client') {
|
|
|
+ sh '''
|
|
|
+ npm install --legacy-peer-deps
|
|
|
+ npm run test -- --no-watch --no-progress --browsers=ChromeHeadless
|
|
|
+ '''
|
|
|
}
|
|
|
- junit 'angular-client/coverage/**/junit-report.xml'
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
+
|
|
|
// 3. Analyse SonarQube pour la qualité du code
|
|
|
// stage('SonarQube Analysis') {
|
|
|
// steps {
|