(event, context, callback)
| 30 | const appUploadId = 'tfjs-rn-integration-android'; |
| 31 | |
| 32 | async function sync_reactnative(event, context, callback) { |
| 33 | const client = new kms.KeyManagementServiceClient(); |
| 34 | const name = |
| 35 | client.cryptoKeyPath(projectId, locationId, keyRingId, cryptoKeyId); |
| 36 | |
| 37 | const [result] = await client.decrypt({name, ciphertext}); |
| 38 | const browserStackKey = result.plaintext.toString(); |
| 39 | |
| 40 | try { |
| 41 | const syncRes = await request.post(browserStackUploadUrl, { |
| 42 | auth: { |
| 43 | user: browserStackUser, |
| 44 | pass: browserStackKey, |
| 45 | }, |
| 46 | form: { |
| 47 | data: JSON.stringify({'url': testAppUrl, 'custom_id': appUploadId}), |
| 48 | } |
| 49 | }); |
| 50 | sendChatMsg( |
| 51 | process.env.BOTS_HANGOUTS_URL, |
| 52 | 'Success syncing tfjs-react-native integration test app to BrowserStack'); |
| 53 | } catch (e) { |
| 54 | console.log('Error syncing app to browserstack', e); |
| 55 | sendChatMsg( |
| 56 | process.env.HANGOUTS_URL, |
| 57 | 'Error syncing tfjs-react-native integration test app to BrowserStack'); |
| 58 | } |
| 59 | }; |
| 60 | |
| 61 | async function sendChatMsg(url, msg) { |
| 62 | const res = await request(url, { |
nothing calls this directly
no test coverage detected
searching dependent graphs…