Files
lix/tests/functional2/meson.build
T
Alois Wohlschlager 42691f0d94 functional2: fix in the development shell
The functional2 test suite was broken in the development shell for two mostly
separate reasons leading to "no such file or directory" errors:

* The `BUILD_TEST_SHELL` (already containing the correct path) would always be
  set from the Meson option `build_test_shell`, even to the empty string if
  that option is not set. Skip the overwrite in this case to make the
  environment variable work again.
* Sandboxed builds would fail to find their builder `/bin/sh`, since in the
  development shell busybox is not found, so no sandbox shell gets configured.
  Use the shell from `BUILD_TEST_SHELL` instead. (How this does not break the
  old functional tests remains a mystery.)

Change-Id: I6a6a696424e8caaef3f9b68e3738bfd58ea0b056
2025-10-07 20:14:48 +00:00

46 lines
1.7 KiB
Meson

xdist_opts = [
# auto number of workers, max 12 jobs
'-n', 'auto', '--maxprocesses=12',
# Distributes tests evenly at first and then, if workers run out of tests, they steal from a different worker
# This is useful here, due to differing durations of tests, especially when tests check timeout functionality
#
# grouping by module/file is disadventageous here too, as all lang tests are executed from the same module
# which would result in high run times for that single worker while everything else is bored
'--dist=worksteal',
]
# surprisingly, this actually works even if PATH is set to something before
# meson gets hold of it. neat!
functional2_env = environment()
# set the bin dir for us to know where to find the lix binaries for our declarative path
# without leaking all of PATH or env
functional2_env.set('NIX_BIN_DIR', bindir)
if build_test_shell != ''
functional2_env.set('BUILD_TEST_SHELL', build_test_shell)
endif
functional2_env.set('system', host_system)
test(
'functional2',
python,
args : [
'-m', 'pytest',
'-v',
# Print out summaries of **f**ailed, **E**rrored and **s**kipped tests
'-r', 'fEs',
xdist_opts,
meson.current_source_dir()
],
env : functional2_env,
# FIXME: Although we can trivially use TAP here with pytest-tap, due to a meson bug, it is unusable.
# (failure output does not get displayed to the console. at all. someone should go fix it):
# https://github.com/mesonbuild/meson/issues/11185
# protocol : 'tap',
suite : 'installcheck',
timeout : 300,
# Do not cut output of this runner on failure!
# As TAP is currently not supported (see above), we do need all lines to actually know
# why and how the failing tests actually failed
verbose: true,
)