Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
21640d3
This is an ai-generated draft for testing. It must still be deeply re…
falahat Aug 6, 2026
8ac398a
Address some initial comments and add E2E test suites in typescript
falahat Aug 7, 2026
6d39157
Some follow-up fixes for env vars and secrets
falahat Aug 7, 2026
472781b
Minor secret handling code, some debugging code as well
falahat Aug 7, 2026
79e8bf7
Add soem ugly Cloud Build handling
falahat Aug 7, 2026
913435c
Fix field masks for the v2 Cloud Run API
falahat Aug 7, 2026
730fd65
Code review improvements:
falahat Aug 7, 2026
e8d689e
Followup fixes:
falahat Aug 7, 2026
721e5bd
Fix firebase.json schema
falahat Aug 7, 2026
89959de
Improve readability, extract helper methods, and address some code re…
falahat Aug 7, 2026
90a2343
tighten up the API to require values explicitly. We pick defaults at …
falahat Aug 12, 2026
8c325f1
Remove ABIU fields from firebase.json, these are only CLI flags. Clou…
falahat Aug 12, 2026
899046a
Implement a placeholder init service
falahat Aug 12, 2026
28af03f
Update some CLI flags
falahat Aug 12, 2026
1d43d64
use polling instead of home-brewed manual waits when checking for Clo…
falahat Aug 12, 2026
268b51d
fix polling
falahat Aug 12, 2026
eb1d28e
Add a temporary warning for BUILD secrets
falahat Aug 12, 2026
97f4b5c
Dont need build secret warning
falahat Aug 12, 2026
bc669c1
clean uo gcp test resources
falahat Aug 12, 2026
27664cd
Add a unit test for missing project id
falahat Aug 12, 2026
e966475
Format/lint fixes
falahat Aug 13, 2026
da5d61c
fix schema diff update
falahat Aug 13, 2026
e04aac1
Another pass of fixes from human code review
falahat Aug 17, 2026
e89b892
Add more secret tests
falahat Aug 17, 2026
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 package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"test:functions-discover": "bash ./scripts/functions-discover-tests/run.sh",
"test:hosting": "bash ./scripts/hosting-tests/run.sh",
"test:hosting-rewrites": "bash ./scripts/hosting-tests/rewrites-tests/run.sh",
"test:run-deploy": "bash ./scripts/run-deploy-tests/run.sh",
Comment thread
falahat marked this conversation as resolved.
"test:import-export": "bash ./scripts/emulator-import-export-tests/run.sh",
"test:triggers-end-to-end": "bash ./scripts/triggers-end-to-end-tests/run.sh",
"test:triggers-end-to-end:inspect": "bash ./scripts/triggers-end-to-end-tests/run.sh inspect",
Expand Down
66 changes: 66 additions & 0 deletions schema/firebase-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -1221,6 +1221,59 @@
],
"type": "object"
},
"RunSingle": {
"additionalProperties": false,
"properties": {
"ignore": {
"items": {
"type": "string"
},
"type": "array"
},
"postdeploy": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "string"
}
]
},
"predeploy": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "string"
}
]
},
"region": {
"type": "string"
},
"rootDir": {
"type": "string"
},
"serviceAccount": {
"type": "string"
},
Comment thread
falahat marked this conversation as resolved.
"serviceId": {
"type": "string"
}
},
"required": [
"serviceId"
],
"type": "object"
},
"StorageSingle": {
"additionalProperties": false,
"properties": {
Expand Down Expand Up @@ -2008,6 +2061,19 @@
"remoteconfig": {
"$ref": "#/definitions/RemoteConfigConfig"
},
"run": {
"anyOf": [
{
"$ref": "#/definitions/RunSingle"
},
{
"items": {
"$ref": "#/definitions/RunSingle"
},
"type": "array"
}
]
},
"storage": {
"anyOf": [
{
Expand Down
71 changes: 71 additions & 0 deletions scripts/integration-helpers/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
this.process = p;

this.process.stdout?.on("data", (data: unknown) => {
process.stdout.write(`[${this.name} stdout] ` + data);

Check warning on line 35 in scripts/integration-helpers/cli.ts

View workflow job for this annotation

GitHub Actions / lint (24)

Operands of '+' operation must either be both strings or both numbers. Consider using a template literal
});

this.process.stderr?.on("data", (data: unknown) => {
console.log(`[${this.name} stderr] ` + data);

Check warning on line 39 in scripts/integration-helpers/cli.ts

View workflow job for this annotation

GitHub Actions / lint (24)

Operands of '+' operation must either be both strings or both numbers. Consider using a template literal
});

let started: Promise<void>;
Expand All @@ -56,7 +56,7 @@
p.stdout?.on("data", customCallback);
p.stdout?.on("close", customFailure);
p.stderr?.on("data", (data) => {
console.error(`[${this.name} stderr]`, data.toString());

Check warning on line 59 in scripts/integration-helpers/cli.ts

View workflow job for this annotation

GitHub Actions / lint (24)

Unsafe call of an `any` typed value

Check warning on line 59 in scripts/integration-helpers/cli.ts

View workflow job for this annotation

GitHub Actions / lint (24)

Unsafe member access .toString on an `any` value
});
});
} else {
Expand Down Expand Up @@ -88,3 +88,74 @@
return stopped;
}
}

export interface Result {
proc: ChildProcess;
stdout: string;
stderr: string;
exitCode?: number | null;
}

/**
* Execute a Firebase CLI command in a target directory with specified arguments and environment.
*/
export function exec(
cmd: string,
project?: string,
additionalArgs: string[] = [],
cwd: string = process.cwd(),
quiet = true,
extraEnv: Record<string, string> = {},
): Promise<Result> {
const args = [cmd];
if (project) {
args.push("--project", project);
}

if (additionalArgs && additionalArgs.length > 0) {
args.push(...additionalArgs);
}

const env = {
...process.env,
...extraEnv,
};

const proc = spawn("firebase", args, { cwd, env });
if (!proc) {
throw new Error("Failed to start firebase CLI");
}

const cli: Result = {
proc,
stdout: "",
stderr: "",
exitCode: null,
};

proc.stdout?.on("data", (data: Buffer) => {
const s = data.toString();
if (!quiet) {
process.stdout.write(s);
}
cli.stdout += s;
});

proc.stderr?.on("data", (data: Buffer) => {
const s = data.toString();
if (!quiet) {
process.stderr.write(s);
}
cli.stderr += s;
});

return new Promise((resolve, reject) => {
proc.on("error", (err) => {
reject(err);
});
proc.on("close", (code) => {
cli.exitCode = code;
resolve(cli);
});
});
}
15 changes: 15 additions & 0 deletions scripts/run-deploy-tests/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
Comment thread
falahat marked this conversation as resolved.
set -e # Immediately exit on failure

# Globally link the CLI for the testing framework
./scripts/clean-install.sh

if [ -f "scripts/set-default-credentials.sh" ]; then
source scripts/set-default-credentials.sh
fi

echo "======================================"
echo "Starting Cloud Run E2E Test Suite"
echo "======================================"

mocha scripts/run-deploy-tests/tests.ts --timeout 600000
Loading
Loading