diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2023-04-04 15:05:07 -0400 |
---|---|---|
committer | Eli Schwartz <eschwartz@archlinux.org> | 2023-04-04 15:06:17 -0400 |
commit | 5fe7ecb861325dd8e88eedde4769269c6a10ccf0 (patch) | |
tree | c9373e16620a78e8bb209cb961f33222136688fb | |
parent | 3c655bca39384c3be49204491d9a8e138484d719 (diff) | |
download | meson-5fe7ecb861325dd8e88eedde4769269c6a10ccf0.zip meson-5fe7ecb861325dd8e88eedde4769269c6a10ccf0.tar.gz meson-5fe7ecb861325dd8e88eedde4769269c6a10ccf0.tar.bz2 |
tests: make it easier to read overall results in github
Use collapsible sections for cicmds.
-rwxr-xr-x | run_project_tests.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/run_project_tests.py b/run_project_tests.py index fd800e6..fc9e6f9 100755 --- a/run_project_tests.py +++ b/run_project_tests.py @@ -289,6 +289,7 @@ class TestDef: failing_logs: T.List[str] = [] print_debug = 'MESON_PRINT_TEST_OUTPUT' in os.environ under_ci = 'CI' in os.environ +ci_is_github = 'GITHUB_ACTIONS' in os.environ raw_ci_jobname = os.environ.get('MESON_CI_JOBNAME', None) ci_jobname = raw_ci_jobname if raw_ci_jobname != 'thirdparty' else None do_debug = under_ci or print_debug @@ -420,11 +421,16 @@ def log_text_file(logfile: T.TextIO, testdir: Path, result: TestResult) -> None: def _run_ci_include(args: T.List[str]) -> str: + header = f'Included file {args[0]}:' + footer = '' + if ci_is_github: + header = f'::group::==== {header} ====' + footer = '::endgroup::' if not args: return 'At least one parameter required' try: data = Path(args[0]).read_text(errors='ignore', encoding='utf-8') - return 'Included file {}:\n{}\n'.format(args[0], data) + return f'{header}\n{data}\n{footer}' except Exception: return 'Failed to open {}'.format(args[0]) |