Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
19 changes: 8 additions & 11 deletions test/e2e-scenario/live/agent-turn-latency-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
} from "../fixtures/clients/sandbox.ts";
import { expect } from "../fixtures/e2e-test.ts";
import type { ShellProbeResult } from "../fixtures/shell-probe.ts";
import { installShOnboardArgs } from "./install-sh-onboard.ts";
import { isTransientProviderValidationFailure } from "./network-policy-transient-provider.ts";

export const REPO_ROOT = path.resolve(import.meta.dirname, "../../..");
Expand Down Expand Up @@ -220,17 +221,13 @@ export async function installSandbox(
): Promise<ShellProbeResult> {
let install: ShellProbeResult | undefined;
for (let attempt = 1; attempt <= INSTALL_ATTEMPTS; attempt += 1) {
install = await host.command(
"bash",
["install.sh", "--non-interactive", "--yes-i-accept-third-party-software"],
{
artifactName: `${agent}-install-attempt-${attempt}`,
cwd: REPO_ROOT,
env: env(sandboxName, agent, apiKey),
redactionValues: [apiKey],
timeoutMs: 30 * 60_000,
},
);
install = await host.command("bash", installShOnboardArgs(), {
artifactName: `${agent}-install-attempt-${attempt}`,
cwd: REPO_ROOT,
env: env(sandboxName, agent, apiKey),
redactionValues: [apiKey],
timeoutMs: 30 * 60_000,
});
const retry =
install.exitCode !== 0 &&
isTransientProviderValidationFailure(install) &&
Expand Down
25 changes: 11 additions & 14 deletions test/e2e-scenario/live/cron-preflight-inference-local.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { type SandboxClient, validateSandboxName } from "../fixtures/clients/san
import { expect, test } from "../fixtures/e2e-test.ts";
import { shouldRunLiveE2EScenarios } from "../fixtures/live-project-gate.ts";
import type { ShellProbeResult } from "../fixtures/shell-probe.ts";
import { installShOnboardArgs } from "./install-sh-onboard.ts";
import { isTransientProviderValidationFailure } from "./network-policy-transient-provider.ts";

const REPO_ROOT = path.resolve(import.meta.dirname, "../../..");
Expand Down Expand Up @@ -265,20 +266,16 @@ test.skipIf(!shouldRunLiveE2EScenarios())(

let install: ShellProbeResult | undefined;
for (let attempt = 1; attempt <= INSTALL_ATTEMPTS; attempt += 1) {
install = await host.command(
"bash",
["install.sh", "--non-interactive", "--yes-i-accept-third-party-software"],
{
artifactName:
attempt === 1
? "phase-1-install-cron-preflight"
: `phase-1-install-cron-preflight-attempt-${attempt}`,
cwd: REPO_ROOT,
env: commandEnv(apiKey),
redactionValues: [apiKey],
timeoutMs: 20 * 60_000,
},
);
install = await host.command("bash", installShOnboardArgs(), {
artifactName:
attempt === 1
? "phase-1-install-cron-preflight"
: `phase-1-install-cron-preflight-attempt-${attempt}`,
cwd: REPO_ROOT,
env: commandEnv(apiKey),
redactionValues: [apiKey],
timeoutMs: 20 * 60_000,
});
if (install.exitCode === 0) break;
if (isTransientProviderValidationFailure(install) && attempt < INSTALL_ATTEMPTS) {
await new Promise((resolve) => setTimeout(resolve, 10_000 * attempt));
Expand Down
14 changes: 14 additions & 0 deletions test/e2e-scenario/live/install-sh-onboard.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

/**
* Canonical install.sh arguments for live Vitest scenarios that auto-onboard.
*
* Live scenario retries must not inherit a failed persisted onboarding session
* from an earlier failed attempt. `--fresh` makes install.sh bypass the failed
* session classifier and lets the CLI clear stale session state before creating
* the new session.
*/
export function installShOnboardArgs(): string[] {
return ["install.sh", "--non-interactive", "--yes-i-accept-third-party-software", "--fresh"];
}
35 changes: 35 additions & 0 deletions test/e2e-scenario/support-tests/install-sh-onboard.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

import fs from "node:fs";
import path from "node:path";

import { describe, expect, it } from "vitest";

import { installShOnboardArgs } from "../live/install-sh-onboard.ts";

const RETRY_SENSITIVE_LIVE_TESTS = [
"test/e2e-scenario/live/agent-turn-latency-helpers.ts",
"test/e2e-scenario/live/cron-preflight-inference-local.test.ts",
];

describe("live install.sh onboarding arguments", () => {
it("force a fresh onboarding session so retries discard failed session state", () => {
expect(installShOnboardArgs()).toEqual([
"install.sh",
"--non-interactive",
"--yes-i-accept-third-party-software",
"--fresh",
]);
});

it("routes retry-sensitive live install.sh callers through the fresh-session helper", () => {
for (const relativePath of RETRY_SENSITIVE_LIVE_TESTS) {
const source = fs.readFileSync(path.join(process.cwd(), relativePath), "utf8");
expect(source, relativePath).toContain("installShOnboardArgs()");
expect(source, relativePath).not.toContain(
'["install.sh", "--non-interactive", "--yes-i-accept-third-party-software"]',
);
}
});
});
Loading