Skip to content

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

fix(tests): prepare the pinned search module for Rust E2E

Steven Enamakel2084d51ddf04
diff --git a/scripts/__tests__/rust-e2e-enumeration.test.mjs b/scripts/__tests__/rust-e2e-enumeration.test.mjs
index dce1d69862..1dba58c156 100644
--- a/scripts/__tests__/rust-e2e-enumeration.test.mjs
+++ b/scripts/__tests__/rust-e2e-enumeration.test.mjs
@@ -217,3 +217,53 @@ test("a failing case still fails the suite, and nothing after it runs", () => {
assert.doesNotMatch(res.output, /SUITE-REPORTED-SUCCESS/);
assert.deepEqual(res.runs, [runOf("scenario_a")]);
});
+
+test("the E2E runner builds and exports its pinned search module fixture", () => {
+ const source = fs.readFileSync(runner, "utf8");
+ const start = source.indexOf("# Module-backed Composio coverage");
+ const end = source.indexOf('echo "[rust-e2e] Running', start);
+ assert.ok(start >= 0 && end > start, "module preparation block exists");
+ const dir = fs.mkdtempSync(path.join(os.tmpdir(), "rust-e2e-modules-"));
+ const runLog = path.join(dir, "runs.log");
+ const cargo = path.join(dir, "cargo");
+ fs.writeFileSync(
+ cargo,
+ '#!/usr/bin/env bash\nprintf \'%s\\n\' "$*" >> "$STUB_RUN_LOG"\n',
+ { mode: 0o755 },
+ );
+ try {
+ const output = execFileSync(
+ "bash",
+ [
+ "-c",
+ [
+ "set -euo pipefail",
+ 'REPO_ROOT="$STUB_DIR"',
+ 'CARGO_BIN="$STUB_DIR/cargo"',
+ "unset TINYCONNECTORS_TEST_MODULE TINYSEARCH_TEST_MODULE",
+ source.slice(start, end),
+ "printf 'search=%s\\n' \"${TINYSEARCH_TEST_MODULE:-}\"",
+ ].join("\n"),
+ ],
+ {
+ encoding: "utf8",
+ env: { ...process.env, STUB_DIR: dir, STUB_RUN_LOG: runLog },
+ },
+ );
+ assert.ok(
+ output.includes(
+ `search=${dir}/vendor/tinysearch/target/release/libtinysearch.so`,
+ ),
+ output,
+ );
+ assert.ok(
+ fs
+ .readFileSync(runLog, "utf8")
+ .includes(
+ "build --release --manifest-path vendor/tinysearch/crates/tinysearch/Cargo.toml",
+ ),
+ );
+ } finally {
+ fs.rmSync(dir, { recursive: true, force: true });
+ }
+});
diff --git a/scripts/test-rust-e2e.sh b/scripts/test-rust-e2e.sh
index 0a2170dd0f..e69cf470bc 100755
--- a/scripts/test-rust-e2e.sh
+++ b/scripts/test-rust-e2e.sh
@@ -180,6 +180,17 @@ if [ -z "${TINYCONNECTORS_TEST_MODULE:-}" ]; then
export TINYCONNECTORS_TEST_MODULE="$REPO_ROOT/$connectors_module"
fi
+# The isolated module-admission suite requires a real native search module.
+# Build the pinned source, as the product unit runner does, before discovering
+# and executing the E2E targets; never fall back to release downloads in a test.
+if [ -z "${TINYSEARCH_TEST_MODULE:-}" ]; then
+ search_manifest="vendor/tinysearch/crates/tinysearch/Cargo.toml"
+ search_module="vendor/tinysearch/target/release/libtinysearch.so"
+ echo "[rust-e2e] Building pinned TinySearch test module ..."
+ "$CARGO_BIN" build --release --manifest-path "$search_manifest"
+ export TINYSEARCH_TEST_MODULE="$REPO_ROOT/$search_module"
+fi
+
echo "[rust-e2e] Running ${#SUITES[@]} suite(s) serially."
run_json_rpc_e2e_suite() {