Skip to content

Commit 3d6ef0b

Browse files
committed
test(remote-config): onConfigUpdatedi helper is one-at-a-time, use correct version
- previously we were still using the old v1 definitions, so no updates were used - previously default instances/concurrency were allowed, so parallel e2e runs could update the template in between the update/alter/publish causing publish errors
1 parent 7643000 commit 3d6ef0b

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

.github/workflows/scripts/functions/src/fetchAppCheckToken.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@
99

1010
import { getAppCheck } from 'firebase-admin/app-check';
1111
import { CallableRequest, onCall } from 'firebase-functions/v2/https';
12+
import { getAdminApp } from '.';
1213

1314
// Note: this will only work in a live environment, not locally via the Firebase emulator.
1415
export const fetchAppCheckTokenV2 = onCall(async (req: CallableRequest<{ appId: string }>) => {
1516
const { appId } = req.data;
1617
const expireTimeMillis = Math.floor(Date.now() / 1000) + 60 * 60;
18+
getAdminApp();
1719
const result = await getAppCheck().createToken(appId);
1820
return { ...result, expireTimeMillis };
1921
});

.github/workflows/scripts/functions/src/testFunctionRemoteConfigUpdate.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ import { CallableRequest, onCall } from 'firebase-functions/v2/https';
1313
import { getAdminApp } from '.';
1414

1515
export const testFunctionRemoteConfigUpdateV2 = onCall(
16+
{
17+
maxInstances: 1,
18+
concurrency: 1,
19+
},
1620
async (
1721
req: CallableRequest<{
1822
operations: {

packages/remote-config/e2e/helpers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ exports.updateTemplate = async function updateTemplate(operations) {
55
const response = await fetch(
66
'https://us-central1-' +
77
getE2eTestProject() +
8-
'.cloudfunctions.net/testFunctionRemoteConfigUpdate',
8+
'.cloudfunctions.net/testFunctionRemoteConfigUpdateV2',
99
{
1010
method: 'post',
1111
body: JSON.stringify({ data: operations }),

0 commit comments

Comments
 (0)