diff --git a/tests/roles/ibus-desktop-testing-role/files/check-results.sh b/tests/roles/ibus-desktop-testing-role/files/check-results.sh index 1160dac..8a46118 100755 --- a/tests/roles/ibus-desktop-testing-role/files/check-results.sh +++ b/tests/roles/ibus-desktop-testing-role/files/check-results.sh @@ -1,11 +1,13 @@ #!/bin/bash TEST_LOG="test.log" -TEST_RUN_IN_RAWHIDE="1" +TEST_RUN_IN_RAWHIDE=1 + +declare -i TEST_RUN_IN_RAWHIDE if [ $# -gt 0 ] ; then TEST_LOG="$1" - TEST_RUN_IN_RAWHIDE="$2" + TEST_RUN_IN_RAWHIDE=$2 fi gen_results() @@ -15,7 +17,6 @@ gen_results() TEST_STATUS_UPPER="$(echo "$TEST_STATUS" | tr '[:lower:]' '[:upper:]')" cat > results.xml << _EOF results: - - test: results result: $TEST_STATUS runtime: $TEST_RUNTIME @@ -39,12 +40,13 @@ if [ $TEST_RUN_IN_RAWHIDE -eq 0 ] ; then IS_RAWHIDE="$(grep -i rawhide /etc/fedora-release)" if [ x"$IS_RAWHIDE" != x ] ; then gen_results "0" "pass" + echo -n PASS exit 0 fi fi if [ ! -f $TEST_LOG ] ; then gen_results "0" "fail" - echo ERROR + echo -n ERROR else FAIL="$(grep "^FAIL: " $TEST_LOG | grep -v 'FAIL: 0$')" RUNTIME_FAIL="$(grep -v 'frame' $TEST_LOG | grep "^FAIL: " | sed -e "s/FAIL: //")" @@ -58,9 +60,10 @@ else RUNTIME="$(expr $RUNTIME_FAIL + $RUNTIME_PASS)" if [ x"$FAIL" != x ] ; then gen_results "$RUNTIME" "fail" - echo ERROR + echo -n ERROR else gen_results "$RUNTIME" "pass" + echo -n PASS fi fi diff --git a/tests/roles/ibus-desktop-testing-role/tasks/main.yml b/tests/roles/ibus-desktop-testing-role/tasks/main.yml index 012d1bf..753384d 100644 --- a/tests/roles/ibus-desktop-testing-role/tasks/main.yml +++ b/tests/roles/ibus-desktop-testing-role/tasks/main.yml @@ -208,7 +208,7 @@ - name: Check the results script: check-results.sh "{{ remote_artifacts }}/test.log" "0" register: test_fails - failed_when: False + failed_when: '"ERROR" in test_fails.stdout' - name: Set role result set_fact: