Skip to content
Permalink
Browse files

group output for GH workflow (not Travis)

  • Loading branch information
3nids authored and nyalldawson committed Feb 8, 2021
1 parent 93b1c44 commit edc719265df9df6bd9507235258e09af5a18328b
Showing with 10 additions and 12 deletions.
  1. +5 −7 .ci/{ctest2travis.py → ctest2ci.py}
  2. +3 −3 .docker/docker-qgis-test.sh
  3. +2 −2 .github/workflows/run-tests.yml
@@ -3,7 +3,7 @@

"""
***************************************************************************
ctest2travis.py
ctest2ci.py
---------------------
Date : March 2017
Copyright : (C) 2017 by Matthias Kuhn
@@ -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')
@@ -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'
@@ -24,7 +24,7 @@ if [ ${HANA_TESTS:-"false"} == "true" ] ; then
done
echo "🌊 done"

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

############################
@@ -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

@@ -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

0 comments on commit edc7192

Please sign in to comment.