From 52f8804ce1e6aa783a8853ceb43f202d583cdaad Mon Sep 17 00:00:00 2001 From: Whitney Armstrong <warmstrong@anl.gov> Date: Sat, 3 Oct 2020 22:35:44 -0500 Subject: [PATCH] Added dis to not allow failure modified: .gitlab-ci.yml modified: bin/gen_ci_config new file: dis/dummy_fail_test.sh new file: dis/dummy_test.sh new file: dis/dummy_test2.sh --- .gitlab-ci.yml | 2 +- bin/gen_ci_config | 12 +++++++++--- dis/dummy_fail_test.sh | 7 +++++++ dis/dummy_test.sh | 7 +++++++ dis/dummy_test2.sh | 7 +++++++ 5 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 dis/dummy_fail_test.sh create mode 100644 dis/dummy_test.sh create mode 100644 dis/dummy_test2.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2b2d037f..1079442e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -37,7 +37,7 @@ generate_config: - sodium script: - mkdir -p config && ./bin/gen_ci_config -p test_ -i dummy > config/dummy_config.yml - - mkdir -p config && ./bin/gen_ci_config -p dis_ -i dis > config/dis_config.yml + - mkdir -p config && ./bin/gen_ci_config --no-failure -p dis_ -i dis > config/dis_config.yml child-pipeline: stage: run diff --git a/bin/gen_ci_config b/bin/gen_ci_config index da8803e0..781607b0 100755 --- a/bin/gen_ci_config +++ b/bin/gen_ci_config @@ -2,9 +2,10 @@ set -o nounset set -o errexit -CI_TAG=sodium BENCHMARK_SCRIPT_DIR=./dummy +CI_TAG=sodium CI_JOB_PREFIX=test_ +CI_FAILURE="true" function print_the_help { echo "USAGE: $0 [-t <runner_tag>] " @@ -12,6 +13,7 @@ function print_the_help { echo " -i,--input Input scripts directory " echo " -t,--tag Gitlab Runner tag" echo " -p,--prefix job name prefix" + echo " --no-failure do not allow failures" exit } @@ -39,6 +41,10 @@ do shift # past argument shift # past value ;; + --no-failure) + CI_FAILURE="false" + shift # past argument + ;; *) # unknown option #POSITIONAL+=("$1") # save it in an array for later echo "unknown option $1" @@ -71,7 +77,7 @@ ${CI_JOB_PREFIX}${ifile}_${filename_noext}: stage: benchmarks script: - bash ${script_name} - allow_failure: true + allow_failure: ${CI_FAILURE} EOF done @@ -88,7 +94,7 @@ ${CI_JOB_PREFIX}${ifile}_${filename_noext}: stage: benchmarks script: - root -b -q ${script_name} - allow_failure: true + allow_failure: ${CI_FAILURE} EOF done diff --git a/dis/dummy_fail_test.sh b/dis/dummy_fail_test.sh new file mode 100644 index 00000000..f8c506b3 --- /dev/null +++ b/dis/dummy_fail_test.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +echo "Dummy Test..." +echo "..." +echo "Fails!" + +exit 1 diff --git a/dis/dummy_test.sh b/dis/dummy_test.sh new file mode 100644 index 00000000..5af1dc34 --- /dev/null +++ b/dis/dummy_test.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +echo "Dummy Test..." +echo "..." +echo "Passes!" + +#exit 1 diff --git a/dis/dummy_test2.sh b/dis/dummy_test2.sh new file mode 100644 index 00000000..dfede272 --- /dev/null +++ b/dis/dummy_test2.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +echo "Dummy Test number 2..." +echo "..." +echo "Passes!" + +#exit 1 -- GitLab