Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(ci): propagate llvm-cov env failures in coverage inventory

Steven Enamakeleac4bb51dd55
diff --git a/scripts/__tests__/rust-coverage-status.test.mjs b/scripts/__tests__/rust-coverage-status.test.mjs
index fb6fa299b7..66decd5eff 100644
--- a/scripts/__tests__/rust-coverage-status.test.mjs
+++ b/scripts/__tests__/rust-coverage-status.test.mjs
@@ -241,6 +241,7 @@ function runMockedCoverage(exitCode) {
write("scripts/ci-cancel-aware.sh", '#!/bin/bash\nexec "$@"\n');
write("scripts/ci/assert-coverage-presence.sh", "#!/bin/bash\nexit 0\n");
write("crates/openhuman-cli/Cargo.toml", "");
+ write("tests/active.rs", "#[test] fn active() {}\n");
write("bin/rustup", "#!/bin/bash\nexit 1\n");
write(
"bin/cargo",
@@ -250,11 +251,14 @@ case "$*" in *"-p openhuman --lib --bins"*) [ "${exitCode}" = 0 ] || exit "${exi
node - "$@" <<'JS'
const fs = require('node:fs');
const args = process.argv.slice(2);
+if (args[0] === 'nextest' && args[1] === 'list') {
+ console.log(JSON.stringify({ 'rust-suites': { active: { 'binary-name': 'active', testcases: { active: { ignored: false, 'filter-match': { status: 'matches' } } } } } }));
+}
const pos = args.indexOf('--config-file');
if (pos >= 0) {
const config = fs.readFileSync(args[pos + 1], 'utf8');
const report = JSON.parse(config.split('\\n').find(line => line.startsWith('path = ')).slice(7));
- fs.writeFileSync(report, '<testsuites><testsuite name="mock" tests="1"></testsuite></testsuites>');
+ fs.writeFileSync(report, '<testsuites><testsuite name="openhuman-cli::active" tests="1"></testsuite></testsuites>');
}
JS
`,
diff --git a/scripts/ci/rust-coverage.sh b/scripts/ci/rust-coverage.sh
index 46225c4b96..7d03936b54 100755
--- a/scripts/ci/rust-coverage.sh
+++ b/scripts/ci/rust-coverage.sh
@@ -271,7 +271,8 @@ if [ "${OH_COV_RUNNER:-cargo}" = "nextest" ]; then
# Listing executes no tests. cargo-llvm-cov supplies the same wrapper and
# instrumentation environment, so Cargo can reuse this CLI test build.
cli_inventory() (
- eval "$(cargo llvm-cov show-env --sh --features "${CORE_PRODUCT_FEATURES}")"
+ inventory_env="$(cargo llvm-cov show-env --sh --features "${CORE_PRODUCT_FEATURES}")" || exit $?
+ eval "${inventory_env}"
cargo nextest list --message-format json --features "${CORE_PRODUCT_FEATURES}" \
-p openhuman-cli --tests -E 'kind(test)' >"${expected_inventory}"
)