Skip to content

Commit bd57f12

Browse files
authored
feat(functions): Add emulator support for integration tests (#1897)
* feat(functions): Add emulator support for integration tests - Modernize package.json dependencies in integration tests for functions, app_check, and messaging. - Resolve vulnerability in uuid via dependency overrides. - Introduce start.js to spin up local functions emulator dynamically on port 5005. - Strip http:// and https:// prefixes from emulator host strings for iOS to prevent crashes on native iOS client initialization. - Parse FUNCTIONS_EMULATOR_HOST environment variable and --functions_emulator_host flag, and connect functions clients in integration tests to the emulator. * docs: Add release notes for Cloud Functions emulator support * chore: Incorporate PR review feedback and apply formatting * docs: Update integration test backend readmes with emulator instructions
1 parent 28a1738 commit bd57f12

20 files changed

Lines changed: 9110 additions & 15 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,6 @@ src/firebase_test_framework.h
8888
src/ios/.clang-format
8989
src/ios/ios_app_framework.mm
9090
src/ios/ios_firebase_test_framework.mm
91+
92+
# Node dependencies
93+
node_modules/
Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,23 @@
1-
Cloud functions used by the integration test.
2-
Instructions to deploy:
3-
1. From the innermost functions directory run `npm install`
4-
2. From this directory, run `firebase deploy --only functions`
1+
# Cloud Functions for App Check Integration Tests
2+
3+
This directory contains the Cloud Functions backend used by the App Check integration tests.
4+
5+
## Running Locally via Emulator
6+
7+
To run these functions locally using the Firebase emulator:
8+
9+
1. Navigate to the nested `functions/` directory and install dependencies:
10+
```bash
11+
cd functions && npm install && cd ..
12+
```
13+
14+
2. Start the Firebase emulator:
15+
```bash
16+
npx firebase emulators:start --only functions --project functions-integration-test
17+
```
18+
19+
3. Run the integration test client app, specifying the emulator host:
20+
- Command-line flag: `--functions_emulator_host=localhost:5005`
21+
- Environment variable: `FUNCTIONS_EMULATOR_HOST=localhost:5005`
22+
23+
*(Note: On Android, `localhost` or `127.0.0.1` will be automatically mapped to `10.0.2.2` to route requests to the host machine.)*
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
{
2+
"functions": {
3+
"source": "functions"
4+
},
5+
"emulators": {
26
"functions": {
7+
"port": 5005
38
}
9+
}
410
}

0 commit comments

Comments
 (0)