Skip to content

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

fix(scripts): count e2e coverage from all Rust tests under tests/

Steven Enamakel0be0818be693
diff --git a/AGENTS.md b/AGENTS.md
index 6d69449ab3..6e1f1464e5 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -159,6 +159,11 @@ CI Lite runs area-specific checks and changed-line coverage on PRs to `main`
or `release`. CI Full runs the complete suites for `release`. Changed-line
coverage must be at least 80 percent.
+### Test ownership
+
+OpenHuman tests composition, host policy, adapters, RPC wire contracts, and data compatibility. Module behavior is tested in the owning `vendor/tiny*` repository. A host test that calls a vendor module's internals (for example, `tinychannels::providers::*` or `tinyinference_local::service::*`) belongs upstream. When code moves upstream, move its tests in the same upstream PR, then delete them in the host PR. Keep one host smoke test per module: load it and make one call through the bus. That is enough to test the host integration.
+
+A PR that only deletes tests is exempt from changed-line coverage because it has no changed lines for diff-cover to measure. CI Lite runs that changed-line check at an 80 percent threshold.
- Frontend unit tests are colocated as `*.test.ts` or `*.test.tsx` under
`app/src/`. Use Vitest and test behavior rather than implementation.
- Rust unit tests are never inline. Put them in a sibling `<module>_tests.rs`
diff --git a/scripts/__tests__/domain-e2e-coverage-gate.test.mjs b/scripts/__tests__/domain-e2e-coverage-gate.test.mjs
index 0e107248c1..0c378bebdf 100644
--- a/scripts/__tests__/domain-e2e-coverage-gate.test.mjs
+++ b/scripts/__tests__/domain-e2e-coverage-gate.test.mjs
@@ -666,6 +666,18 @@ test('still credits a file gated on a real feature', (t) => {
// other Rust target under tests/ still names the RPC method.
test('counts coverage from a non-e2e root Rust test target', (t) => {
const root = fixture(t);
+ const declaredNamespaces = [
+ 'config', 'auth', 'app_state', 'connectivity', 'inference', 'agent', 'tools',
+ 'tool_registry', 'approval', 'memory', 'embeddings', 'channels', 'composio', 'threads',
+ ];
+ for (const namespace of declaredNamespaces) {
+ write(root, `crates/openhuman-core/src/${namespace}/schemas.rs`, controller(namespace, 'list'));
+ }
+ write(
+ root,
+ 'tests/widgets_e2e.rs',
+ declaredNamespaces.map((namespace) => `"openhuman.${namespace}_list"`).join('\n'),
+ );
write(root, 'crates/openhuman-core/src/widgets/schemas.rs', controller('widgets', 'list'));
write(root, 'tests/in_process/widgets_smoke.rs', 'let m = "openhuman.widgets_list";');
diff --git a/scripts/check-domain-e2e-coverage.mjs b/scripts/check-domain-e2e-coverage.mjs
index 7265608f02..b5f4866e1f 100644
--- a/scripts/check-domain-e2e-coverage.mjs
+++ b/scripts/check-domain-e2e-coverage.mjs
@@ -161,7 +161,8 @@ function read(file) {
}
/**
- * Every `"openhuman.x_y"` string literal appearing in a `tests/**\/*_e2e.rs`.
+ * Every `"openhuman.x_y"` string literal appearing in a Rust test under
+ * `tests/**`, regardless of whether its filename ends in `_e2e.rs`.
*
* KNOWN LIMITATION, left in place deliberately. This is a text match, so a
* method named anywhere in such a file counts as covered — including in a
@@ -184,12 +185,12 @@ function read(file) {
function collectInvokedMethods() {
const methods = new Set();
const testsDir = path.join(ROOT, 'tests');
- const files = walk(testsDir, (file) => file.endsWith('_e2e.rs'));
+ const files = walk(testsDir, (file) => file.endsWith('.rs'));
for (const file of files) {
const text = read(file);
// A file the compiler throws away cannot invoke anything. 52 of the 115
- // e2e files open with `#![cfg(any())]` pending the #6382 migration, and
+ // test files open with `#![cfg(any())]` pending the #6382 migration, and
// crediting them put 176 controllers in the covered column that no build
// has compiled since the day they were switched off — the largest single
// source of false coverage this gate had.
@@ -753,7 +754,7 @@ const totalCovered = [...rows.values()].reduce(
);
console.log('');
console.log(
- `Discovered ${totalExpected} controllers across ${rows.size} namespaces; ${totalCovered} invoked by a tests/**/*_e2e.rs target.`,
+ `Discovered ${totalExpected} controllers across ${rows.size} namespaces; ${totalCovered} invoked by a Rust target under tests/**.`,
);
if (excluded.length > 0) {
diff --git a/vendor/tinystoragedrivers b/vendor/tinystoragedrivers
index be94f7568f..620b820c4f 160000
--- a/vendor/tinystoragedrivers
+++ b/vendor/tinystoragedrivers
@@ -1 +1 @@
-Subproject commit be94f7568fe7650b0729be55128f48270414b9a7
+Subproject commit 620b820c4ff6a36807e202aa0f969bb793234a0d