Skip to content

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

chore: files changed scripts/__tests__/self-hosted-lanes.test.mjs,scripts/ci/rust-coverage.sh,script

Steven Enamakel70a62cadd09d
diff --git a/scripts/__tests__/self-hosted-lanes.test.mjs b/scripts/__tests__/self-hosted-lanes.test.mjs
index 47dc7c2542..25ecf349ea 100644
--- a/scripts/__tests__/self-hosted-lanes.test.mjs
+++ b/scripts/__tests__/self-hosted-lanes.test.mjs
@@ -79,6 +79,24 @@ test("commands are static: no suite is ever narrowed to the diff", () => {
}
});
+test("the doctests run exactly once per profile", () => {
+ for (const plan of plans()) {
+ const cov = plan.lanes
+ .find((l) => l.name === "rust-cov")
+ .checks.find((c) => c.name === "rust-core-coverage");
+ const separate = allRuns(plan).filter((r) =>
+ /cargo test -p openhuman --doc --features/.test(r),
+ );
+ if (plan.profile === "ex63") {
+ assert.equal(cov.env.OH_COV_DOCTESTS, "0");
+ assert.equal(separate.length, 1);
+ } else {
+ assert.equal(cov.env.OH_COV_DOCTESTS, undefined);
+ assert.equal(separate.length, 0);
+ }
+ }
+});
+
test("the complete suites run, not subsets", () => {
const runs = allRuns(plans()[0]).join("\n");
assert.match(runs, /pnpm --filter openhuman-app test:coverage(?! \S*\.test)/);
diff --git a/scripts/ci/rust-coverage.sh b/scripts/ci/rust-coverage.sh
index 1b25a31c4a..ad842959fd 100755
--- a/scripts/ci/rust-coverage.sh
+++ b/scripts/ci/rust-coverage.sh
@@ -159,8 +159,14 @@ done < <(integration_test_targets)
# Doctests are not collected by cargo-llvm-cov, but they are still part of the
# complete Rust test suite and must run whenever the Rust-core area changes.
-suite "openhuman doctests" bash scripts/ci-cancel-aware.sh cargo test -p openhuman \
- --doc --features "${PRODUCT_FEATURES}"
+# They compile their own uninstrumented core, so a caller that runs them in a
+# parallel lane instead (CI Fast on the EX63) sets OH_COV_DOCTESTS=0.
+if [ "${OH_COV_DOCTESTS:-1}" = "1" ]; then
+ suite "openhuman doctests" bash scripts/ci-cancel-aware.sh cargo test -p openhuman \
+ --doc --features "${PRODUCT_FEATURES}"
+else
+ log "skipping doctests (OH_COV_DOCTESTS=${OH_COV_DOCTESTS}); the caller runs them"
+fi
log "merging coverage into ${OUT}"
suite "lcov report" llvm_cov report --lcov --output-path "${OUT}"
diff --git a/scripts/ci/self-hosted/lanes-plan.mjs b/scripts/ci/self-hosted/lanes-plan.mjs
index af66509095..f3c779ffe4 100644
--- a/scripts/ci/self-hosted/lanes-plan.mjs
+++ b/scripts/ci/self-hosted/lanes-plan.mjs
@@ -118,6 +118,12 @@ export function buildPlan({ profile, areas, env = {}, isPullRequest = true }) {
// Non-instrumented, but needs the downloaded modules. On ex63 it rides the
// lint lane's graph instead of lengthening the coverage critical path; on
// hosted it stays in the coverage job beside the modules, as in ci-lite.
+ // The core doctests, as rust-coverage.sh runs them (OH_COV_DOCTESTS).
+ const doctests = {
+ name: "doctests",
+ when: core,
+ run: `bash scripts/ci-cancel-aware.sh cargo test -p openhuman --doc --features ${PRODUCT}`,
+ };
const juiceRegression = {
name: "tinyjuice-host-regression",
when: core,
@@ -283,7 +289,12 @@ export function buildPlan({ profile, areas, env = {}, isPullRequest = true }) {
name: "rust-core-coverage",
when: core,
needs: ["test-modules"],
- env: { OUT: "ci-out/lcov/lcov-core.info" },
+ // ex63: the doctests (an uninstrumented core build of their own)
+ // run in rust-lint instead, off this lane's critical path.
+ env: {
+ OUT: "ci-out/lcov/lcov-core.info",
+ ...(ex63 ? { OH_COV_DOCTESTS: "0" } : {}),
+ },
run: withModules("bash scripts/ci/rust-coverage.sh"),
},
...(ex63 ? [] : [juiceRegression]),
@@ -338,7 +349,7 @@ export function buildPlan({ profile, areas, env = {}, isPullRequest = true }) {
when: core,
run: "bash scripts/check-prompt-budget.sh --verbose",
},
- ...(ex63 ? [juiceRegression] : []),
+ ...(ex63 ? [juiceRegression, doctests] : []),
],
},
{