Skip to content

Commit

Permalink
Merge pull request #961 from AntelopeIO/revert_ctest_test-dir
Browse files Browse the repository at this point in the history
revert `ctest --test-dir` usage that is cmake 3.20+
  • Loading branch information
spoonincode authored Apr 5, 2023
2 parents d7eb6d7 + 92ee004 commit 160b427
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/actions/parallel-ctest-containers/dist/index.mjs

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions .github/actions/parallel-ctest-containers/main.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ try {
if(child_process.spawnSync("docker", ["rm", "base"], {stdio:"inherit"}).status)
throw new Error("Failed to remove base container");

const test_query_result = child_process.spawnSync("docker", ["run", "--rm", "baseimage", "bash", "-e", "-o", "pipefail", "-c", `ctest --test-dir build -L '${tests_label}' --show-only=json-v1`]);
const test_query_result = child_process.spawnSync("docker", ["run", "--rm", "baseimage", "bash", "-e", "-o", "pipefail", "-c", `cd build; ctest -L '${tests_label}' --show-only=json-v1`]);
if(test_query_result.status)
throw new Error("Failed to discover tests with label")
const tests = JSON.parse(test_query_result.stdout).tests;

let subprocesses = [];
tests.forEach(t => {
subprocesses.push(new Promise(resolve => {
child_process.spawn("docker", ["run", "--security-opt", "seccomp=unconfined", "-e", "GITHUB_ACTIONS=True", "--name", t.name, "--init", "baseimage", "bash", "-c", `ctest --test-dir build --output-on-failure -R '^${t}$' --timeout ${test_timeout}`], {stdio:"inherit"}).on('close', code => resolve(code));
child_process.spawn("docker", ["run", "--security-opt", "seccomp=unconfined", "-e", "GITHUB_ACTIONS=True", "--name", t.name, "--init", "baseimage", "bash", "-c", `cd build; ctest --output-on-failure -R '^${t.name}$' --timeout ${test_timeout}`], {stdio:"inherit"}).on('close', code => resolve(code));
}));
});

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ jobs:
export TMPDIR="$PWD/tmp"
mkdir -p $TMPDIR
zstdcat build.tar.zst | tar x
ctest --test-dir build --output-on-failure -j $(nproc) -LE "(nonparallelizable_tests|long_running_tests)" --timeout 420
cd build
ctest --output-on-failure -j $(nproc) -LE "(nonparallelizable_tests|long_running_tests)" --timeout 420
np-tests:
name: NP Tests
Expand Down

0 comments on commit 160b427

Please sign in to comment.