diff --git a/.github/workflows/oss-image.yml b/.github/workflows/oss-image.yml index e8541f82..3e867b6f 100644 --- a/.github/workflows/oss-image.yml +++ b/.github/workflows/oss-image.yml @@ -63,9 +63,11 @@ jobs: docker run --rm --memory=4g --cpus=2 --network=none \ --env NODE_ENV=test --env READER_MAX_WORKERS=2 \ --mount "type=bind,source=$GITHUB_WORKSPACE/tests,target=/app/tests,readonly" \ + --mount "type=bind,source=$GITHUB_WORKSPACE/fixtures,target=/app/fixtures,readonly" \ --tmpfs /app/tests-build:mode=1777 \ --entrypoint sh reader-candidate:"$GITHUB_SHA" \ - -c 'npm run test:futurity && npm test' + -c 'npm run test:futurity && npm test' 2>&1 | tee "$RUNNER_TEMP/reader-tests.log" + node futurity/assert-test-results.cjs "$RUNNER_TEMP/reader-tests.log" - name: Check container startup run: | docker run --rm --memory=2g --cpus=2 --network=none \ diff --git a/futurity/assert-test-results.cjs b/futurity/assert-test-results.cjs new file mode 100644 index 00000000..c39d5220 --- /dev/null +++ b/futurity/assert-test-results.cjs @@ -0,0 +1,16 @@ +const fs = require('node:fs'); + +const output = fs.readFileSync(process.argv[2], 'utf8').replace(/\x1b\[[0-9;]*m/g, ''); +const counts = (name) => [...output.matchAll(new RegExp(`^ℹ ${name} (\\d+)$`, 'gm'))] + .map((match) => Number(match[1])); +const tests = counts('tests'); +const passed = counts('pass'); +const failed = counts('fail'); +const cancelled = counts('cancelled'); +if ([tests, passed, failed, cancelled].some((values) => values.length !== 3) + || tests.some((count, index) => count === 0 || passed[index] !== count) + || failed.some(Boolean) || cancelled.some(Boolean)) { + console.error('Reader regression summaries are incomplete or contain failures.'); + process.exit(1); +} +console.log(`Verified ${passed.reduce((sum, count) => sum + count, 0)} passing regressions.`);