forked from containers/toolbox
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test/system: Connect system tests to Meson
A bit of plumbing in the build files has been done to accommodate the change as much as possible. If we're to use meson.build in the 'test/system' subdir we better also install the data from there. This also adjust the CI playbooks to launch the tests via Meson by specifying the specific test suite ('system'). containers#1062
- Loading branch information
1 parent
96bc4d4
commit e4d823f
Showing
6 changed files
with
101 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
subdir('system') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
system_tests_libs_dir = system_tests_dir / 'libs' | ||
|
||
system_tests_libs_files = files( | ||
'helpers.bash' | ||
) | ||
|
||
install_data( | ||
install_dir: system_tests_libs_dir, | ||
sources: system_tests_libs_files | ||
) | ||
|
||
install_subdir( | ||
'bats-support', | ||
install_dir: system_tests_libs_dir, | ||
exclude_files: [ | ||
'.git', | ||
'.gitignore', | ||
'.travis.yml', | ||
'package.json' | ||
], | ||
exclude_directories: [ | ||
'.git', | ||
'script', | ||
'test' | ||
] | ||
) | ||
|
||
install_subdir( | ||
'bats-assert', | ||
install_dir: system_tests_libs_dir, | ||
exclude_files: [ | ||
'.git', | ||
'.gitignore', | ||
'.travis.yml', | ||
'package.json' | ||
], | ||
exclude_directories: [ | ||
'.git', | ||
'script', | ||
'test' | ||
] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
system_tests_dir = get_option('datadir') / meson.project_name() / 'test' | ||
|
||
awk = find_program('awk', required: false) | ||
bats = find_program('bats', required: false) | ||
htpasswd = find_program('htpasswd', required: false) | ||
openssl = find_program('openssl', required: false) | ||
podman = find_program('podman', required: false) | ||
skopeo = find_program('skopeo', required: false) | ||
|
||
system_tests_files = files( | ||
'000-setup.bats', | ||
'001-version.bats', | ||
'002-help.bats', | ||
'101-create.bats', | ||
'102-list.bats', | ||
'103-container.bats', | ||
'104-run.bats', | ||
'105-enter.bats', | ||
'106-rm.bats', | ||
'107-rmi.bats', | ||
'999-teardown.bats', | ||
'README.md' | ||
) | ||
|
||
if fs.exists('/run/.containerenv') | ||
warning('System tests can not be run in a container.') | ||
elif not awk.found() or not bats.found() or not htpasswd.found() or not openssl.found() or not podman.found() or not skopeo.found() | ||
warning('System tests require: awk, bats, htpasswd, openssl, podman and skopeo being installed.') | ||
else | ||
system_tests_env = environment() | ||
system_tests_env.set('TOOLBOX', toolbox.full_path()) | ||
|
||
test( | ||
'system tests', | ||
bats, | ||
args: [ | ||
'--formatter', 'tap', | ||
'--timing', | ||
'./'], | ||
depends: toolbox, | ||
env: system_tests_env, | ||
protocol: 'tap', | ||
suite: 'system', | ||
timeout: 900, | ||
workdir: meson.current_source_dir() | ||
) | ||
endif | ||
|
||
install_data( | ||
install_dir: system_tests_dir, | ||
sources: system_tests_files | ||
) | ||
|
||
subdir('libs') |