From 87918e007e8ae43d0247574ea4f022d5bb30afcb Mon Sep 17 00:00:00 2001 From: Diana Tkachenko Date: Thu, 20 Jun 2019 10:08:00 -0700 Subject: [PATCH 1/2] add RC integration tests back in --- integration_test/functions/src/index.ts | 40 ++++++++++++------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/integration_test/functions/src/index.ts b/integration_test/functions/src/index.ts index 6541dee23..87af96956 100644 --- a/integration_test/functions/src/index.ts +++ b/integration_test/functions/src/index.ts @@ -12,7 +12,7 @@ export * from './database-tests'; export * from './auth-tests'; export * from './firestore-tests'; export * from './https-tests'; -// export * from './remoteConfig-tests'; +export * from './remoteConfig-tests'; export * from './storage-tests'; const numTests = Object.keys(exports).length; // Assumption: every exported function is its own test. @@ -127,25 +127,25 @@ export const integrationTests: any = functions // Invoke a callable HTTPS trigger. callHttpsTrigger('callableTests', { foo: 'bar', testId }, baseUrl), // A Remote Config update to trigger the Remote Config tests. - // admin.credential - // .applicationDefault() - // .getAccessToken() - // .then(accessToken => { - // const options = { - // hostname: 'firebaseremoteconfig.googleapis.com', - // path: `/v1/projects/${firebaseConfig.projectId}/remoteConfig`, - // method: 'PUT', - // headers: { - // Authorization: 'Bearer ' + accessToken.access_token, - // 'Content-Type': 'application/json; UTF-8', - // 'Accept-Encoding': 'gzip', - // 'If-Match': '*', - // }, - // }; - // const request = https.request(options, resp => {}); - // request.write(JSON.stringify({ version: { description: testId } })); - // request.end(); - // }), + admin.credential + .applicationDefault() + .getAccessToken() + .then(accessToken => { + const options = { + hostname: 'firebaseremoteconfig.googleapis.com', + path: `/v1/projects/${firebaseConfig.projectId}/remoteConfig`, + method: 'PUT', + headers: { + Authorization: 'Bearer ' + accessToken.access_token, + 'Content-Type': 'application/json; UTF-8', + 'Accept-Encoding': 'gzip', + 'If-Match': '*', + }, + }; + const request = https.request(options, resp => {}); + request.write(JSON.stringify({ version: { description: testId } })); + request.end(); + }), // A storage upload to trigger the Storage tests admin .storage() From 83439ff66c0384f2f2dd169f7e52f3a18314a9dd Mon Sep 17 00:00:00 2001 From: Diana Tkachenko Date: Mon, 24 Jun 2019 11:34:59 -0700 Subject: [PATCH 2/2] formatting --- integration_test/functions/src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/integration_test/functions/src/index.ts b/integration_test/functions/src/index.ts index 87af96956..679ba3a5a 100644 --- a/integration_test/functions/src/index.ts +++ b/integration_test/functions/src/index.ts @@ -130,7 +130,7 @@ export const integrationTests: any = functions admin.credential .applicationDefault() .getAccessToken() - .then(accessToken => { + .then((accessToken) => { const options = { hostname: 'firebaseremoteconfig.googleapis.com', path: `/v1/projects/${firebaseConfig.projectId}/remoteConfig`, @@ -142,7 +142,7 @@ export const integrationTests: any = functions 'If-Match': '*', }, }; - const request = https.request(options, resp => {}); + const request = https.request(options, (resp) => {}); request.write(JSON.stringify({ version: { description: testId } })); request.end(); }),