File tree Expand file tree Collapse file tree 3 files changed +54
-4
lines changed
sources/commonjs-preserve Expand file tree Collapse file tree 3 files changed +54
-4
lines changed Original file line number Diff line number Diff line change
1
+ const functions = require ( "firebase-functions" ) ;
2
+ const functionsv2 = require ( "firebase-functions/v2" ) ;
3
+
4
+ exports . v1http = functions . https . onRequest ( ( req , resp ) => {
5
+ resp . status ( 200 ) . send ( "PASS" ) ;
6
+ } ) ;
7
+
8
+ exports . v1httpPreserve = functions
9
+ . runWith ( { preserveExternalChanges : true } )
10
+ . https . onRequest ( ( req , resp ) => {
11
+ resp . status ( 200 ) . send ( "PASS" ) ;
12
+ } ) ;
13
+
14
+ functionsv2 . setGlobalOptions ( { preserveExternalChanges : true } ) ;
15
+
16
+ exports . v2http = functionsv2 . https . onRequest ( ( req , resp ) => {
17
+ resp . status ( 200 ) . send ( "PASS" ) ;
18
+ } ) ;
Original file line number Diff line number Diff line change
1
+ {
2
+ "name" : " commonjs-preserve"
3
+ }
Original file line number Diff line number Diff line change @@ -14,13 +14,15 @@ const TIMEOUT_M = 5_000;
14
14
const TIMEOUT_S = 1_000 ;
15
15
16
16
const DEFAULT_OPTIONS = {
17
- memory : null ,
17
+ availableMemoryMb : null ,
18
18
maxInstances : null ,
19
19
minInstances : null ,
20
20
timeoutSeconds : null ,
21
- vpcConnector : null ,
22
- vpcConnectorEgressSettings : null ,
23
- serviceAccount : null ,
21
+ vpc : {
22
+ connector : null ,
23
+ egressSettings : null ,
24
+ } ,
25
+ serviceAccountEmail : null ,
24
26
ingressSettings : null ,
25
27
} ;
26
28
@@ -217,6 +219,33 @@ describe("functions.yaml", () => {
217
219
} ,
218
220
} ,
219
221
} ,
222
+ {
223
+ name : "preserveChange" ,
224
+ modulePath : "./scripts/bin-test/sources/commonjs-preserve" ,
225
+ expected : {
226
+ endpoints : {
227
+ v1http : {
228
+ ...DEFAULT_V1_OPTIONS ,
229
+ platform : "gcfv1" ,
230
+ entryPoint : "v1http" ,
231
+ httpsTrigger : { } ,
232
+ } ,
233
+ v1httpPreserve : {
234
+ platform : "gcfv1" ,
235
+ entryPoint : "v1httpPreserve" ,
236
+ httpsTrigger : { } ,
237
+ } ,
238
+ v2http : {
239
+ platform : "gcfv2" ,
240
+ entryPoint : "v2http" ,
241
+ labels : { } ,
242
+ httpsTrigger : { } ,
243
+ } ,
244
+ } ,
245
+ requiredAPIs : [ ] ,
246
+ specVersion : "v1alpha1" ,
247
+ } ,
248
+ } ,
220
249
] ;
221
250
222
251
for ( const tc of testcases ) {
You can’t perform that action at this time.
0 commit comments