Skip to content

Commit

Permalink
group output for GH workflow (not Travis)
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids authored and nyalldawson committed Feb 8, 2021
1 parent 93b1c44 commit edc7192
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
12 changes: 5 additions & 7 deletions .ci/ctest2travis.py → .ci/ctest2ci.py
Expand Up @@ -3,7 +3,7 @@

"""
***************************************************************************
ctest2travis.py
ctest2ci.py
---------------------
Date : March 2017
Copyright : (C) 2017 by Matthias Kuhn
Expand All @@ -27,30 +27,28 @@
# This script parses output from ctest and injects
#
# - Colors for failing unit tests and test cases
#
# - `travis_fold` control sequences to hide uninteresting output by default
# - Group control sequences to hide uninteresting output by default

import sys
import re
import shlex
import subprocess
from termcolor import colored

fold_stack = list()


def start_fold(tag):
sys.stdout.write('travis_fold:start:{}\n'.format(tag))
sys.stdout.write('::group::{}\n'.format(tag))
fold_stack.append(tag)


def end_fold():
try:
tag = fold_stack.pop()
sys.stdout.write('travis_fold:end:{}\n'.format(tag))
sys.stdout.write('::endgroup::\n')
except IndexError:
updated_line = colored("======================", 'magenta')
updated_line += colored("ctest2travis error when processing the following line:", 'magenta')
updated_line += colored("ctest2ci error when processing the following line:", 'magenta')
updated_line += colored("----------------------", 'magenta')
updated_line += colored(updated_line, 'magenta')
updated_line += colored("----------------------", 'magenta')
Expand Down
6 changes: 3 additions & 3 deletions .docker/docker-qgis-test.sh
Expand Up @@ -10,7 +10,7 @@ set -e
##################################

if [ ${HANA_TESTS:-"false"} == "true" ] ; then
echo "travis_fold:start:hana"
echo "::group::hana"
echo "${bold}Load HANA database...${endbold}"

export QGIS_HANA_TEST_DB='driver='/usr/sap/hdbclient/libodbcHDB.so' host='${HANA_HOST}' port='${HANA_PORT}' user='${HANA_USER}' password='${HANA_PASSWORD}' sslEnabled=true sslValidateCertificate=False'
Expand All @@ -24,7 +24,7 @@ if [ ${HANA_TESTS:-"false"} == "true" ] ; then
done
echo "🌊 done"

echo "travis_fold:end:hana"
echo "::endgroup::"
fi

############################
Expand Down Expand Up @@ -124,5 +124,5 @@ else
echo "Flaky tests are run!"
fi
echo "List of skipped tests: $EXCLUDE_TESTS"
python3 /root/QGIS/.ci/ctest2travis.py xvfb-run ctest -V -E "${EXCLUDE_TESTS}" -S /root/QGIS/.ci/config.ctest --output-on-failure
python3 /root/QGIS/.ci/ctest2ci.py xvfb-run ctest -V -E "${EXCLUDE_TESTS}" -S /root/QGIS/.ci/config.ctest --output-on-failure

4 changes: 2 additions & 2 deletions .github/workflows/run-tests.yml
Expand Up @@ -147,11 +147,11 @@ jobs:
# Run tests in the docker
for i in "${!testrunners[@]}"
do
echo "travis_fold:start:docker_test_runner_${i}"
echo "::group::docker_test_runner_${i}"
echo "test ${i}..."
docker exec -it qgis-testing-environment sh -c "cd /tests_directory && /usr/bin/test_runner/qgis_testrunner.sh ${i}"
[[ $? -eq "${testrunners[$i]}" ]] && echo "success" || exit 1
echo "travis_fold:end:docker_test_runner_${i}"
echo "::endgroup::"
done
set -e # switch back
docker stop qgis-testing-environment
Expand Down

0 comments on commit edc7192

Please sign in to comment.