From ecf65b612e92dea244bb0cdf43486e8e1adcf08d Mon Sep 17 00:00:00 2001 From: Denis Rouzaud Date: Thu, 11 Jul 2024 09:55:53 +0200 Subject: [PATCH 1/4] [ci]fix deprecated set-output from Python --- .ci/ctest2ci.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.ci/ctest2ci.py b/.ci/ctest2ci.py index f0722f7216c7..53c8a462ea89 100755 --- a/.ci/ctest2ci.py +++ b/.ci/ctest2ci.py @@ -27,6 +27,7 @@ # - Colors for failing unit tests and test cases # - Group control sequences to hide uninteresting output by default +import os import sys import re import subprocess @@ -36,6 +37,9 @@ fold_stack = list() printable = set(string.printable) +def set_output(name, value): + with open(os.environ['GITHUB_OUTPUT'], 'a') as fh: + print(f'{name}={value}', file=fh) def start_fold(tag): sys.stdout.write('::group::{}\n'.format(tag)) @@ -111,7 +115,7 @@ def start_test_fold(): if not in_failing_test and re.search('[0-9]+% tests passed, [0-9]+ tests failed out of', updated_line): tests_failing = re.match(r'.* ([0-9]+) tests failed', updated_line).group(1) - updated_line += '\n::set-output name=TESTS_FAILING::{}'.format(tests_failing) + set_output(TESTS_FAILING, tests_failing) end_fold() if re.search('100% tests passed', updated_line): @@ -121,7 +125,7 @@ def start_test_fold(): start_fold('submit') elif re.search('Test results submitted to', updated_line): cdash_url = re.match(r'.*(http.*)$', updated_line).group(1) - updated_line += '\n::set-output name=CDASH_URL::{}'.format(cdash_url) + set_output(CDASH_URL, cdash_url) end_fold() sys.stdout.write(updated_line) From bd422d677616456b516d9d4eab0b51e03690018b Mon Sep 17 00:00:00 2001 From: Denis Rouzaud Date: Thu, 11 Jul 2024 09:57:48 +0200 Subject: [PATCH 2/4] MAKE IT FAIL --- tests/src/core/testqgscurve.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/src/core/testqgscurve.cpp b/tests/src/core/testqgscurve.cpp index 07c0f492127d..c56abdaacce0 100644 --- a/tests/src/core/testqgscurve.cpp +++ b/tests/src/core/testqgscurve.cpp @@ -90,7 +90,7 @@ void TestQgsCurve::curveToLine() /* op: Maximum of 10 units of difference, symmetric */ TEST_C2L( circularString, 10, QgsAbstractGeometry::MaximumDifference, - "LineString (0 0, 29.29 70.71, 100 100, 170.71 70.71, 200 0)", 2 ); + "LineString (1 0, 29.29 70.71, 100 100, 170.71 70.71, 200 0)", 2 ); /* op: Maximum of 300 units (higher than sagitta) of difference, symmetric */ /* See https://github.com/qgis/QGIS/issues/31832 */ From 1758ad6140b159b8175ae96a753ac6b8dddfe745 Mon Sep 17 00:00:00 2001 From: Denis Rouzaud Date: Thu, 11 Jul 2024 10:00:31 +0200 Subject: [PATCH 3/4] Update ctest2ci.py --- .ci/ctest2ci.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.ci/ctest2ci.py b/.ci/ctest2ci.py index 53c8a462ea89..53fc91ef31b5 100755 --- a/.ci/ctest2ci.py +++ b/.ci/ctest2ci.py @@ -115,7 +115,7 @@ def start_test_fold(): if not in_failing_test and re.search('[0-9]+% tests passed, [0-9]+ tests failed out of', updated_line): tests_failing = re.match(r'.* ([0-9]+) tests failed', updated_line).group(1) - set_output(TESTS_FAILING, tests_failing) + set_output('TESTS_FAILING', tests_failing) end_fold() if re.search('100% tests passed', updated_line): @@ -125,7 +125,7 @@ def start_test_fold(): start_fold('submit') elif re.search('Test results submitted to', updated_line): cdash_url = re.match(r'.*(http.*)$', updated_line).group(1) - set_output(CDASH_URL, cdash_url) + set_output('CDASH_URL', cdash_url) end_fold() sys.stdout.write(updated_line) From be4653b9e9a3ba01fccad0e853d7902283f78e98 Mon Sep 17 00:00:00 2001 From: Denis Rouzaud Date: Thu, 11 Jul 2024 10:02:54 +0200 Subject: [PATCH 4/4] Update ctest2ci.py --- .ci/ctest2ci.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.ci/ctest2ci.py b/.ci/ctest2ci.py index 53fc91ef31b5..c1bc6fccdb21 100755 --- a/.ci/ctest2ci.py +++ b/.ci/ctest2ci.py @@ -37,10 +37,12 @@ fold_stack = list() printable = set(string.printable) + def set_output(name, value): with open(os.environ['GITHUB_OUTPUT'], 'a') as fh: print(f'{name}={value}', file=fh) + def start_fold(tag): sys.stdout.write('::group::{}\n'.format(tag)) fold_stack.append(tag)