@@ -19,11 +19,9 @@ The integration test framework:
1919 ```
2020 This creates ` integration_test/firebase-functions-python-local.whl `
2121
22- 2 . ** Firebase Projects** : V1 and V2 tests run on separate Firebase projects:
23- - ** V1 functions** : ` functions-integration-tests `
24- - ** V2 functions** : ` functions-integration-tests-v2 `
25-
26- These projects are completely isolated from each other.
22+ 2 . ** Firebase Project** : Python SDK only supports 2nd gen Cloud Functions:
23+ - ** All tests** : ` functions-integration-tests-v2 `
24+ - ** Note** : V1/V2 in suite names refers to Firebase service API versions, not Cloud Functions generations
2725
28263 . ** Dependencies** :
2927 - Node.js 18+ (for test runner and generation scripts)
@@ -53,53 +51,31 @@ node scripts/generate.js --list
5351
5452### 2. Deploy Functions
5553
56- ** For V1 Tests:**
57- ``` bash
58- npm run deploy:v1
59- # OR manually:
60- cd generated/functions
61- firebase deploy --only functions --project functions-integration-tests
62- ```
63-
64- ** For V2 Tests:**
6554``` bash
66- npm run deploy:v2
55+ npm run deploy
6756# OR manually:
6857cd generated/functions
6958firebase deploy --only functions --project functions-integration-tests-v2
7059```
7160
7261### 3. Run Tests
7362
74- ** V1 Tests (uses functions-integration-tests project):**
7563``` bash
76- # Run all V1 tests
77- npm run test:v1: all
64+ # Run all tests sequentially
65+ npm run test:all
7866
79- # Run specific V1 test
80- npm run test:v1: firestore
67+ # Run specific test suite
68+ npm run test:firestore
8169
82- # Run V1 tests in parallel
83- npm run test:v1:all:parallel
84- ```
85-
86- ** V2 Tests (uses functions-integration-tests-v2 project):**
87- ``` bash
88- # Run all V2 tests
89- npm run test:v2:all
90-
91- # Run V2 tests in parallel
92- npm run test:v2:all:parallel
70+ # Run tests in parallel (faster but harder to debug)
71+ npm run test:all:parallel
9372```
9473
9574### 4. Cleanup
9675
9776``` bash
98- # Clean up V1 deployed functions
99- npm run cleanup:v1
100-
101- # Clean up V2 deployed functions
102- npm run cleanup:v2
77+ # Clean up deployed functions
78+ npm run cleanup
10379
10480# Remove generated files
10581npm run clean
@@ -110,8 +86,7 @@ npm run clean
11086```
11187integration_test/
11288├── config/
113- │ ├── v1/suites.yaml # V1 test suite configuration
114- │ └── v2/suites.yaml # V2 test suite configuration
89+ │ └── suites.yaml # Unified test suite configuration
11590├── templates/
11691│ └── functions/ # Python function templates
11792│ ├── firebase.json.hbs
@@ -133,11 +108,11 @@ integration_test/
133108
134109## Configuration
135110
136- ### Suite Configuration (` config/v[1|2]/ suites.yaml ` )
111+ ### Suite Configuration (` config/suites.yaml ` )
137112
138113``` yaml
139114defaults :
140- projectId : functions-integration-tests
115+ projectId : functions-integration-tests-v2
141116 region : us-central1
142117 timeout : 540
143118 dependencies :
@@ -201,7 +176,7 @@ To add support for a new trigger type:
201176 }
202177 }
203178 ` ` `
204- 3. **Add Configuration** : Update `config/v1/ suites.yaml`
179+ 3. **Add Configuration** : Update `config/suites.yaml`
2051804. **Add Tests** : Create Jest test file in `tests/v1/[service].test.ts`
206181
207182# # Environment Variables
@@ -265,45 +240,33 @@ gsutil ls gs://functions-integration-tests-v2-test-results/
265240
266241If functions aren't cleaned up properly :
267242` ` ` bash
268- # For V1 project
269- firebase functions:delete --project functions-integration-tests --force
243+ # Delete functions
244+ firebase functions:delete --project functions-integration-tests-v2 --force
270245
271- # For V2 project
246+ # Or use cleanup script
272247firebase functions:delete --project functions-integration-tests-v2 --force
273248` ` `
274249
275250# # Cloud Build Integration
276251
277- The integration tests are run via Cloud Build with complete project separation. V1 and V2 tests run on different Firebase projects to ensure isolation .
252+ The integration tests are run via Cloud Build. Python SDK only supports 2nd gen functions, so all tests deploy to the same project .
278253
279- # ## Available Configurations
254+ # ## Configuration
280255
281- # ### 1. `cloudbuild-v1.yaml` - V1 Tests Only
282- - **Project**: `functions-integration-tests`
283- - **What it does**:
284- - Builds the Python SDK wheel
285- - Generates all V1 Python functions
286- - Deploys to V1 project
287- - Runs all V1 integration tests
288- - Cleans up deployed functions
289-
290- **Usage** (from repository root):
291- ` ` ` bash
292- gcloud builds submit --config=integration_test/cloudbuild-v1.yaml .
293- ` ` `
294-
295- # ### 2. `cloudbuild-v2.yaml` - V2 Tests Only
256+ # ### `cloudbuild.yaml`
296257- **Project**: `functions-integration-tests-v2`
297258- **What it does**:
298259 - Builds the Python SDK wheel
299- - Generates all V2 Python functions
300- - Deploys to V2 project
301- - Runs all V2 integration tests
260+ - Generates Python functions (both v1 and v2 API suites)
261+ - Deploys to functions-integration-tests-v2
262+ - Runs integration tests
302263 - Cleans up deployed functions
303264
304265**Usage** (from repository root):
305266` ` ` bash
306- gcloud builds submit --config=integration_test/cloudbuild-v2.yaml .
267+ gcloud builds submit --config=integration_test/cloudbuild.yaml --project=functions-integration-tests-v2 .
268+ # Or use npm script:
269+ npm run cloudbuild
307270` ` `
308271
309272# ## Configuration Details
@@ -342,44 +305,31 @@ Artifacts are uploaded to:
342305# ## Automated Triggers
343306
344307You can set up Cloud Build triggers to run on :
345- - **Pull requests**: Use `cloudbuild-v1 .yaml` for quick feedback
346- - **Merges to main**: Run both `cloudbuild-v1.yaml` and `cloudbuild-v2 .yaml` separately
347- - **Nightly builds**: Run both configurations for full regression testing
308+ - **Pull requests**: Use `cloudbuild.yaml` for quick feedback on v1 API tests
309+ - **Merges to main**: Run full test suite with `cloudbuild.yaml`
310+ - **Nightly builds**: Run comprehensive tests across all suites
348311
349312# ## Manual CI/CD Steps
350313
351- For custom CI/CD pipelines, run V1 and V2 tests separately :
314+ For custom CI/CD pipelines :
352315
353- # ### V1 Tests
354316` ` ` bash
355317# Build SDK
356318./scripts/pack-for-integration-tests.sh
357319
358- # Generate, deploy, and test V1 functions
320+ # Generate functions (v1 and/or v2 API suites)
359321cd integration_test
360- node scripts/generate.js 'v1_*'
361- cd generated/functions
362- pip install -r requirements.txt
363- firebase deploy --project functions-integration-tests --token $FIREBASE_TOKEN
364- cd ../..
365- npm run test:v1:all:sequential
366- npm run cleanup:v1
367- ` ` `
322+ node scripts/generate.js 'v1_*' # Or 'v2_*' or specific suites
368323
369- # ### V2 Tests
370- ` ` ` bash
371- # Build SDK
372- ./scripts/pack-for-integration-tests.sh
373-
374- # Generate, deploy, and test V2 functions
375- cd integration_test
376- node scripts/generate.js 'v2_*'
324+ # Deploy and test
377325cd generated/functions
326+ python3.11 -m venv venv
327+ source venv/bin/activate
378328pip install -r requirements.txt
379329firebase deploy --project functions-integration-tests-v2 --token $FIREBASE_TOKEN
380330cd ../..
381- npm run test:v2: all:sequential
382- npm run cleanup:v2
331+ npm run test:all:sequential
332+ npm run cleanup
383333` ` `
384334
385335# # Contributing
0 commit comments