From: Daan De Meyer Date: Fri, 3 May 2024 08:57:50 +0000 (+0200) Subject: test: Use MESON_TEST_ITERATION if available X-Git-Tag: v256-rc2~97^2~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0596237e0e3cbe3c3312300f00ef49742dc24562;p=thirdparty%2Fsystemd.git test: Use MESON_TEST_ITERATION if available This allows running the same test multiple times concurrently with meson's --repeat option. Proposed upstream but not yet merged: https://github.com/mesonbuild/meson/pull/13177. --- diff --git a/test/integration-test-wrapper.py b/test/integration-test-wrapper.py index e3dcf75239f..99ae43ac831 100755 --- a/test/integration-test-wrapper.py +++ b/test/integration-test-wrapper.py @@ -51,6 +51,7 @@ def main(): parser.add_argument('mkosi_args', nargs="*") args = parser.parse_args() + name = args.test_name + (f"-{i}" if (i := os.getenv("MESON_TEST_ITERATION")) else "") test_unit = f"testsuite-{args.test_number}.service" dropin = textwrap.dedent( @@ -90,7 +91,7 @@ def main(): """ ) - journal_file = (args.meson_build_dir / (f"test/journal/{args.test_name}.journal")).absolute() + journal_file = (args.meson_build_dir / (f"test/journal/{name}.journal")).absolute() journal_file.unlink(missing_ok=True) else: journal_file = None @@ -100,7 +101,7 @@ def main(): '--directory', os.fspath(args.meson_source_dir), '--output-dir', os.fspath(args.meson_build_dir / 'mkosi.output'), '--extra-search-path', os.fspath(args.meson_build_dir), - '--machine', args.test_name, + '--machine', name, '--ephemeral', *(['--forward-journal', journal_file] if journal_file else []), *(