Skip to content

Commit 06e7d2e

Browse files
xclaesseeli-schwartz
authored andcommitted
ci: Add test_options and skip_tests config
1 parent f8b942f commit 06e7d2e

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ meson compile -C builddir
6262
Use this only when there is no other way to fix the warning.
6363
- `skip_dependency_check`: (Optional) List of platform specific dependency
6464
names that are not always provided by the project.
65+
- `test_options`: (Optional) List of arguments that will be passed to
66+
`meson test` command (e.g. `--timeout-multiplier`, `--no-suite`).
67+
- `skip_tests`: (Optional) If set to `true` tests will not be run. This is
68+
useful when tests are known to fail because of upstream issues, or requires
69+
specific environment hard to setup.
6570

6671
- Test locally by running `tools/sanity_checks.py` script. It will be executed
6772
on the CI and must always return success before merging any PR.

tools/sanity_checks.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -385,14 +385,16 @@ def check_new_release(self, name: str, builddir: str = '_build', deps=None, prog
385385
return
386386
raise Exception(f'Wrap {name} failed to configure due to bugs in the wrap, rather than due to being unsupported')
387387
subprocess.check_call(['meson', 'compile', '-C', builddir], env=meson_env)
388-
try:
389-
subprocess.check_call(['meson', 'test', '-C', builddir, '--suite', name, '--print-errorlogs'])
390-
except subprocess.CalledProcessError:
391-
log_file = Path(builddir, 'meson-logs', 'testlog.txt')
392-
print('::group::==== testlog.txt ====')
393-
print(log_file.read_text(encoding='utf-8'))
394-
print('::endgroup::')
395-
raise
388+
if not ci.get('skip_tests', False):
389+
test_options = ci.get('test_options', [])
390+
try:
391+
subprocess.check_call(['meson', 'test', '-C', builddir, '--suite', name, '--print-errorlogs'] + test_options)
392+
except subprocess.CalledProcessError:
393+
log_file = Path(builddir, 'meson-logs', 'testlog.txt')
394+
print('::group::==== testlog.txt ====')
395+
print(log_file.read_text(encoding='utf-8'))
396+
print('::endgroup::')
397+
raise
396398
subprocess.check_call(['meson', 'install', '-C', builddir, '--destdir', 'pkg'])
397399

398400
def is_permitted_file(self, subproject: str, filename: str):

0 commit comments

Comments
 (0)