Skip to content

Commit bc73680

Browse files
committed
added new env vars to the test-runner.ts, can pass all (for now, TODO)
1 parent 8672516 commit bc73680

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

scripts/test-runner.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,15 @@ import * as path from 'path';
44
import { spawn } from 'child_process';
55
import { KubernetesClient } from 'kubernetesjs';
66

7+
// Since we are in scripts/test-runner.ts, the functions dir is ../functions
8+
79
// Since we are in scripts/test-runner.ts, the functions dir is ../functions
810
const FUNCTIONS_DIR = path.join(__dirname, '../functions');
911
const NAMESPACE = 'default';
1012

13+
// Load .env from root
14+
require('dotenv').config({ path: path.join(__dirname, '../.env') });
15+
1116
let k8s: KubernetesClient;
1217

1318
// Helper to wait
@@ -26,8 +31,17 @@ async function runTestForFunction(fnName: string): Promise<boolean> {
2631
{ name: "IS_IN_POD", value: "true" },
2732
{ name: "NODE_TLS_REJECT_UNAUTHORIZED", value: "0" },
2833
{ name: "PGHOST", value: "postgres" },
29-
{ name: "PGPASSWORD", value: "postgres123!" },
30-
{ name: "PGUSER", value: "postgres" }
34+
{ name: "PGPASSWORD", value: process.env.PGPASSWORD || "password" },
35+
{ name: "PGUSER", value: "postgres" },
36+
// Inject Standard Env Vars
37+
{ name: "STRIPE_PUBLISHABLE_KEY", value: process.env.STRIPE_PUBLISHABLE_KEY },
38+
{ name: "STRIPE_SECRET_KEY", value: process.env.STRIPE_SECRET_KEY },
39+
{ name: "STRIPE_RESTRICTED_KEY", value: process.env.STRIPE_RESTRICTED_KEY },
40+
{ name: "TWILIO_ACCOUNT_SID", value: process.env.TWILIO_ACCOUNT_SID },
41+
{ name: "TWILIO_AUTH_TOKEN", value: process.env.TWILIO_AUTH_TOKEN },
42+
{ name: "TWILIO_FROM_NUMBER", value: process.env.TWILIO_FROM_NUMBER },
43+
{ name: "CALVIN_API_KEY", value: process.env.CALVIN_API_KEY },
44+
{ name: "OPENAI_API_KEY", value: process.env.OPENAI_API_KEY }
3145
];
3246

3347
const jobManifest = {

0 commit comments

Comments
 (0)