Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

test(e2e): r4-m1 gate descriptor fixture suite in ci

Josué3daa1e3310da
diff --git a/.github/workflows/ci-public.yml b/.github/workflows/ci-public.yml
index baa942c8c..b625c58bc 100644
--- a/.github/workflows/ci-public.yml
+++ b/.github/workflows/ci-public.yml
@@ -271,6 +271,19 @@ jobs:
working-directory: control-ui
run: npm run build
+ e2e-vitest-node-unit:
+ name: E2E Vitest node-unit (tests/e2e)
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
+ - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
+ with:
+ node-version: '24'
+ cache: npm
+ cache-dependency-path: tests/e2e/package-lock.json
+ - name: Run descriptor-bound fixture unit suites
+ run: E2E_VITEST_SUITE_GROUP=node-unit bash scripts/e2e/run-vitest-e2e.sh
+
# ─── Registry contract — boot evenfire-registry and drive the real client ──
# Catches wire-format drift in clerumRegistryClient.ts before merge. Requires
# CROSS_REPO_READ_TOKEN (a fine-grained PAT with Contents:read on the sibling
@@ -499,6 +512,9 @@ jobs:
- name: Test GFS Upload v2 cross-client geometry contract
run: bash scripts/tests/test-gfs-upload-v2-geometry-contract.sh
+ - name: Test E2E Vitest node-unit public gate
+ run: bash scripts/tests/test-e2e-vitest-node-unit-gate.sh
+
- name: Test GFS real-Postgres Minikube runner contract
run: bash scripts/tests/test-gfs-real-pg-minikube-gate.sh
diff --git a/scripts/e2e/run-vitest-e2e.sh b/scripts/e2e/run-vitest-e2e.sh
index bc94f8774..3456f0f4a 100755
--- a/scripts/e2e/run-vitest-e2e.sh
+++ b/scripts/e2e/run-vitest-e2e.sh
@@ -10,7 +10,11 @@ PROFILE="${MINIKUBE_PROFILE:-clerum-test}"
PF_LOG="${E2E_PF_LOG:-/tmp/clerum-test-e2e-port-forwards.log}"
PF_PID=""
WAIT_FULL_STACK="${E2E_WAIT_FULL_STACK:-}"
-DEFAULT_VITEST_SUITES=(
+VITEST_SUITE_GROUP="${E2E_VITEST_SUITE_GROUP:-cluster}"
+DEFAULT_NODE_UNIT_VITEST_SUITES=(
+ gfsUploadV2Fixtures.test.ts
+)
+DEFAULT_CLUSTER_VITEST_SUITES=(
gfsUploadProductMutation.test.ts
gfsUploadV2Runtime.test.ts
gfsUploadV2Runtime.read.test.ts
@@ -44,6 +48,7 @@ DEFAULT_VITEST_SUITES=(
mcp-host/crd.test.ts
mcp-host/health.test.ts
)
+DEFAULT_VITEST_SUITES=("${DEFAULT_CLUSTER_VITEST_SUITES[@]}")
if [[ -z "${WAIT_FULL_STACK}" ]]; then
if [[ "${GITHUB_ACTIONS:-false}" == "true" ]]; then
@@ -73,6 +78,69 @@ die() {
exit 1
}
+ensure_vitest_dependencies() {
+ if [[ ! -x tests/e2e/node_modules/.bin/vitest ]]; then
+ log "Installing tests/e2e dependencies with npm ci"
+ (cd tests/e2e && npm ci --no-audit --no-fund)
+ fi
+}
+
+# Run Vitest and FAIL if zero tests actually executed, even on a green exit:
+# "nothing failed" is not "everything passed". A renamed/deleted suite or an
+# empty glob must not pass silently.
+run_vitest_gate() {
+ local log
+ log="$(mktemp)"
+ local status=0
+ # Capture Vitest's real exit code across the tee (a pipe otherwise reports
+ # tee's status). Guards below run regardless, to catch a green-but-empty run.
+ set +e
+ npx vitest run "$@" 2>&1 | tee "${log}"
+ status="${PIPESTATUS[0]}"
+ set -e
+ if grep -qE "No test files found" "${log}"; then
+ rm -f "${log}"
+ die "Vitest reported 'No test files found' — zero tests executed. A gate that ran nothing is not green."
+ fi
+ if ! grep -qE "Tests +[1-9][0-9]* (passed|failed)" "${log}"; then
+ rm -f "${log}"
+ die "Vitest reported no executed tests (no 'Tests N' with N>0). Refusing to treat an empty run as success."
+ fi
+ rm -f "${log}"
+ return "${status}"
+}
+
+run_selected_vitest_suites() {
+ log "Running Vitest E2E (${VITEST_SUITE_GROUP})"
+ cd tests/e2e
+ if [[ "$#" -gt 0 ]]; then
+ run_vitest_gate "$@"
+ return
+ fi
+
+ local default_suites=()
+ case "${VITEST_SUITE_GROUP}" in
+ cluster)
+ default_suites=("${DEFAULT_CLUSTER_VITEST_SUITES[@]}")
+ ;;
+ node-unit)
+ default_suites=("${DEFAULT_NODE_UNIT_VITEST_SUITES[@]}")
+ ;;
+ *)
+ die "unknown E2E_VITEST_SUITE_GROUP '${VITEST_SUITE_GROUP}' (expected cluster or node-unit)"
+ ;;
+ esac
+
+ log "No explicit Vitest specs supplied; running deterministic ${VITEST_SUITE_GROUP} suites"
+ # A suite renamed or deleted out of this explicit list would resolve to zero
+ # files and pass silently while the other suites keep files.length > 0. Fail
+ # loud, by name, before running a single test.
+ for suite in "${default_suites[@]}"; do
+ [[ -f "${suite}" ]] || die "Vitest suite not found: ${suite} (renamed or deleted?). A gate cannot pass over a suite that never ran."
+ done
+ run_vitest_gate "${default_suites[@]}"
+}
+
cleanup() {
if [[ -n "${PF_PID}" ]]; then
kill "${PF_PID}" 2>/dev/null || true
@@ -168,6 +236,17 @@ NODE
cd "${PROJECT_DIR}"
+ensure_vitest_dependencies
+
+if [[ "${VITEST_SUITE_GROUP}" == "node-unit" ]]; then
+ run_selected_vitest_suites "$@"
+ exit 0
+fi
+
+if [[ "${VITEST_SUITE_GROUP}" != "cluster" ]]; then
+ die "unknown E2E_VITEST_SUITE_GROUP '${VITEST_SUITE_GROUP}' (expected cluster or node-unit)"
+fi
+
if ! minikube -p "${PROFILE}" status >/dev/null 2>&1; then
die "minikube profile '${PROFILE}' is not running. Run: make minikube-setup"
fi
@@ -176,11 +255,6 @@ if ! kubectl --context="${PROFILE}" cluster-info >/dev/null 2>&1; then
die "kubectl cannot reach context '${PROFILE}'. Run: make minikube-status"
fi
-if [[ ! -x tests/e2e/node_modules/.bin/vitest ]]; then
- log "Installing tests/e2e dependencies with npm ci"
- (cd tests/e2e && npm ci --no-audit --no-fund)
-fi
-
export MINIKUBE_PROFILE="${PROFILE}"
export KUBECONTEXT="${KUBECONTEXT:-${PROFILE}}"
export KUBE_CONTEXT="${KUBE_CONTEXT:-${PROFILE}}"
@@ -246,42 +320,4 @@ if [[ -n "${E2E_SKIP_IF_CLUSTER_UNREACHABLE:-}" ]]; then
die "E2E_SKIP_IF_CLUSTER_UNREACHABLE is set — the gate refuses the skip bypass (a down cluster would report a false green). Unset it; the flag is for local exploration only."
fi
-# Run Vitest and FAIL if zero tests actually executed, even on a green exit:
-# "nothing failed" is not "everything passed". A renamed/deleted suite or an
-# empty glob must not pass silently.
-run_vitest_gate() {
- local log
- log="$(mktemp)"
- local status=0
- # Capture Vitest's real exit code across the tee (a pipe otherwise reports
- # tee's status). Guards below run regardless, to catch a green-but-empty run.
- set +e
- npx vitest run "$@" 2>&1 | tee "${log}"
- status="${PIPESTATUS[0]}"
- set -e
- if grep -qE "No test files found" "${log}"; then
- rm -f "${log}"
- die "Vitest reported 'No test files found' — zero tests executed. A gate that ran nothing is not green."
- fi
- if ! grep -qE "Tests +[1-9][0-9]* (passed|failed)" "${log}"; then
- rm -f "${log}"
- die "Vitest reported no executed tests (no 'Tests N' with N>0). Refusing to treat an empty run as success."
- fi
- rm -f "${log}"
- return "${status}"
-}
-
-log "Running Vitest E2E"
-cd tests/e2e
-if [[ "$#" -gt 0 ]]; then
- run_vitest_gate "$@"
-else
- log "No explicit Vitest specs supplied; running deterministic default suites"
- # A suite renamed or deleted out of this explicit list would resolve to zero
- # files and pass silently while the other suites keep files.length > 0. Fail
- # loud, by name, before running a single test.
- for suite in "${DEFAULT_VITEST_SUITES[@]}"; do
- [[ -f "${suite}" ]] || die "Vitest suite not found: ${suite} (renamed or deleted?). A gate cannot pass over a suite that never ran."
- done
- run_vitest_gate "${DEFAULT_VITEST_SUITES[@]}"
-fi
+run_selected_vitest_suites "$@"
diff --git a/scripts/tests/test-e2e-vitest-node-unit-gate.sh b/scripts/tests/test-e2e-vitest-node-unit-gate.sh
new file mode 100755
index 000000000..72836bc19
--- /dev/null
+++ b/scripts/tests/test-e2e-vitest-node-unit-gate.sh
@@ -0,0 +1,37 @@
+#!/usr/bin/env bash
+set -euo pipefail
+
+ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
+RUNNER="${ROOT_DIR}/scripts/e2e/run-vitest-e2e.sh"
+WORKFLOW="${ROOT_DIR}/.github/workflows/ci-public.yml"
+
+require_contains() {
+ local file="$1"
+ local needle="$2"
+ local description="$3"
+ if ! grep -Fq -- "${needle}" "${file}"; then
+ echo "missing ${description}: ${needle}" >&2
+ exit 1
+ fi
+}
+
+require_contains "${RUNNER}" "DEFAULT_NODE_UNIT_VITEST_SUITES=(" \
+ "node-unit suite registry"
+require_contains "${RUNNER}" "gfsUploadV2Fixtures.test.ts" \
+ "descriptor fixture suite registration"
+require_contains "${RUNNER}" "E2E_VITEST_SUITE_GROUP" \
+ "suite-group selector"
+require_contains "${RUNNER}" "if [[ \"\${VITEST_SUITE_GROUP}\" == \"node-unit\" ]]" \
+ "cluster-free node-unit execution path"
+require_contains "${RUNNER}" "Vitest reported 'No test files found'" \
+ "zero-file guard"
+require_contains "${RUNNER}" "Vitest reported no executed tests" \
+ "zero-test guard"
+require_contains "${WORKFLOW}" "E2E Vitest node-unit (tests/e2e)" \
+ "public CI job"
+require_contains "${WORKFLOW}" "node-version: '24'" \
+ "Node 24 setup"
+require_contains "${WORKFLOW}" "E2E_VITEST_SUITE_GROUP=node-unit bash scripts/e2e/run-vitest-e2e.sh" \
+ "canonical runner invocation"
+
+echo "E2E Vitest node-unit public gate contract OK"