Skip to content
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
2393538
test(e2e): migrate network policy to Vitest
jyaunches Jun 11, 2026
651dfa5
ci(e2e): filter free-standing Vitest jobs
jyaunches Jun 11, 2026
a95d120
ci(e2e): install OpenShell for network policy Vitest
jyaunches Jun 11, 2026
7f45a2e
test(e2e): retry transient network-policy onboard
jyaunches Jun 11, 2026
9631c8c
chore: merge main into PR branch
jyaunches Jun 11, 2026
fc370fa
Merge remote-tracking branch 'origin/main' into e2e-migrate/test-netw…
jyaunches Jun 11, 2026
a84b91e
Merge remote-tracking branch 'origin/main' into e2e-migrate/test-netw…
jyaunches Jun 11, 2026
5f5433c
test(e2e): tighten Slack policy assertion
jyaunches Jun 11, 2026
c1370d2
Merge remote-tracking branch 'origin/main' into e2e-migrate/test-netw…
jyaunches Jun 11, 2026
8eb579d
fix(ci): map network policy scenario selector
jyaunches Jun 11, 2026
b099f25
test(ci): avoid source-shape workflow assertion
jyaunches Jun 11, 2026
174c016
Merge remote-tracking branch 'origin/main' into e2e-migrate/test-netw…
jyaunches Jun 11, 2026
17022ca
test(e2e): harden network policy validation
jyaunches Jun 11, 2026
96dae66
fix(ci): validate free-standing scenarios
jyaunches Jun 11, 2026
4293195
test(ci): harden vitest selector workflow
jyaunches Jun 11, 2026
50e1320
Merge remote-tracking branch 'origin/main' into e2e-migrate/test-netw…
jyaunches Jun 11, 2026
bfe024f
style(test): format selector workflow coverage
jyaunches Jun 11, 2026
63bba68
test(e2e): tighten network policy pypi probe
jyaunches Jun 11, 2026
5789e01
Merge remote-tracking branch 'origin/main' into e2e-migrate/test-netw…
jyaunches Jun 11, 2026
49c8661
Merge remote-tracking branch 'origin/main' into e2e-migrate/test-netw…
jyaunches Jun 11, 2026
eb12434
Merge remote-tracking branch 'origin/main' into e2e-migrate/test-netw…
jyaunches Jun 11, 2026
5a1bc34
test(e2e): force NemoClaw gateway in network policy
jyaunches Jun 11, 2026
64f4b54
fix(ci): mask rejected scenario selectors
jyaunches Jun 11, 2026
cbf7c9e
fix(ci): remove unused Docker auth preflight
jyaunches Jun 11, 2026
9bfcea0
Merge remote-tracking branch 'origin/main' into e2e-migrate/test-netw…
jyaunches Jun 11, 2026
716d7e4
fix(ci): mask matrix scenario validation
jyaunches Jun 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
131 changes: 114 additions & 17 deletions .github/workflows/e2e-vitest-scenarios.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,15 @@ jobs:
SCENARIOS: ${{ inputs.scenarios }}
run: |
set -euo pipefail
allowed_jobs="openshell-version-pin-vitest,onboard-negative-paths-vitest,openclaw-tui-chat-correlation-vitest,gateway-guard-recovery"
allowed_jobs="openshell-version-pin-vitest,onboard-negative-paths-vitest,network-policy-vitest,openclaw-tui-chat-correlation-vitest,gateway-guard-recovery"
if [ -n "${JOBS}" ] && [ -n "${SCENARIOS}" ]; then
echo "::error::Use either scenarios or jobs, not both." >&2
exit 1
fi
if [ -n "${SCENARIOS}" ] && [[ ! "${SCENARIOS}" =~ ^[A-Za-z0-9_-]+(,[A-Za-z0-9_-]+)*$ ]]; then
echo "::error::Invalid scenario input; use comma-separated scenario ids containing only letters, numbers, underscores, and hyphens." >&2
exit 1
fi
if [ -z "${JOBS}" ]; then
echo "No free-standing job selector supplied; default workflow behavior applies."
exit 0
Expand Down Expand Up @@ -88,14 +92,40 @@ jobs:
run: |
set -euo pipefail
args=(--emit-live-matrix)
registry_scenarios=()
free_standing_scenarios=(openshell-version-pin onboard-negative-paths network-policy openclaw-tui-chat-correlation)
is_free_standing_scenario() {
local id="$1"
local known
for known in "${free_standing_scenarios[@]}"; do
if [[ "${id}" == "${known}" ]]; then
return 0
fi
done
return 1
}
if [ -n "${SCENARIOS}" ]; then
if [[ ! "${SCENARIOS}" =~ ^[A-Za-z0-9_-]+(,[A-Za-z0-9_-]+)*$ ]]; then
echo "::error::Invalid scenario input: ${SCENARIOS}" >&2
exit 1
fi
args+=(--scenarios "${SCENARIOS}")
IFS=',' read -r -a requested_scenarios <<< "${SCENARIOS}"
for scenario in "${requested_scenarios[@]}"; do
if is_free_standing_scenario "${scenario}"; then
continue
fi
registry_scenarios+=("${scenario}")
done
if [ "${#registry_scenarios[@]}" -gt 0 ]; then
registry_csv="$(IFS=,; echo "${registry_scenarios[*]}")"
args+=(--scenarios "${registry_csv}")
fi
fi
if [ -n "${SCENARIOS}" ] && [ "${#registry_scenarios[@]}" -eq 0 ]; then
matrix="[]"
else
matrix="$(npx tsx test/e2e-scenario/scenarios/run.ts "${args[@]}")"
fi
matrix="$(npx tsx test/e2e-scenario/scenarios/run.ts "${args[@]}")"
echo "matrix=${matrix}" >> "$GITHUB_OUTPUT"
MATRIX_JSON="${matrix}" python - <<'PY' >> "$GITHUB_STEP_SUMMARY"
import json
Expand All @@ -112,7 +142,7 @@ jobs:

live-scenarios:
needs: generate-matrix
if: ${{ inputs.jobs == '' }}
if: ${{ inputs.jobs == '' && needs.generate-matrix.outputs.matrix != '[]' }}
runs-on: ${{ matrix.runner }}
timeout-minutes: 45
strategy:
Expand Down Expand Up @@ -213,8 +243,8 @@ jobs:
# because the matrix above only runs registry-scenarios.test.ts. Modeled on
# #5049's free-standing pattern.
openshell-version-pin-vitest:
needs: validate-jobs
if: ${{ (inputs.jobs == '' && inputs.scenarios == '') || contains(format(',{0},', inputs.jobs), ',openshell-version-pin-vitest,') }}
needs: [validate-jobs, generate-matrix]
if: ${{ (inputs.jobs == '' && inputs.scenarios == '') || contains(format(',{0},', inputs.jobs), ',openshell-version-pin-vitest,') || contains(format(',{0},', inputs.scenarios), ',openshell-version-pin,') }}
runs-on: ubuntu-latest
timeout-minutes: 15
env:
Expand Down Expand Up @@ -254,8 +284,8 @@ jobs:
retention-days: 14

onboard-negative-paths-vitest:
needs: validate-jobs
if: ${{ (inputs.jobs == '' && inputs.scenarios == '') || contains(format(',{0},', inputs.jobs), ',onboard-negative-paths-vitest,') }}
needs: [validate-jobs, generate-matrix]
if: ${{ (inputs.jobs == '' && inputs.scenarios == '') || contains(format(',{0},', inputs.jobs), ',onboard-negative-paths-vitest,') || contains(format(',{0},', inputs.scenarios), ',onboard-negative-paths,') }}
runs-on: ubuntu-latest
timeout-minutes: 15
env:
Expand Down Expand Up @@ -298,12 +328,74 @@ jobs:
if-no-files-found: ignore
retention-days: 14

network-policy-vitest:
needs: [validate-jobs, generate-matrix]
if: ${{ (inputs.jobs == '' && inputs.scenarios == '') || contains(format(',{0},', inputs.jobs), ',network-policy-vitest,') || contains(format(',{0},', inputs.scenarios), ',network-policy,') }}
runs-on: ubuntu-latest
timeout-minutes: 90
env:
E2E_ARTIFACT_DIR: ${{ github.workspace }}/e2e-artifacts/vitest/network-policy
NEMOCLAW_CLI_BIN: ${{ github.workspace }}/bin/nemoclaw.js
NEMOCLAW_RUN_E2E_SCENARIOS: "1"
# Raw OpenShell sandbox commands in the migrated live test must target
# the gateway registered by NemoClaw onboarding even when OpenShell has
# no active gateway selected on the runner.
OPENSHELL_GATEWAY: nemoclaw
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false

- name: Set up Node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.0.0
with:
node-version: 22
cache: npm

- name: Install root dependencies
run: npm ci --ignore-scripts

- name: Build CLI
run: npm run build:cli

- name: Install OpenShell
# Runs without workflow tokens, Docker credentials, or NVIDIA_API_KEY.
# scripts/install-openshell.sh pins the OpenShell version and verifies
# release SHA-256 checksums before installation.
env:
NEMOCLAW_NON_INTERACTIVE: "1"
run: |
set -euo pipefail
env -u DOCKER_CONFIG -u DOCKERHUB_USERNAME -u DOCKERHUB_TOKEN -u NVIDIA_API_KEY -u GITHUB_TOKEN bash scripts/install-openshell.sh

- name: Run network-policy live test
# Migrated from test/e2e/test-network-policy.sh. Free-standing anchor
# for live network policy allow/deny probes; shell retirement remains
# deferred to #5098 Phase 11.
env:
NVIDIA_API_KEY: ${{ secrets.NVIDIA_API_KEY }}
run: |
set -euo pipefail
npx vitest run --project e2e-scenarios-live \
test/e2e-scenario/live/network-policy.test.ts \
--silent=false --reporter=default
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved

- name: Upload network-policy artifacts
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: e2e-vitest-scenarios-network-policy
path: e2e-artifacts/vitest/network-policy/
include-hidden-files: false
if-no-files-found: ignore
retention-days: 14

# Focused coverage slice for the #2603/#3145 OpenClaw websocket
# protocol/history contract. The retained legacy bash lane remains the
# source for full closeout until a later PR proves replacement and deletes it.
openclaw-tui-chat-correlation-vitest:
needs: validate-jobs
if: ${{ (inputs.jobs == '' && inputs.scenarios == '') || contains(format(',{0},', inputs.jobs), ',openclaw-tui-chat-correlation-vitest,') }}
needs: [validate-jobs, generate-matrix]
if: ${{ (inputs.jobs == '' && inputs.scenarios == '') || contains(format(',{0},', inputs.jobs), ',openclaw-tui-chat-correlation-vitest,') || contains(format(',{0},', inputs.scenarios), ',openclaw-tui-chat-correlation,') }}
runs-on: ubuntu-latest
timeout-minutes: 75
env:
Expand Down Expand Up @@ -481,6 +573,7 @@ jobs:
live-scenarios,
openshell-version-pin-vitest,
onboard-negative-paths-vitest,
network-policy-vitest,
openclaw-tui-chat-correlation-vitest,
gateway-guard-recovery,
]
Expand All @@ -501,11 +594,13 @@ jobs:
const runUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`;
const workflowBranch = context.ref.replace('refs/heads/', '');
const prNumberInput = process.env.JOB_PR_NUMBER || '';
const requestedScenarios = process.env.JOB_SCENARIOS || '';
const rawRequestedScenarios = process.env.JOB_SCENARIOS || '';
const rawRequestedJobs = process.env.JOBS || '';
const jobsValidationPassed = needs['validate-jobs']?.result === 'success';
const requestedJobs = jobsValidationPassed ? rawRequestedJobs : '';
const jobsRejected = rawRequestedJobs && !jobsValidationPassed;
const selectorValidationPassed = needs['validate-jobs']?.result === 'success';
const requestedScenarios = selectorValidationPassed ? rawRequestedScenarios : '';
const requestedJobs = selectorValidationPassed ? rawRequestedJobs : '';
const scenariosRejected = rawRequestedScenarios && !selectorValidationPassed;
const jobsRejected = rawRequestedJobs && !selectorValidationPassed;

let prNumber = prNumberInput ? Number.parseInt(prNumberInput, 10) : undefined;
if (!prNumber) {
Expand Down Expand Up @@ -543,9 +638,11 @@ jobs:
'',
`**Run:** [${context.runId}](${runUrl})`,
`**Workflow ref:** \`${workflowBranch}\``,
requestedScenarios
? `**Requested scenarios:** \`${requestedScenarios}\``
: '**Requested scenarios:** _(default — all supported)_',
scenariosRejected
? '**Requested scenarios:** _(selector rejected by validate-jobs)_'
: requestedScenarios
? `**Requested scenarios:** \`${requestedScenarios}\``
: '**Requested scenarios:** _(default — all supported)_',
jobsRejected
? '**Requested jobs:** _(selector rejected by validate-jobs)_'
: requestedJobs
Expand Down
20 changes: 20 additions & 0 deletions test/e2e-scenario/live/network-policy-transient-provider.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

import type { ShellProbeResult } from "../fixtures/shell-probe.ts";

const TRANSIENT_PROVIDER_VALIDATION_RE =
/endpoint validation failed|failed to verify inference endpoint|Chat Completions API validation/i;
const TRANSIENT_PROVIDER_DETAIL_RE =
/timed? out|timeout|curl failed \(exit (7|28|35|52|56)\)|ETIMEDOUT|ECONNRESET|EAI_AGAIN|ENOTFOUND|failed to connect|error sending request|HTTP (429|502|503|504)|returned HTTP (429|502|503|504)|temporar/i;

function resultText(result: Pick<ShellProbeResult, "stdout" | "stderr">): string {
return [result.stdout, result.stderr].filter(Boolean).join("\n");
}

export function isTransientProviderValidationFailure(
result: Pick<ShellProbeResult, "stdout" | "stderr">,
): boolean {
const output = resultText(result);
return TRANSIENT_PROVIDER_VALIDATION_RE.test(output) && TRANSIENT_PROVIDER_DETAIL_RE.test(output);
}
Loading
Loading