-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
consolidate tests to be runable from build path (#42)
* generate data sets required for unit and integration tests when building the project * this requires significant refactoring to make the tests and data sets location agnostic * add the unit and cli tests to meson: `meson test cli` now "just works" * tests are now only built if configured: `meson setup -Dtests=enabled`
- Loading branch information
Showing
17 changed files
with
255 additions
and
168 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,27 +22,43 @@ jobs: | |
- name: Update apt repositories for ccache | ||
run: sudo apt update | ||
- name: Install dependencies | ||
run: sudo apt-get install util-linux libmount-dev slurm-wlm libslurm-dev slurmd slurmctld slurm-client | ||
- name: Set up ccache | ||
uses: hendrikmuhs/[email protected] | ||
with: | ||
key: ccache-linux-${{ matrix.buildtype }}-${{ matrix.sanitizer }} | ||
- name: Setup compiler and build tools | ||
run: sudo apt install --no-install-recommends --yes g++-12 meson ninja-build | ||
run: sudo apt-get install util-linux libmount-dev libslurm-dev | ||
# run: sudo apt-get install util-linux libmount-dev slurm-wlm libslurm-dev slurmd slurmctld slurm-client | ||
# disable for now, because the cache has never actually worked | ||
# ironically, this means that it slows down the build | ||
#- name: Set up ccache | ||
# uses: hendrikmuhs/[email protected] | ||
# with: | ||
# key: ccache-linux-${{ matrix.buildtype }}-${{ matrix.sanitizer }} | ||
- name: Install compiler and build tools | ||
run: sudo apt install --no-install-recommends --yes g++-12 ninja-build | ||
- name: install meson | ||
run: | | ||
wget https://github.com/mesonbuild/meson/releases/download/1.6.1/meson-1.6.1.tar.gz && \ | ||
tar -xzf meson-1.6.1.tar.gz && \ | ||
mv meson-1.6.1 meson && \ | ||
mv meson/meson.py meson/meson | ||
- name: install squashfs-mount | ||
run: | | ||
wget https://github.com/eth-cscs/squashfs-mount/archive/refs/tags/v1.1.0.tar.gz | ||
tar -xzf v1.1.0.tar.gz | ||
./meson/meson setup build-sqfs squashfs-mount-1.1.0 | ||
./meson/meson compile -C build-sqfs | ||
sudo ./meson/meson install -C build-sqfs | ||
- name: Configure | ||
run: | | ||
CXX="ccache g++-12" meson setup \ | ||
CC="gcc-12" CXX="g++-12" ./meson/meson setup \ | ||
--buildtype ${{ matrix.buildtype }} \ | ||
-Db_sanitize=${{ matrix.sanitizer }} \ | ||
-Dtests=enabled \ | ||
--warnlevel 3 \ | ||
--werror \ | ||
build . | ||
- name: Build | ||
run: ninja -C build | ||
- name: Setup Test | ||
run: cd test/setup && ./setup | ||
- name: Test | ||
run: ./meson/meson compile -Cbuild | ||
- name: test unit | ||
run: ./meson/meson test -Cbuild --verbose unit | ||
- name: test cli | ||
run: | | ||
export ASAN_OPTIONS=fast_unwind_on_malloc=0:strict_string_checks=1:detect_leaks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1 | ||
export UBSAN_OPTIONS=print_stacktrace=1 | ||
cd build && ./unit | ||
sudo mkdir /user-tools /user-environment | ||
./meson/meson test -Cbuild --verbose cli |
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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
option('tests', type: 'feature', value: 'disabled') | ||
|
||
option('slurm_plugin', type: 'boolean', value: true) | ||
option('cli', type: 'boolean', value: true) | ||
|
||
option('oras_version', type: 'string', value: '1.2.0') |
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 |
---|---|---|
@@ -1,28 +1,24 @@ | ||
version_path = meson.current_build_dir()+'config.h' | ||
fs = import('fs') | ||
if not fs.is_file(version_path) | ||
uenv_version = meson.project_version() | ||
uenv_version_array = uenv_version.split('-') | ||
if uenv_version_array.length()==2 | ||
uenv_version_prerelease = uenv_version_array[1] | ||
else | ||
uenv_version_prerelease = '' | ||
endif | ||
uenv_version_array = uenv_version_array[0].split('.') | ||
uenv_version_major = uenv_version_array[0].to_int() | ||
uenv_version_minor = uenv_version_array[1].to_int() | ||
uenv_version_patch = uenv_version_array[2].to_int() | ||
uenv_version = meson.project_version() | ||
uenv_version_array = uenv_version.split('-') | ||
if uenv_version_array.length()==2 | ||
uenv_version_prerelease = uenv_version_array[1] | ||
else | ||
uenv_version_prerelease = '' | ||
endif | ||
uenv_version_array = uenv_version_array[0].split('.') | ||
uenv_version_major = uenv_version_array[0].to_int() | ||
uenv_version_minor = uenv_version_array[1].to_int() | ||
uenv_version_patch = uenv_version_array[2].to_int() | ||
|
||
conf = configuration_data() | ||
conf = configuration_data() | ||
|
||
conf.set('version', uenv_version) | ||
conf.set('version_major', uenv_version_major) | ||
conf.set('version_minor', uenv_version_minor) | ||
conf.set('version_patch', uenv_version_patch) | ||
conf.set('version_prerelease', uenv_version_prerelease) | ||
conf.set('version', uenv_version) | ||
conf.set('version_major', uenv_version_major) | ||
conf.set('version_minor', uenv_version_minor) | ||
conf.set('version_patch', uenv_version_patch) | ||
conf.set('version_prerelease', uenv_version_prerelease) | ||
|
||
configure_file(input : 'config.h.in', | ||
output : 'config.h', | ||
configuration : conf) | ||
endif | ||
configure_file(input : 'config.h.in', | ||
output : 'config.h', | ||
configuration : conf) | ||
|
Oops, something went wrong.