diff --git a/tests/API-dhcp/Jenkinsfile b/tests/API-dhcp/Jenkinsfile index acb6999..b9bb8b0 100644 --- a/tests/API-dhcp/Jenkinsfile +++ b/tests/API-dhcp/Jenkinsfile @@ -28,6 +28,13 @@ pipeline { ''' echo "Deploy API server for DHCP with Vagrant" sh 'vagrant up --provider=vmware_esxi --provision' + echo 'Create Python venv to work with robotframework' + sh ''' + python3 -m venv robotframework + source venv/bin/activate + pip install -r requirements.txt + ''' + } } } @@ -47,7 +54,13 @@ pipeline { } stage('Run API tests') { steps { - echo 'Running API tests' + dir ('tests/API-dhcp') { + echo 'Running API tests' + sh ''' + source robotframework/bin/activate + robot -d results/ robot/ + ''' + } // Aquí incluirías los comandos para ejecutar tus pruebas } } @@ -61,6 +74,13 @@ pipeline { } } always { + // Recoger los resultados de los tests + robot outputPath: 'tests/API-dhcp/results' , + outputFileName: 'output.xml', + logFileName: 'log.html', + reportFileName: 'report.html', + passThreshold: 100.0, + unstableThreshold: 75.0, // Siempre se ejecutará, independientemente del resultado script { // Elimina la entrada del /etc/hosts