Skip to content

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

refactor(e2e): update e2e shard configurations

Steven Enamakelfe7b2563d48f
diff --git a/.github/workflows/e2e-reusable.yml b/.github/workflows/e2e-reusable.yml
index fba5d5f112..fb34f70a6f 100644
--- a/.github/workflows/e2e-reusable.yml
+++ b/.github/workflows/e2e-reusable.yml
@@ -289,12 +289,8 @@ jobs:
shard:
- { name: foundation, suites: "auth,navigation,system" }
- { name: chat, suites: "chat,skills,journeys" }
- - { name: providers, suites: "providers,notifications" }
- - { name: provider-web, suites: "provider-web" }
- - { name: webhooks, suites: "webhooks" }
- - { name: connectors, suites: "connectors" }
- - { name: payments, suites: "payments" }
- - { name: settings, suites: "settings" }
+ - { name: connections, suites: "providers,provider-web,connectors" }
+ - { name: settings, suites: "settings,notifications" }
steps:
- name: Checkout code
uses: actions/checkout@v7
diff --git a/app/scripts/e2e-run-shards.sh b/app/scripts/e2e-run-shards.sh
index 87d823552c..54ec506071 100755
--- a/app/scripts/e2e-run-shards.sh
+++ b/app/scripts/e2e-run-shards.sh
@@ -1,10 +1,7 @@
#!/usr/bin/env bash
#
-# Local equivalent of the CI shard matrix — runs each suite group as a
-# separate fresh WDIO session, matching `.github/workflows/e2e-reusable.yml`'s
-# `e2e-linux-full` matrix. Mirroring CI exactly is the only way to reproduce
-# CI failures locally: a single shared session that runs all 87 specs hits
-# CEF/esbuild instability after ~30 specs.
+# Local equivalent of the CI shard matrix — each group gets a fresh WDIO
+# session, matching `.github/workflows/e2e-reusable.yml`.
#
# Usage (from repo root, inside the openhuman_ci Docker container):
# bash app/scripts/e2e-run-shards.sh
@@ -14,12 +11,10 @@
# bash -lc "bash app/scripts/e2e-run-shards.sh"
#
# Shards mirror the CI matrix in .github/workflows/e2e-reusable.yml:
-# foundation = auth, navigation, system
-# chat = chat, skills, journeys
-# integrations = providers, webhooks, notifications
-# connectors = connectors
-# payments = payments
-# settings = settings
+# foundation = auth, navigation, system
+# chat = chat, skills, journeys
+# connections = providers, provider-web, connectors
+# settings = settings, notifications
#
set -uo pipefail
@@ -30,12 +25,8 @@ cd "$REPO_ROOT"
SHARDS=(
"foundation:auth,navigation,system"
"chat:chat,skills,journeys"
- "providers:providers,notifications"
- "provider-web:provider-web"
- "webhooks:webhooks"
- "connectors:connectors"
- "payments:payments"
- "settings:settings"
+ "connections:providers,provider-web,connectors"
+ "settings:settings,notifications"
)
# Allow filtering: `bash e2e-run-shards.sh foundation chat`
@@ -51,6 +42,10 @@ if [ "$#" -gt 0 ]; then
fi
done
done
+ if [ "${#FILTERED[@]}" -ne "${#WANT[@]}" ]; then
+ echo "unknown or duplicate shard requested: ${WANT[*]}" >&2
+ exit 2
+ fi
SHARDS=("${FILTERED[@]}")
fi
diff --git a/scripts/__tests__/e2e-web-shards.test.mjs b/scripts/__tests__/e2e-web-shards.test.mjs
new file mode 100644
index 0000000000..2920ccbbc7
--- /dev/null
+++ b/scripts/__tests__/e2e-web-shards.test.mjs
@@ -0,0 +1,75 @@
+import assert from "node:assert/strict";
+import fs from "node:fs";
+import os from "node:os";
+import path from "node:path";
+import { spawnSync } from "node:child_process";
+import test from "node:test";
+import { fileURLToPath } from "node:url";
+
+const repoRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../..");
+const script = path.join(repoRoot, "app/scripts/e2e-web-shards.sh");
+const fixtureRoot = fs.mkdtempSync(path.join(repoRoot, "target", "e2e-web-shards-test-"));
+
+function run(args, env = {}) {
+ return spawnSync("bash", [script, ...args], {
+ cwd: repoRoot,
+ encoding: "utf8",
+ env: { ...process.env, ...env },
+ });
+}
+
+test("four lanes assign each of 64 shards and nine special units once", () => {
+ const units = [];
+ for (let lane = 1; lane <= 4; lane += 1) {
+ const result = run([`--lane=${lane}`, "--lanes=4", "--list"]);
+ assert.equal(result.status, 0, result.stderr);
+ units.push(...JSON.parse(result.stdout));
+ }
+
+ const shards = units.filter((unit) => unit.kind === "shard");
+ const specials = units.filter((unit) => unit.kind !== "shard");
+ assert.equal(shards.length, 64);
+ assert.deepEqual(
+ shards.map((unit) => unit.shard).sort((a, b) => Number.parseInt(a) - Number.parseInt(b)),
+ Array.from({ length: 64 }, (_, index) => `${index + 1}/64`),
+ );
+ assert.equal(specials.length, 9);
+ assert.deepEqual(
+ specials.map((unit) => unit.index).sort((a, b) => a - b),
+ Array.from({ length: 9 }, (_, index) => index),
+ );
+ assert.equal(new Set(units.map((unit) => `${unit.kind}:${unit.index}`)).size, 73);
+});
+
+test("invalid lane is rejected", () => {
+ const result = run(["--lane=5", "--lanes=4", "--list"]);
+ assert.equal(result.status, 2);
+ assert.match(result.stderr, /exceeds lane count/);
+});
+
+test("failed units retain failure while later units run in distinct workspaces", () => {
+ const runner = path.join(fixtureRoot, "runner.sh");
+ fs.writeFileSync(
+ runner,
+ '#!/usr/bin/env bash\nprintf "%s|%s\\n" "$OPENHUMAN_WORKSPACE" "$*" >> "$CALL_LOG"\n[[ "$*" != *"--shard=4/64"* ]]\n',
+ );
+ fs.chmodSync(runner, 0o755);
+ const callLog = path.join(fixtureRoot, "calls.log");
+ const workspace = path.join(fixtureRoot, "workspaces");
+ const result = run(["--lane=4", "--lanes=4"], {
+ E2E_WEB_SESSION_RUNNER: `bash ${runner}`,
+ CALL_LOG: callLog,
+ OPENHUMAN_WORKSPACE: workspace,
+ });
+ assert.equal(result.status, 1, result.stderr);
+ const calls = fs.readFileSync(callLog, "utf8").trim().split("\n");
+ assert.equal(calls.length, 18);
+ assert.ok(calls.some((call) => call.includes("--shard=4/64")));
+ assert.ok(calls.some((call) => call.includes("--shard=64/64")));
+ const paths = calls.map((call) => call.split("|")[0]);
+ assert.equal(new Set(paths).size, paths.length);
+ assert.equal(fs.readFileSync(path.join(workspace, "lane-4/receipts/shard-4.exit"), "utf8").trim(), "1");
+ assert.equal(fs.readFileSync(path.join(workspace, "lane-4/receipts/shard-64.exit"), "utf8").trim(), "0");
+});
+
+test.after(() => fs.rmSync(fixtureRoot, { recursive: true, force: true }));