From 80c76f1ced7685691de5e12e20aa602421c07981 Mon Sep 17 00:00:00 2001 From: Jesse McFarland Date: Fri, 7 Oct 2022 12:35:36 -0400 Subject: [PATCH] Fix setting of SRW_WE2E_COMPREHENSIVE_TESTS var The SRW_WE2E_COMPREHENSIVE_TESTS variable was incorrectly set by a sh block that proceeded the call to srw_test.sh. This issue was hidden because Jenkins sets the parameters to environment variables, which are accessible from sh blocks. However, the parameters do not seem to be set as environment variables the first time a multi-branch pipeline is initialized. This resulted in an unbound variable error when the SRW_WE2E_COMPREHENSIVE_TESTS variable was accessed by the srw_test.sh script. This update sets SRW_WE2E_COMPREHENSIVE_TESTS in the same sh block as the srw_test.sh script call, while ensuring the WORKSPACE variable isn't evaluated until the sh block. --- .cicd/Jenkinsfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.cicd/Jenkinsfile b/.cicd/Jenkinsfile index 72eea01ba4..fcf5836c7c 100644 --- a/.cicd/Jenkinsfile +++ b/.cicd/Jenkinsfile @@ -167,8 +167,7 @@ pipeline { } } - sh "export SRW_WE2E_COMPREHENSIVE_TESTS=${run_we2e_comprehensive_tests}" - sh 'bash --login "${WORKSPACE}/.cicd/scripts/srw_test.sh"' + sh "SRW_WE2E_COMPREHENSIVE_TESTS=${run_we2e_comprehensive_tests}" + ' bash --login "${WORKSPACE}/.cicd/scripts/srw_test.sh"' } }