From 02712bbfd1c285122fdc972c2b502b7b7794ca11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-No=C3=ABl=20Grad?= Date: Wed, 24 May 2023 14:05:19 +0200 Subject: [PATCH 1/2] CI: Use GitLab canonical URLs The CI pipeline page requires a dash separator since GitLab 16.0. --- maintainer/gh_create_issue.sh | 2 +- maintainer/gh_post_status.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/maintainer/gh_create_issue.sh b/maintainer/gh_create_issue.sh index 2fa1b1711c9..0f1721df12d 100755 --- a/maintainer/gh_create_issue.sh +++ b/maintainer/gh_create_issue.sh @@ -18,7 +18,7 @@ # along with this program. If not, see . # -URL="https://gitlab.icp.uni-stuttgart.de/espressomd/espresso/pipelines/${CI_PIPELINE_ID}" +URL="https://gitlab.icp.uni-stuttgart.de/espressomd/espresso/-/pipelines/${CI_PIPELINE_ID}" curl -s "https://api.github.com/repos/espressomd/espresso/issues" \ -H "Accept: application/vnd.github.full+json" \ diff --git a/maintainer/gh_post_status.sh b/maintainer/gh_post_status.sh index 40259b79e03..395136ef80f 100755 --- a/maintainer/gh_post_status.sh +++ b/maintainer/gh_post_status.sh @@ -21,7 +21,7 @@ [ "${#}" -eq 1 ] || exit 1 GIT_COMMIT=$(git rev-parse HEAD) -URL="https://gitlab.icp.uni-stuttgart.de/espressomd/espresso/pipelines/${CI_PIPELINE_ID}" +URL="https://gitlab.icp.uni-stuttgart.de/espressomd/espresso/-/pipelines/${CI_PIPELINE_ID}" STATUS="${1}" curl "https://api.github.com/repos/espressomd/espresso/statuses/${GIT_COMMIT}" \ -H "Authorization: token ${GITHUB_TOKEN}" \ From 0d909b450bf800bea83f03192d747dacb307df85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-No=C3=ABl=20Grad?= Date: Wed, 24 May 2023 14:09:53 +0200 Subject: [PATCH 2/2] tests: Provide a meaningful error message When the sigint subprocess raises a Python exception (e.g. due to missing features), the process remains open indefinitely, which causes the unit test to time out and the Python interpreter to terminate while the subprocess pipe is still open. --- testsuite/python/sigint.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/testsuite/python/sigint.py b/testsuite/python/sigint.py index 738d8e9a2f5..933fcd0ec9c 100644 --- a/testsuite/python/sigint.py +++ b/testsuite/python/sigint.py @@ -25,6 +25,12 @@ import os +EXPECTED_TRACEBACK_ENDING = """ in handle_sigint + signal.raise_signal(signal.Signals.SIGINT) +KeyboardInterrupt +""" + + class SigintTest(ut.TestCase): script = str(pathlib.Path(__file__).parent / 'sigint_child.py') @@ -43,8 +49,8 @@ def check_signal_handling(self, process, sig): self.assertEqual(traceback, "") elif sig == signal.Signals.SIGINT: self.assertIn(" self.integrator.run(", traceback) - self.assertTrue(traceback.endswith( - " in handle_sigint\n signal.raise_signal(signal.Signals.SIGINT)\nKeyboardInterrupt\n")) + self.assertTrue(traceback.endswith(EXPECTED_TRACEBACK_ENDING), + msg=f"Traceback failed string match:\n{traceback}") def test_signal_handling(self): signals = [signal.Signals.SIGINT, signal.Signals.SIGTERM]