-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathvitest.e2e.config.ts
More file actions
68 lines (58 loc) · 1.91 KB
/
Copy pathvitest.e2e.config.ts
File metadata and controls
68 lines (58 loc) · 1.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import { defineConfig } from "vitest/config"
import fs from "fs"
import pathModule from "path"
/**
* Load credentials from a gitignored `.env.e2e` at the repo root (KEY=VALUE lines) into process.env
* WITHOUT overriding anything already set (CI passes real GitHub secrets via env). This keeps the
* account creds out of the repo and out of any command line during local runs.
*/
function loadDotEnvE2E(): void {
const file = pathModule.join(__dirname, ".env.e2e")
if (!fs.existsSync(file)) {
return
}
for (const rawLine of fs.readFileSync(file, "utf-8").split("\n")) {
const line = rawLine.trim()
if (!line || line.startsWith("#")) {
continue
}
const eq = line.indexOf("=")
if (eq === -1) {
continue
}
const key = line.slice(0, eq).trim()
const value = line
.slice(eq + 1)
.trim()
.replace(/^["']|["']$/g, "")
if (key && process.env[key] === undefined) {
process.env[key] = value
}
}
}
loadDotEnvE2E()
/**
* E2E config — real @filen/sdk against a live test account. Completely separate from the deterministic
* unit/scenario suite: a REAL clock (no fake timers), generous network timeouts, and serial execution
* (one world at a time against the shared account). No coverage gate — these validate live behavior, not
* lines. The suite skips itself when FILEN_TEST_EMAIL / FILEN_TEST_PASSWORD are absent.
*/
export default defineConfig({
test: {
globals: true,
environment: "node",
include: ["tests/e2e/**/*.test.ts"],
// Very generous: CI runners can be slow and real transfers + tree fetches add up. Better to wait
// than to flake on a slow-but-healthy run.
testTimeout: 7200_000,
hookTimeout: 7200_000,
teardownTimeout: 7200_000,
// One retry absorbs a transient network blip without masking a persistent failure.
retry: 1,
// Never run e2e files concurrently — they share one account.
fileParallelism: false,
sequence: {
concurrent: false
}
}
})