From 191bba748912cc4bc79dcf86d1d330687841528e Mon Sep 17 00:00:00 2001 From: Sai Sankeerth Date: Fri, 29 Sep 2023 11:28:29 +0530 Subject: [PATCH] fix: remove unnecessary gcf data.ts & fix error messages for FB Signed-off-by: Sai Sankeerth --- .../destinations/fb/processor/data.ts | 5 +- .../destinations/fb/router/data.ts | 3 +- .../google_cloud_function/data.ts | 260 ------------------ 3 files changed, 5 insertions(+), 263 deletions(-) delete mode 100644 test/integrations/destinations/google_cloud_function/data.ts diff --git a/test/integrations/destinations/fb/processor/data.ts b/test/integrations/destinations/fb/processor/data.ts index 2269608888..9b57f3ef78 100644 --- a/test/integrations/destinations/fb/processor/data.ts +++ b/test/integrations/destinations/fb/processor/data.ts @@ -285,7 +285,8 @@ export const data = [ status: 200, body: [ { - error: '{"product_id":123} is not of valid type', + error: + 'Value of properties.products.sub.product_id is not of valid type. It should be of type string', statTags: { destType: 'FB', errorCategory: 'dataValidation', @@ -436,7 +437,7 @@ export const data = [ status: 200, body: [ { - error: 'properties.revenue is not of valid type', + error: 'Value of properties.revenue is not of valid type. It should be of type number', statTags: { destType: 'FB', errorCategory: 'dataValidation', diff --git a/test/integrations/destinations/fb/router/data.ts b/test/integrations/destinations/fb/router/data.ts index 8c459a53a5..4daefad141 100644 --- a/test/integrations/destinations/fb/router/data.ts +++ b/test/integrations/destinations/fb/router/data.ts @@ -306,7 +306,8 @@ export const data = [ }, batched: false, statusCode: 400, - error: '{"product_id":123} is not of valid type', + error: + 'Value of properties.products.sub.product_id is not of valid type. It should be of type string', }, ], }, diff --git a/test/integrations/destinations/google_cloud_function/data.ts b/test/integrations/destinations/google_cloud_function/data.ts deleted file mode 100644 index 93f2954a80..0000000000 --- a/test/integrations/destinations/google_cloud_function/data.ts +++ /dev/null @@ -1,260 +0,0 @@ -export const data = [ - { - name: 'google_cloud_function', - description: 'Test 0', - feature: 'router', - module: 'destination', - version: 'v0', - input: { - request: { - body: { - input: [ - { - destination: { - Config: { - triggerType: 'Http', - apiKeyId: 'randomAPI', - enableBatchInput: true, - googleCloudFunctionUrl: - 'https://us-central1-big-query-integration-poc.cloudfunctions.net/rohitv1', - 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/rohitv1', - 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', - }, - }, - ], - destType: 'google_cloud_function', - }, - }, - }, - output: { - response: { - status: 200, - body: { - output: [ - { - batchedRequest: { - version: '1', - type: 'REST', - method: 'POST', - endpoint: - 'https://us-central1-big-query-integration-poc.cloudfunctions.net/rohitv1', - 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/rohitv1', - 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: { - "destType": "GOOGLE_CLOUD_FUNCTION", - errorCategory: 'dataValidation', - errorType: 'configuration', - "feature": "router", - "implementation": "native", - "module": "destination", - }, - }, - ], - }, - }, - }, - }, -];