DESKTOP-SMCIPAV\falko 4 mēneši atpakaļ
vecāks
revīzija
a39f7f5d13
1 mainītis faili ar 11 papildinājumiem un 5 dzēšanām
  1. 11 5
      Jenkinsfile

+ 11 - 5
Jenkinsfile

@@ -40,20 +40,25 @@ pipeline {
         }
 
         // 2. Installation des dépendances et tests unitaires Angular
-       stage('Unit Tests') {
+     stage('Unit Tests') {
   agent {
     docker {
-      image 'node:14'
+      image 'cypress/browsers:node14.17.0-chrome91-ff89'
       args '-u root:root'
     }
   }
+  environment {
+    CHROME_BIN = '/usr/bin/google-chrome'
+    NODE_OPTIONS = '--max-old-space-size=4096'
+  }
   steps {
     dir('angular-client') {
       sh '''
-        apt-get update && apt-get install -y chromium
-        export CHROME_BIN=$(which chromium)
+        echo "✅ Installation des dépendances"
         npm install --legacy-peer-deps
-        npm run test -- --no-watch --no-progress --browsers=ChromeHeadless
+
+        echo "✅ Lancement des tests"
+        npx ng test --no-watch --no-progress --browsers=ChromeHeadless
       '''
     }
   }
@@ -62,6 +67,7 @@ pipeline {
 
 
 
+
         // 3. Analyse SonarQube pour la qualité du code
         // stage('SonarQube Analysis') {
         //     steps {