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
2 changes: 1 addition & 1 deletion packages/cli/e2e/comment.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,5 @@ describe("argos comment", () => {
runAs(["comment", "delete", buildUrl, id]).stdout,
);
expect(deleted.id).toBe(id);
}, 30000);
});
});
2 changes: 1 addition & 1 deletion packages/cli/e2e/deploy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ test("deploys a static site with HTML and CSS assets", () => {

expect(deployResult.combined).toContain("Deployed:");
expect(deployResult.combined).toMatch(/https?:\/\/\S+/);
}, 10000);
});
2 changes: 1 addition & 1 deletion packages/cli/e2e/skip.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { getRequiredEnv, run } from "./utils";

getRequiredEnv("ARGOS_TOKEN");

test("skip returns a build URL", { timeout: 20_000 }, () => {
test("skip returns a build URL", () => {
const buildName = `argos-cli-e2e-skipped-node-${process.env.NODE_VERSION}-${process.env.OS}`;
const skipResult = run(["skip", "--build-name", buildName]);

Expand Down
2 changes: 1 addition & 1 deletion packages/cli/e2e/upload-oidc.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { run } from "./utils";
// No ARGOS_TOKEN — authentication is handled via GitHub Actions OIDC.
test(
"upload returns a full build URL using OIDC authentication",
{ tags: ["oidc"], timeout: 20_000 },
{ tags: ["oidc"] },
() => {
const buildName = `argos-cli-e2e-oidc-node-${process.env.NODE_VERSION}-${process.env.OS}`;
const uploadResult = run([
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/e2e/upload-tokenless.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { run } from "./utils";
// eslint-disable-next-line vitest/no-disabled-tests
test.skip(
"upload returns a full build URL using tokenless authentication",
{ tags: ["tokenless"], timeout: 20_000 },
{ tags: ["tokenless"] },
() => {
const buildName = `argos-cli-e2e-tokenless-node-${process.env.NODE_VERSION}-${process.env.OS}`;
const uploadResult = run([
Expand Down
5 changes: 3 additions & 2 deletions packages/cli/e2e/upload.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ getRequiredEnv("ARGOS_TOKEN");

// This test uploads the full __fixtures__ directory, which includes a 10MB PNG
// stress fixture. That file is sharp-optimized, hashed, and uploaded to S3 over
// a real network connection, so a generous timeout is required to avoid flakes.
test("upload returns a full build URL", { timeout: 30_000 }, () => {
// a real network connection. It relies on the generous e2e timeout configured
// in vitest.config.ts.
test("upload returns a full build URL", () => {
const buildName = `argos-cli-e2e-node-${process.env.NODE_VERSION}-${process.env.OS}`;
const uploadResult = run([
"upload",
Expand Down
41 changes: 37 additions & 4 deletions packages/cli/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
export default {
import { defineConfig } from "vitest/config";

/**
* The e2e suite spawns the built CLI and talks to the live Argos API, so every
* test is bound by network latency rather than by local compute. Vitest's
* default 5s budget is routinely too tight on a loaded CI runner, which shows
* up as a single matrix cell failing on a timeout while the others pass.
*
* Applied as a project-level default so individual tests and hooks don't have
* to carry hand-written timeouts.
*/
const E2E_TIMEOUT = 30_000;

export default defineConfig({
test: {
environment: "node",
include: ["src/**/*.test.ts", "e2e/**/*.test.ts"],
tags: [
{
name: "oidc",
Expand All @@ -12,5 +23,27 @@ export default {
description: "Tokenless exchange tests.",
},
],
projects: [
{
extends: true,
test: {
name: "unit",
environment: "node",
include: ["src/**/*.test.ts"],
},
},
{
extends: true,
test: {
name: "e2e",
environment: "node",
include: ["e2e/**/*.test.ts"],
testTimeout: E2E_TIMEOUT,
// Several e2e files seed state from the API in `beforeAll`, which is
// subject to the same latency (default hook budget is 10s).
hookTimeout: E2E_TIMEOUT,
},
},
],
},
};
});
Loading