Skip to content

Commit

Permalink
Merge pull request #173 from AntelopeIO/enable_more_platform_tests
Browse files Browse the repository at this point in the history
[3.2] enable all tests for Ubuntu 22; NP & LR tests for Ubuntu 18
  • Loading branch information
spoonincode authored Sep 16, 2022
2 parents 781aae4 + 85cab27 commit 5564e9c
Show file tree
Hide file tree
Showing 6 changed files with 376 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .github/actions/parallel-ctest-containers/action.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: 'Parallel ctest'
description: 'Runs a set of ctests in parallel via multiple docker containers'
description: 'Runs a set of labeled ctests in parallel via multiple docker containers'
inputs:
container:
required: true
error-log-paths:
required: true
log-tarball-prefix:
required: true
tests:
tests-label:
required: true
runs:
using: 'node16'
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/parallel-ctest-containers/dist/index.mjs

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions .github/actions/parallel-ctest-containers/main.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,22 @@ import core from '@actions/core'
const container = core.getInput('container', {required: true});
const error_log_paths = JSON.parse(core.getInput('error-log-paths', {required: true}));
const log_tarball_prefix = core.getInput('log-tarball-prefix', {required: true});
const tests = JSON.parse(core.getInput('tests', {required: true}));
const tests_label = core.getInput('tests-label', {required: true});

try {
if(child_process.spawnSync("docker", ["run", "--name", "base", "-v", `${process.cwd()}/build.tar.zst:/build.tar.zst`, "--workdir", "/__w/leap/leap", container, "tar", "--zstd", "-xf", "/build.tar.zst"], {stdio:"inherit"}).status)
if(child_process.spawnSync("docker", ["run", "--name", "base", "-v", `${process.cwd()}/build.tar.zst:/build.tar.zst`, "--workdir", "/__w/leap/leap", container, "sh", "-c", "zstdcat /build.tar.zst | tar x"], {stdio:"inherit"}).status)
throw new Error("Failed to create base container");
if(child_process.spawnSync("docker", ["commit", "base", "baseimage"], {stdio:"inherit"}).status)
throw new Error("Failed to create base image");
if(child_process.spawnSync("docker", ["rm", "base"], {stdio:"inherit"}).status)
throw new Error("Failed to remove base container");

// the correct approach is by far "--show-only=json-v1" and then pluck out .tests[].name; but that doesn't work on U18's cmake 3.10 since it lacks json-v1 output
const test_query_result = child_process.spawnSync("docker", ["run", "--rm", "baseimage", "bash", "-e", "-o", "pipefail", "-c", `cd build; ctest -L '${tests_label}' --show-only | head -n -1 | cut -d ':' -f 2 -s | jq -cnR '[inputs | select(length>0)[1:]]'`]);
if(test_query_result.status)
throw new Error("Failed to discover tests with label")
const tests = JSON.parse(test_query_result.stdout);

let subprocesses = [];
tests.forEach(t => {
subprocesses.push(new Promise(resolve => {
Expand Down
351 changes: 351 additions & 0 deletions .github/actions/parallel-ctest-containers/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 5564e9c

Please sign in to comment.