From c9a8d138bca63f7ecf424e15353cb596bce180cf Mon Sep 17 00:00:00 2001 From: Ding Ho Date: Fri, 2 Feb 2024 20:15:07 +0000 Subject: [PATCH 01/11] DAOS-15116 test: fix missing test.cov file on functional VM, HW and unit-test Description: Update vars/unitPackages.groovy Required-githooks: true Signed-off-by: Ding Ho ding-hwa.ho@intel.com --- vars/unitPackages.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vars/unitPackages.groovy b/vars/unitPackages.groovy index d9449b7ea..f20929249 100644 --- a/vars/unitPackages.groovy +++ b/vars/unitPackages.groovy @@ -21,7 +21,7 @@ String call() { Map stage_info = parseStageInfo() String target = stage_info['target'] - boolean quick_build = quickBuild() || (stage_info['compiler'] == 'covc') + boolean quick_build = quickBuild() if (target.startsWith('centos') || target.startsWith('el')) { if (quick_build) { From 2aa7f409b6663883663f5d2ce9cfa0737aa1a0d9 Mon Sep 17 00:00:00 2001 From: Ding Ho Date: Fri, 2 Feb 2024 20:26:55 +0000 Subject: [PATCH 02/11] DAOS-15116 test: fix missing test.cov file and unit-test Description: update unitPackages.groovy Required-githooks: true Signed-off-by: Ding Ho ding-hwa.ho@intel.com --- vars/unitPackages.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vars/unitPackages.groovy b/vars/unitPackages.groovy index d9449b7ea..f20929249 100644 --- a/vars/unitPackages.groovy +++ b/vars/unitPackages.groovy @@ -21,7 +21,7 @@ String call() { Map stage_info = parseStageInfo() String target = stage_info['target'] - boolean quick_build = quickBuild() || (stage_info['compiler'] == 'covc') + boolean quick_build = quickBuild() if (target.startsWith('centos') || target.startsWith('el')) { if (quick_build) { From 68e56f909fc7d4fde98dd1213a13d2a8c4ef9e78 Mon Sep 17 00:00:00 2001 From: Ding Ho Date: Sat, 3 Feb 2024 02:15:49 +0000 Subject: [PATCH 03/11] Recommit Required-githooks: true Signed-off-by: Ding Ho ding-hwa.ho@intel.com From f81fca14716d29879cd283b0042bd4c4f317492d Mon Sep 17 00:00:00 2001 From: Ding Ho Date: Tue, 27 Feb 2024 21:23:54 +0000 Subject: [PATCH 04/11] DAOS-15150 test: To implement bullseye_generate_report and fix error Update runTestFunctionalV2.groovy with bullseye test.cov stash Signed-off-by: Ding Ho ding-hwa.ho@intel.com --- vars/runTestFunctionalV2.groovy | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/vars/runTestFunctionalV2.groovy b/vars/runTestFunctionalV2.groovy index 3acfb43bf..d50d441bc 100644 --- a/vars/runTestFunctionalV2.groovy +++ b/vars/runTestFunctionalV2.groovy @@ -88,14 +88,25 @@ Map call(Map config = [:]) { // Restore the ignore failure setting config['ignore_failure'] = ignore_failure - String covfile = 'test.cov' - if (!fileExists('test.cov')) { - covfile += '_not_done' - fileOperations([fileCreateOperation(fileName: covfile, - fileContent: '')]) + if (fileExists("${basedir}bullseye_coverage_logs/test.cov")) { + String name = 'func' + stage_info['pragma_suffix'] + '-cov' + println("[${env.STAGE_NAME}] Stashing ${basedir}bullseye_coverage_logs/test.cov in ${name}") + dir("${basedir}bullseye_coverage_logs") { + stash name: config.get('coverage_stash', name), + includes: 'test.cov' + } + } else { + println("[${env.STAGE_NAME}] No ${basedir}bullseye_coverage_logs/test.cov file found!") } - String name = 'func' + stage_info['pragma_suffix'] + '-cov' - stash name: config.get('coverage_stash', name), - includes: covfile + +// String covfile = 'test.cov' +// if (!fileExists('test.cov')) { +// covfile += '_not_done' +// fileOperations([fileCreateOperation(fileName: covfile, +// fileContent: '')]) +// } +// String name = 'func' + stage_info['pragma_suffix'] + '-cov' +// stash name: config.get('coverage_stash', name), +// includes: covfile return runData } From b3d803a4e971e970c6bd38b3a81488c08de5d037 Mon Sep 17 00:00:00 2001 From: Ding Ho Date: Wed, 28 Feb 2024 21:16:11 +0000 Subject: [PATCH 05/11] Recommit Signed-off-by: Ding Ho ding-hwa.ho@intel.com From 060f62460bcac3d419ef5fb132269781bdb45195 Mon Sep 17 00:00:00 2001 From: Ding Ho Date: Mon, 11 Mar 2024 20:19:25 +0000 Subject: [PATCH 06/11] Update functionalTest.groovy with get bullseye.tar Required-githooks: true Signed-off-by: Ding Ho ding-hwa.ho@intel.com --- vars/functionalTest.groovy | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/vars/functionalTest.groovy b/vars/functionalTest.groovy index 9f2594e91..89b5adfc1 100755 --- a/vars/functionalTest.groovy +++ b/vars/functionalTest.groovy @@ -137,6 +137,15 @@ Map call(Map config = [:]) { error.getMessage()) } + if (!env.BULLSEYE) { + String tools_url = env.JENKINS_URL + + 'job/daos-stack/job/tools/job/master' + + '/lastSuccessfulBuild/artifact/' + httpRequest url: tools_url + 'bullseyecoverage-linux.tar', + httpMode: 'GET', + outputFile: 'bullseye.tar' + } + Map runtestData = [:] if (config.get('test_function', 'runTestFunctional') == 'runTestFunctionalV2') { From 95eb6ed82506ec4672ad4e4037118a307d7bb3d5 Mon Sep 17 00:00:00 2001 From: Ding Ho Date: Wed, 13 Mar 2024 18:51:14 +0000 Subject: [PATCH 07/11] Update functionalTest.groovy per Phil's comment. Required-githooks: true Signed-off-by: Ding Ho ding-hwa.ho@intel.com --- vars/functionalTest.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vars/functionalTest.groovy b/vars/functionalTest.groovy index 89b5adfc1..ea35471f0 100755 --- a/vars/functionalTest.groovy +++ b/vars/functionalTest.groovy @@ -137,7 +137,7 @@ Map call(Map config = [:]) { error.getMessage()) } - if (!env.BULLSEYE) { + if (env.BULLSEYE) { String tools_url = env.JENKINS_URL + 'job/daos-stack/job/tools/job/master' + '/lastSuccessfulBuild/artifact/' From f742933b3f84af11ccbc1ebaf7c4fb0a5871380a Mon Sep 17 00:00:00 2001 From: Phil Henderson Date: Thu, 14 Mar 2024 15:43:26 -0400 Subject: [PATCH 08/11] Add configureBullseye.groovy script. Signed-off-by: Phil Henderson --- vars/configureBullseye.groovy | 35 +++++++++++++++++++++++++++++++++++ vars/functionalTest.groovy | 7 +------ vars/sconsBuild.groovy | 7 +------ vars/unitTest.groovy | 7 +------ 4 files changed, 38 insertions(+), 18 deletions(-) create mode 100644 vars/configureBullseye.groovy diff --git a/vars/configureBullseye.groovy b/vars/configureBullseye.groovy new file mode 100644 index 000000000..c893ef576 --- /dev/null +++ b/vars/configureBullseye.groovy @@ -0,0 +1,35 @@ +// vars/configureBullseye.groovy + +/** + * configureBullseye.groovy + * + * Download and install bullseye. + * + * @param kwargs Map containing the following optional arguments (empty strings yield defaults): + * prefix where to install bullseye + * @return a scripted stage to run in a pipeline + */ +Map call(Map kwargs = [:]) { + String prefix = kwargs.get('prefix', '/opt/BullseyeCoverage') + Boolean download_only = kwargs.get('download_only', false) + + echo "[${env.STAGE_NAME}] Downloading bullseye" + String tools_url = "${env.JENKINS_URL}job/daos-stack/job/tools/job/master/lastSuccessfulBuild" + String bullseye_url = "${tools_url}/artifact/bullseyecoverage-linux.tar" + httpRequest url: bullseye_url, httpMode: 'GET', outputFile: 'bullseye.tar' + + if(download_only) { + return true + } + + echo "[${env.STAGE_NAME}] Installing bullseye" + return sh(label: 'Install bullseye', + /* groovylint-disable-next-line GStringExpressionWithinString */ + script: '''mkdir -p bullseye + tar -C bullseye --strip-components=1 -xf bullseye.tar + pushd bullseye + ./install --quiet --key "'''+ env.BULLSEYE + '''" --prefix ''' + prefix + + '''popd + rm -rf bullseye.tar bullseye''', + returnStatus: true) == 0 +} diff --git a/vars/functionalTest.groovy b/vars/functionalTest.groovy index 89b5adfc1..dbdc3d7e9 100755 --- a/vars/functionalTest.groovy +++ b/vars/functionalTest.groovy @@ -138,12 +138,7 @@ Map call(Map config = [:]) { } if (!env.BULLSEYE) { - String tools_url = env.JENKINS_URL + - 'job/daos-stack/job/tools/job/master' + - '/lastSuccessfulBuild/artifact/' - httpRequest url: tools_url + 'bullseyecoverage-linux.tar', - httpMode: 'GET', - outputFile: 'bullseye.tar' + configureBullseye() } Map runtestData = [:] diff --git a/vars/sconsBuild.groovy b/vars/sconsBuild.groovy index 668b10027..2c9f3fa42 100644 --- a/vars/sconsBuild.groovy +++ b/vars/sconsBuild.groovy @@ -123,12 +123,7 @@ Map call(Map config = [:]) { } if (stage_info['compiler'] == 'covc') { - httpRequest url: env.JENKINS_URL + - 'job/daos-stack/job/tools/job/master' + - '/lastSuccessfulBuild/artifact/' + - 'bullseyecoverage-linux.tar', - httpMode: 'GET', - outputFile: 'bullseye.tar' + configureBullseye(download_only: true) } def set_cwd = '' diff --git a/vars/unitTest.groovy b/vars/unitTest.groovy index a1e6641f2..db76eda0b 100755 --- a/vars/unitTest.groovy +++ b/vars/unitTest.groovy @@ -165,12 +165,7 @@ Map call(Map config = [:]) { } if (stage_info['compiler'] == 'covc') { - String tools_url = env.JENKINS_URL + - 'job/daos-stack/job/tools/job/master' + - '/lastSuccessfulBuild/artifact/' - httpRequest url: tools_url + 'bullseyecoverage-linux.tar', - httpMode: 'GET', - outputFile: 'bullseye.tar' + configureBullseye() } String with_valgrind = stage_info.get('with_valgrind', '') From 73e9e25334ec971d85fbbec5225a0342acde58e0 Mon Sep 17 00:00:00 2001 From: Phil Henderson Date: Thu, 14 Mar 2024 15:47:08 -0400 Subject: [PATCH 09/11] Fix merge. Signed-off-by: Phil Henderson --- vars/functionalTest.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vars/functionalTest.groovy b/vars/functionalTest.groovy index dbdc3d7e9..362974aca 100755 --- a/vars/functionalTest.groovy +++ b/vars/functionalTest.groovy @@ -137,7 +137,7 @@ Map call(Map config = [:]) { error.getMessage()) } - if (!env.BULLSEYE) { + if (env.BULLSEYE) { configureBullseye() } From 10a82a3cd41a7d5a007d091ac894f7a8ee1186d3 Mon Sep 17 00:00:00 2001 From: Phil Henderson Date: Fri, 15 Mar 2024 16:02:19 -0400 Subject: [PATCH 10/11] Fixing bullseye install. Signed-off-by: Phil Henderson --- vars/configureBullseye.groovy | 7 ++++--- vars/functionalTest.groovy | 6 +++++- vars/sconsBuild.groovy | 6 +++++- vars/unitTest.groovy | 6 +++++- 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/vars/configureBullseye.groovy b/vars/configureBullseye.groovy index c893ef576..4fc46673c 100644 --- a/vars/configureBullseye.groovy +++ b/vars/configureBullseye.groovy @@ -7,7 +7,8 @@ * * @param kwargs Map containing the following optional arguments (empty strings yield defaults): * prefix where to install bullseye - * @return a scripted stage to run in a pipeline + * download_only if true do not install bullseye + * @return a Boolean indicating if bullseye was downloaded and or installed correctly */ Map call(Map kwargs = [:]) { String prefix = kwargs.get('prefix', '/opt/BullseyeCoverage') @@ -28,8 +29,8 @@ Map call(Map kwargs = [:]) { script: '''mkdir -p bullseye tar -C bullseye --strip-components=1 -xf bullseye.tar pushd bullseye - ./install --quiet --key "'''+ env.BULLSEYE + '''" --prefix ''' + prefix + - '''popd + sudo ./install --quiet --key "'''+ env.BULLSEYE + '''" --prefix ''' + prefix + ''' + popd rm -rf bullseye.tar bullseye''', returnStatus: true) == 0 } diff --git a/vars/functionalTest.groovy b/vars/functionalTest.groovy index 362974aca..97bac4f53 100755 --- a/vars/functionalTest.groovy +++ b/vars/functionalTest.groovy @@ -138,7 +138,11 @@ Map call(Map config = [:]) { } if (env.BULLSEYE) { - configureBullseye() + if (!configureBullseye()) { + catchError(stageResult: 'FAILURE', buildResult: 'FAILURE') { + error('Issue detected installing bullseye.') + } + } } Map runtestData = [:] diff --git a/vars/sconsBuild.groovy b/vars/sconsBuild.groovy index 2c9f3fa42..9aaf65b74 100644 --- a/vars/sconsBuild.groovy +++ b/vars/sconsBuild.groovy @@ -123,7 +123,11 @@ Map call(Map config = [:]) { } if (stage_info['compiler'] == 'covc') { - configureBullseye(download_only: true) + if (!configureBullseye(download_only: true)) { + catchError(stageResult: 'FAILURE', buildResult: 'FAILURE') { + error('Issue detected installing bullseye.') + } + } } def set_cwd = '' diff --git a/vars/unitTest.groovy b/vars/unitTest.groovy index db76eda0b..51b61dbb8 100755 --- a/vars/unitTest.groovy +++ b/vars/unitTest.groovy @@ -165,7 +165,11 @@ Map call(Map config = [:]) { } if (stage_info['compiler'] == 'covc') { - configureBullseye() + if (!configureBullseye()) { + catchError(stageResult: 'FAILURE', buildResult: 'FAILURE') { + error('Issue detected installing bullseye.') + } + } } String with_valgrind = stage_info.get('with_valgrind', '') From 9d707f9704a5d7cf37c695a59ec5bfa13e7235a6 Mon Sep 17 00:00:00 2001 From: Phil Henderson Date: Wed, 20 Mar 2024 09:14:14 -0400 Subject: [PATCH 11/11] Only download the bullseye file in pipeline-lib. Signed-off-by: Phil Henderson --- vars/configureBullseye.groovy | 36 ----------------------------------- vars/downloadBullseye.groovy | 14 ++++++++++++++ vars/functionalTest.groovy | 6 +----- vars/sconsBuild.groovy | 6 +----- vars/unitTest.groovy | 6 +----- 5 files changed, 17 insertions(+), 51 deletions(-) delete mode 100644 vars/configureBullseye.groovy create mode 100644 vars/downloadBullseye.groovy diff --git a/vars/configureBullseye.groovy b/vars/configureBullseye.groovy deleted file mode 100644 index 4fc46673c..000000000 --- a/vars/configureBullseye.groovy +++ /dev/null @@ -1,36 +0,0 @@ -// vars/configureBullseye.groovy - -/** - * configureBullseye.groovy - * - * Download and install bullseye. - * - * @param kwargs Map containing the following optional arguments (empty strings yield defaults): - * prefix where to install bullseye - * download_only if true do not install bullseye - * @return a Boolean indicating if bullseye was downloaded and or installed correctly - */ -Map call(Map kwargs = [:]) { - String prefix = kwargs.get('prefix', '/opt/BullseyeCoverage') - Boolean download_only = kwargs.get('download_only', false) - - echo "[${env.STAGE_NAME}] Downloading bullseye" - String tools_url = "${env.JENKINS_URL}job/daos-stack/job/tools/job/master/lastSuccessfulBuild" - String bullseye_url = "${tools_url}/artifact/bullseyecoverage-linux.tar" - httpRequest url: bullseye_url, httpMode: 'GET', outputFile: 'bullseye.tar' - - if(download_only) { - return true - } - - echo "[${env.STAGE_NAME}] Installing bullseye" - return sh(label: 'Install bullseye', - /* groovylint-disable-next-line GStringExpressionWithinString */ - script: '''mkdir -p bullseye - tar -C bullseye --strip-components=1 -xf bullseye.tar - pushd bullseye - sudo ./install --quiet --key "'''+ env.BULLSEYE + '''" --prefix ''' + prefix + ''' - popd - rm -rf bullseye.tar bullseye''', - returnStatus: true) == 0 -} diff --git a/vars/downloadBullseye.groovy b/vars/downloadBullseye.groovy new file mode 100644 index 000000000..121e4066c --- /dev/null +++ b/vars/downloadBullseye.groovy @@ -0,0 +1,14 @@ +// vars/downloadBullseye.groovy + +/** + * downloadBullseye.groovy + * + * Download bullseye. + * + */ +void call() { + echo "[${env.STAGE_NAME}] Downloading bullseye" + String tools_url = "${env.JENKINS_URL}job/daos-stack/job/tools/job/master/lastSuccessfulBuild" + String bullseye_url = "${tools_url}/artifact/bullseyecoverage-linux.tar" + httpRequest url: bullseye_url, httpMode: 'GET', outputFile: 'bullseye.tar' +} diff --git a/vars/functionalTest.groovy b/vars/functionalTest.groovy index 97bac4f53..2a8d364d2 100755 --- a/vars/functionalTest.groovy +++ b/vars/functionalTest.groovy @@ -138,11 +138,7 @@ Map call(Map config = [:]) { } if (env.BULLSEYE) { - if (!configureBullseye()) { - catchError(stageResult: 'FAILURE', buildResult: 'FAILURE') { - error('Issue detected installing bullseye.') - } - } + downloadBullseye() } Map runtestData = [:] diff --git a/vars/sconsBuild.groovy b/vars/sconsBuild.groovy index 9aaf65b74..216fbff49 100644 --- a/vars/sconsBuild.groovy +++ b/vars/sconsBuild.groovy @@ -123,11 +123,7 @@ Map call(Map config = [:]) { } if (stage_info['compiler'] == 'covc') { - if (!configureBullseye(download_only: true)) { - catchError(stageResult: 'FAILURE', buildResult: 'FAILURE') { - error('Issue detected installing bullseye.') - } - } + downloadBullseye() } def set_cwd = '' diff --git a/vars/unitTest.groovy b/vars/unitTest.groovy index 51b61dbb8..61947d59a 100755 --- a/vars/unitTest.groovy +++ b/vars/unitTest.groovy @@ -165,11 +165,7 @@ Map call(Map config = [:]) { } if (stage_info['compiler'] == 'covc') { - if (!configureBullseye()) { - catchError(stageResult: 'FAILURE', buildResult: 'FAILURE') { - error('Issue detected installing bullseye.') - } - } + downloadBullseye() } String with_valgrind = stage_info.get('with_valgrind', '')