Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions .github/workflows/e2e-brev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ jobs:
TEST_SUITE: ${{ inputs.test_suite }}
USE_LAUNCHABLE: ${{ inputs.use_launchable && '1' || '0' }}
LAUNCHABLE_SETUP_SCRIPT: ${{ inputs.setup_script_url || '' }}
BREV_PROVIDER: gcp
KEEP_ALIVE: ${{ inputs.keep_alive }}
run: npx vitest run --project e2e-brev --reporter=verbose

Expand Down
14 changes: 10 additions & 4 deletions test/e2e/brev-e2e.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
* LAUNCHABLE_SETUP_SCRIPT — URL to setup script for launchable path (default: brev-launchable-ci-cpu.sh on main)
* BREV_MIN_VCPU — Minimum vCPUs for CPU instance (default: 4)
* BREV_MIN_RAM — Minimum RAM in GB for CPU instance (default: 16)
* BREV_PROVIDER — Cloud provider filter for brev search (default: gcp)
*/

import { describe, it, expect, beforeAll, afterAll } from "vitest";
Expand All @@ -33,6 +34,7 @@ import path from "node:path";
// Instance configuration
const BREV_MIN_VCPU = parseInt(process.env.BREV_MIN_VCPU || "4", 10);
const BREV_MIN_RAM = parseInt(process.env.BREV_MIN_RAM || "16", 10);
const BREV_PROVIDER = process.env.BREV_PROVIDER || "gcp";
const INSTANCE_NAME = process.env.INSTANCE_NAME;
const TEST_SUITE = process.env.TEST_SUITE || "full";
const REPO_DIR = path.resolve(import.meta.dirname, "../..");
Expand Down Expand Up @@ -231,7 +233,9 @@ describe.runIf(hasRequiredVars)("Brev E2E", () => {
`[${elapsed()}] Creating instance via launchable (brev search cpu | brev create + startup-script)...`,
);
console.log(`[${elapsed()}] setup-script: ${DEFAULT_SETUP_SCRIPT_PATH}`);
console.log(`[${elapsed()}] cpu: min ${BREV_MIN_VCPU} vCPU, ${BREV_MIN_RAM} GB RAM`);
console.log(
`[${elapsed()}] cpu: min ${BREV_MIN_VCPU} vCPU, ${BREV_MIN_RAM} GB RAM, provider: ${BREV_PROVIDER}`,
);

// Resolve the setup script to a local file path.
// Default: repo-local scripts/brev-launchable-ci-cpu.sh (hermetic).
Expand All @@ -258,7 +262,7 @@ describe.runIf(hasRequiredVars)("Brev E2E", () => {
// we catch create failures and check if the instance exists anyway.
try {
execSync(
`brev search cpu --min-vcpu ${BREV_MIN_VCPU} --min-ram ${BREV_MIN_RAM} --sort price | ` +
`brev search cpu --min-vcpu ${BREV_MIN_VCPU} --min-ram ${BREV_MIN_RAM} --provider ${BREV_PROVIDER} --sort price | ` +
`brev create ${INSTANCE_NAME} --startup-script @${setupScriptPath} --detached`,
{ encoding: "utf-8", timeout: 180_000, stdio: ["pipe", "inherit", "inherit"] },
);
Expand Down Expand Up @@ -509,10 +513,12 @@ describe.runIf(hasRequiredVars)("Brev E2E", () => {
// ── Bare instance path: brev create + brev-setup.sh ────────────
// Full bootstrap from scratch. Slower but doesn't require a launchable.
console.log(`[${elapsed()}] Creating bare CPU instance via brev search cpu | brev create...`);
console.log(`[${elapsed()}] min-vcpu: ${BREV_MIN_VCPU}, min-ram: ${BREV_MIN_RAM}GB`);
console.log(
`[${elapsed()}] min-vcpu: ${BREV_MIN_VCPU}, min-ram: ${BREV_MIN_RAM}GB, provider: ${BREV_PROVIDER}`,
);
try {
execSync(
`brev search cpu --min-vcpu ${BREV_MIN_VCPU} --min-ram ${BREV_MIN_RAM} --sort price | ` +
`brev search cpu --min-vcpu ${BREV_MIN_VCPU} --min-ram ${BREV_MIN_RAM} --provider ${BREV_PROVIDER} --sort price | ` +
`brev create ${INSTANCE_NAME} --detached`,
{ encoding: "utf-8", timeout: 180_000, stdio: ["pipe", "inherit", "inherit"] },
);
Expand Down
Loading