diff --git a/test/__tests__/data/google_cloud_function_router_input.json b/test/__tests__/data/google_cloud_function_router_input.json deleted file mode 100644 index f3f829fdad..0000000000 --- a/test/__tests__/data/google_cloud_function_router_input.json +++ /dev/null @@ -1,170 +0,0 @@ -[ - { - "destination": { - "Config": { - "triggerType": "Http", - "apiKeyId": "randomAPI", - "enableBatchInput": true, - "googleCloudFunctionUrl": "https://us-central1-big-query-integration-poc.cloudfunctions.net/rudderv1", - "maxBatchSize": "2" - } - }, - "metadata": { - "jobId": "1" - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "anon_id", - "type": "identify", - "traits": { - "email": "cosmo@krammer.com", - "name": "Cosmo Krammer", - "linkedinUrl": "https://linkedin.com/cosmo-krammer", - "location": "New York", - "emailOptOut": true, - "masterAvatarTypeCode": 10 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - }, - { - "destination": { - "Config": { - "triggerType": "Http", - "apiKeyId": "randomAPI", - "enableBatchInput": true, - "googleCloudFunctionUrl": "", - "maxBatchSize": "2" - } - }, - "metadata": { - "jobId": "2" - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "anon_id", - "type": "identify", - "traits": { - "email": "cosmo@krammer.com", - "name": "Cosmo Krammer", - "linkedinUrl": "https://linkedin.com/cosmo-krammer", - "location": "New York", - "emailOptOut": true, - "masterAvatarTypeCode": 10 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - }, - { - "destination": { - "Config": { - "triggerType": "Http", - "apiKeyId": "randomAPI", - "enableBatchInput": true, - "googleCloudFunctionUrl": "https://us-central1-big-query-integration-poc.cloudfunctions.net/rudderv1", - "maxBatchSize": "2" - } - }, - "metadata": { - "jobId": "3" - }, - "message": { - "channel": "web", - "context": { - "app": { - "build": "1.0.0", - "name": "RudderLabs JavaScript SDK", - "namespace": "com.rudderlabs.javascript", - "version": "1.0.0" - }, - "library": { - "name": "RudderLabs JavaScript SDK", - "version": "1.0.0" - }, - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36", - "locale": "en-US", - "ip": "0.0.0.0", - "os": { - "name": "", - "version": "" - }, - "screen": { - "density": 2 - } - }, - "messageId": "84e26acc-56a5-4835-8233-591137fca468", - "session_id": "3049dc4c-5a95-4ccd-a3e7-d74a7e411f22", - "originalTimestamp": "2019-10-14T09:03:17.562Z", - "anonymousId": "anon_id", - "type": "identify", - "traits": { - "email": "cosmo@krammer.com", - "name": "Cosmo Krammer", - "linkedinUrl": "https://linkedin.com/cosmo-krammer", - "location": "New York", - "emailOptOut": true, - "masterAvatarTypeCode": 10 - }, - "integrations": { - "All": true - }, - "sentAt": "2019-10-14T09:03:22.563Z" - } - } -] diff --git a/test/__tests__/data/google_cloud_function_router_output.json b/test/__tests__/data/google_cloud_function_router_output.json deleted file mode 100644 index 890cca7180..0000000000 --- a/test/__tests__/data/google_cloud_function_router_output.json +++ /dev/null @@ -1,55 +0,0 @@ -[ - { - "batchedRequest": { - "version": "1", - "type": "REST", - "method": "POST", - "endpoint": "https://us-central1-big-query-integration-poc.cloudfunctions.net/rudderv1", - "headers": { - "content-type": "application/json", - "ApiKey": "Basic YXBpS2V5OnJhbmRvbUFQSQ==" - }, - "params": {}, - "body": { - "JSON": {}, - "JSON_ARRAY": { - "batch": "[{\"channel\":\"web\",\"context\":{\"app\":{\"build\":\"1.0.0\",\"name\":\"RudderLabs JavaScript SDK\",\"namespace\":\"com.rudderlabs.javascript\",\"version\":\"1.0.0\"},\"library\":{\"name\":\"RudderLabs JavaScript SDK\",\"version\":\"1.0.0\"},\"userAgent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36\",\"locale\":\"en-US\",\"ip\":\"0.0.0.0\",\"os\":{\"name\":\"\",\"version\":\"\"},\"screen\":{\"density\":2}},\"messageId\":\"84e26acc-56a5-4835-8233-591137fca468\",\"session_id\":\"3049dc4c-5a95-4ccd-a3e7-d74a7e411f22\",\"originalTimestamp\":\"2019-10-14T09:03:17.562Z\",\"anonymousId\":\"anon_id\",\"type\":\"identify\",\"traits\":{\"email\":\"cosmo@krammer.com\",\"name\":\"Cosmo Krammer\",\"linkedinUrl\":\"https://linkedin.com/cosmo-krammer\",\"location\":\"New York\",\"emailOptOut\":true,\"masterAvatarTypeCode\":10},\"integrations\":{\"All\":true},\"sentAt\":\"2019-10-14T09:03:22.563Z\"},{\"channel\":\"web\",\"context\":{\"app\":{\"build\":\"1.0.0\",\"name\":\"RudderLabs JavaScript SDK\",\"namespace\":\"com.rudderlabs.javascript\",\"version\":\"1.0.0\"},\"library\":{\"name\":\"RudderLabs JavaScript SDK\",\"version\":\"1.0.0\"},\"userAgent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36\",\"locale\":\"en-US\",\"ip\":\"0.0.0.0\",\"os\":{\"name\":\"\",\"version\":\"\"},\"screen\":{\"density\":2}},\"messageId\":\"84e26acc-56a5-4835-8233-591137fca468\",\"session_id\":\"3049dc4c-5a95-4ccd-a3e7-d74a7e411f22\",\"originalTimestamp\":\"2019-10-14T09:03:17.562Z\",\"anonymousId\":\"anon_id\",\"type\":\"identify\",\"traits\":{\"email\":\"cosmo@krammer.com\",\"name\":\"Cosmo Krammer\",\"linkedinUrl\":\"https://linkedin.com/cosmo-krammer\",\"location\":\"New York\",\"emailOptOut\":true,\"masterAvatarTypeCode\":10},\"integrations\":{\"All\":true},\"sentAt\":\"2019-10-14T09:03:22.563Z\"}]" - }, - "XML": {}, - "FORM": {} - }, - "files": {} - }, - "metadata": [{ "jobId": "1" }, { "jobId": "3" }], - "batched": true, - "statusCode": 200, - "destination": { - "Config": { - "triggerType": "Http", - "apiKeyId": "randomAPI", - "enableBatchInput": true, - "googleCloudFunctionUrl": "https://us-central1-big-query-integration-poc.cloudfunctions.net/rudderv1", - "maxBatchSize": "2" - } - } - }, - { - "destination": { - "Config": { - "triggerType": "Http", - "apiKeyId": "randomAPI", - "enableBatchInput": true, - "googleCloudFunctionUrl": "", - "maxBatchSize": "2" - } - }, - "metadata": [{ "jobId": "2" }], - "batched": false, - "statusCode": 400, - "error": "[GCF]:: Url not found. Aborting", - "statTags": { - "errorCategory": "dataValidation", - "errorType": "configuration" - } - } -] diff --git a/test/__tests__/google_cloud_function.test.js b/test/__tests__/google_cloud_function.test.js deleted file mode 100644 index cec89300aa..0000000000 --- a/test/__tests__/google_cloud_function.test.js +++ /dev/null @@ -1,27 +0,0 @@ -const integration = "google_cloud_function"; -const name = "google_cloud_function"; - -const fs = require("fs"); -const path = require("path"); -const version = "v0"; - -const transformer = require(`../../src/${version}/destinations/${integration}/transform`); - -// Router Test Data -const inputRouterDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_input.json`) -); -const outputRouterDataFile = fs.readFileSync( - path.resolve(__dirname, `./data/${integration}_router_output.json`) -); -const inputRouterData = JSON.parse(inputRouterDataFile); -const expectedRouterData = JSON.parse(outputRouterDataFile); - -describe(`${name} Tests`, () => { - describe("Router Tests", () => { - it("Payload", async () => { - const routerOutput = await transformer.processRouterDest(inputRouterData); - expect(routerOutput).toEqual(expectedRouterData); - }); - }); -});