From 3421e18f21de0b231b9ac44b610cda18b913a6ce Mon Sep 17 00:00:00 2001 From: Adam Townsend Date: Wed, 11 Oct 2023 12:05:33 -0700 Subject: [PATCH] added more logic for running tests without killing the whole pipeline, and outputting rspec results --- Jenkinsfile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index a4d1c48..f14f88f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -25,8 +25,12 @@ pipeline { } stage('Run tests') { steps { - sh 'cucumber features --format html --out coverage/cucumber.html' - sh 'rspec spec' + catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') { + sh 'cucumber features --format html --out coverage/cucumber.html' + } + catchError(buildResult: 'UNSTABLE', stageResult: 'FAILURE') { + sh 'rspec spec --format html --out coverage/spec.html' + } } } stage('Report results') { @@ -37,9 +41,9 @@ pipeline { alwaysLinkToLastBuild: false, keepAll: true, reportDir: 'coverage', - reportFiles: 'cucumber.html, index.html', + reportFiles: 'cucumber.html, spec.html, index.html', reportName: 'Test Results', - reportTitles: 'Cucumber Results, Test Coverage']) + reportTitles: 'Cucumber Results, RSpec Results, Test Coverage']) } } }