diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e1ea946..8ce725b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,7 +13,7 @@ validate: tags: - docker -leap15.4_show_highstate: +show_highstate: stage: validate before_script: - bin/prepare_test_env.sh -i opensuse -g -o Leap,15,4 @@ -21,6 +21,10 @@ leap15.4_show_highstate: script: bin/test_show_highstate.sh tags: - docker + artifacts: + #when: on_failure + paths: + - '*.txt' upstream_formulas_show_highstate: stage: validate diff --git a/bin/test_show_highstate.sh b/bin/test_show_highstate.sh index 7108de9..ed55209 100755 --- a/bin/test_show_highstate.sh +++ b/bin/test_show_highstate.sh @@ -28,18 +28,21 @@ write_grains() { } show_highstate() { + local outfile="$domain.txt" write_grains $country $city $virt_cluster $virtual $domain - $RUN_TEST > /dev/null + $RUN_TEST > "$outfile" 2>&1 _STATUS=$? # We ignore exit code 2 as it means that an empty file is produced # See https://github.com/saltstack/salt/issues/39172 if [[ $_STATUS -eq 0 ]] || [[ $_STATUS -eq 2 ]]; then echo_PASSED else - echo - # errors like conflicting IDs get displayed on stdout, not stderr, see https://github.com/saltstack/salt/issues/52653 - echo "== running test again without /dev/null'ing stdout ==" - $RUN_TEST + cat /etc/salt/grains >> "$outfile" + salt-call --local grains.get id >> "$outfile" + salt-call --local grains.get domain >> "$outfile" + salt-call --local grains.get virtual >> "$outfile" + echo 'Dumping the last 100 log lines - the full output can be found in the CI artifacts' + tail -n100 "$outfile" echo_FAILED STATUS=1 fi