Skip to content

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

TypeScript

fix(e2e): start projected proxy modules and await mcp rollout

Alfredo Lopez88befb5ef1a6
diff --git a/scripts/e2e/_lib/hcc-watch-api-proxy.mjs b/scripts/e2e/_lib/hcc-watch-api-proxy.mjs
index 343d8d9c0..07a1526ec 100644
--- a/scripts/e2e/_lib/hcc-watch-api-proxy.mjs
+++ b/scripts/e2e/_lib/hcc-watch-api-proxy.mjs
@@ -1,7 +1,6 @@
// Development-only transport fixture. No fabricated upstream success responses.
import fs from 'node:fs'
import https from 'node:https'
-import { pathToFileURL } from 'node:url'
import { createBookmarkObservation } from './hcc-watch-bookmarks.mjs'
export function validateCommand(command, allowedPaths) {
@@ -188,7 +187,8 @@ export function createProxy({
return { server, close }
}
-if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
+// Node 24's native entry marker also handles Kubernetes projected symlinks.
+if (import.meta.main) {
const proxy = createProxy({
key: fs.readFileSync('/fixture-tls/tls.key'),
cert: fs.readFileSync('/fixture-tls/tls.crt'),
diff --git a/scripts/minikube/full-setup.sh b/scripts/minikube/full-setup.sh
index 2eea890fc..97860ebdb 100755
--- a/scripts/minikube/full-setup.sh
+++ b/scripts/minikube/full-setup.sh
@@ -2151,6 +2151,7 @@ CORE_DEPLOYS=(
"profiles:external-rest-api"
"rpc-proxy:rpc-proxy"
"mcp-host:chatllm"
+ "mcp-server:mcp-proxy"
)
# registry-api is deployed by Step 7 (side-by-side); failure there is a
# warning, not blocking — leave it out of the CORE_DEPLOYS readiness gate
diff --git a/scripts/tests/hcc-watch-api-proxy.test.mjs b/scripts/tests/hcc-watch-api-proxy.test.mjs
index 2919efd12..4be604128 100644
--- a/scripts/tests/hcc-watch-api-proxy.test.mjs
+++ b/scripts/tests/hcc-watch-api-proxy.test.mjs
@@ -2,7 +2,15 @@ import assert from 'node:assert/strict'
import { spawnSync } from 'node:child_process'
import { X509Certificate, generateKeyPairSync } from 'node:crypto'
import { once } from 'node:events'
-import { mkdtempSync, readFileSync, rmSync, watch, writeFileSync } from 'node:fs'
+import {
+ existsSync,
+ mkdtempSync,
+ readFileSync,
+ rmSync,
+ symlinkSync,
+ watch,
+ writeFileSync,
+} from 'node:fs'
import https from 'node:https'
import { tmpdir } from 'node:os'
import { dirname, join, resolve } from 'node:path'
@@ -20,6 +28,34 @@ let front
let upstreamTls
let publicConfig
+test('projected-file symlink CLI enters startup and fails loud without fixture mounts', () => {
+ // ConfigMap projection resolves import.meta.url to a timestamped real path,
+ // while argv[1] retains the projected symlink. Never create root mounts or
+ // open the proxy listener in this entry-point regression.
+ assert.equal(existsSync('/fixture-tls'), false, 'test requires no root fixture mount')
+ const directory = mkdtempSync(join(tmpdir(), 'hcc-proxy-entry-'))
+ try {
+ const entry = join(directory, 'projected-proxy.mjs')
+ symlinkSync(join(root, 'scripts/e2e/_lib/hcc-watch-api-proxy.mjs'), entry)
+ const result = spawnSync(process.execPath, [entry], {
+ encoding: 'utf8',
+ timeout: 5000,
+ maxBuffer: 65536,
+ })
+ assert.equal(result.error, undefined, 'CLI terminated without a runner error')
+ assert.notEqual(result.status, 0, 'projected CLI must not silently exit successfully')
+ assert.equal(result.stdout, '')
+ assert.equal(result.stderr.includes('ENOENT'), true, 'startup attempted its required mount')
+ assert.equal(
+ result.stderr.includes('/fixture-tls/tls.key'),
+ true,
+ 'failure is the expected missing fixture mount'
+ )
+ } finally {
+ rmSync(directory, { recursive: true, force: true })
+ }
+})
+
function certificate() {
const { privateKey } = generateKeyPairSync('rsa', {
modulusLength: 2048,
diff --git a/scripts/tests/test-minikube-full-setup.sh b/scripts/tests/test-minikube-full-setup.sh
index 660e8bd92..b2059e58c 100755
--- a/scripts/tests/test-minikube-full-setup.sh
+++ b/scripts/tests/test-minikube-full-setup.sh
@@ -325,6 +325,40 @@ assert_branch_scoped_minikube_context_is_supported() {
fi
}
+# The extracted production block invokes these stubs and assigns all_ready.
+# shellcheck disable=SC2034,SC2329,SC2154
+assert_mcp_proxy_bootstrap_wait_is_bounded_and_fail_closed() {
+ local block outcome result
+ block="$(sed -n '/^CORE_DEPLOYS=(/,/^done$/p' scripts/minikube/full-setup.sh)"
+ for outcome in ready unavailable; do
+ result="$(
+ KC=fixture_kubectl
+ proxy_waits=0
+ log() { :; }
+ ok() { :; }
+ warn() { :; }
+ err() { :; }
+ postgres_has_invalid_checkpoint() { return 1; }
+ fixture_kubectl() {
+ if [[ "$*" == 'rollout status deployment/mcp-proxy -n mcp-server --timeout=180s' ]]; then
+ proxy_waits=$((proxy_waits + 1))
+ [[ "$outcome" == ready ]]
+ return
+ fi
+ return 0
+ }
+ eval "$block"
+ printf '%s %s' "$proxy_waits" "$all_ready"
+ )"
+ if [[ "$outcome" == ready && "$result" != '1 true' ]] || \
+ [[ "$outcome" == unavailable && "$result" != '1 false' ]]; then
+ fail "mcp-proxy bootstrap wait must run once with a finite deadline and block completion on failure ($outcome: $result)"
+ return
+ fi
+ done
+ pass "mcp-proxy bootstrap wait is bounded and failure blocks setup completion"
+}
+
assert_gfs_provisioning_follows_migrations_and_core_readiness() {
local overlay_line ensure_line migration_line reconcile_after_migration control_ready_line core_block reset_block wal_block
local reset_boundary reset_overlay reset_pg_ready reset_converge
@@ -1517,6 +1551,7 @@ assert_branch_profile_deploy_dir_is_used
assert_member_registration_hmac_is_patched
assert_branch_scoped_minikube_context_is_supported
assert_gfs_provisioning_follows_migrations_and_core_readiness
+assert_mcp_proxy_bootstrap_wait_is_bounded_and_fail_closed
assert_full_setup_defaults_to_db_rebuild
assert_makefile_passes_reuse_db
assert_reuse_db_normalizer_precedes_flag_loop