-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: onboard algolia destination to cdk 2.0 (#1474)
* feat: onboard algolia to cdk 2.0 * fix: use the dependent modules from v0 destination * feat: add router workflow * feat: error handling added to router transform handler * refactor: remove redundant code * refactor: router transform workflow * Fix jsonata single element array issue * Fix versionedRouter.js * Fix versionedRouter to handle when RT dest is supported * Add live compare test versionedRouter test files * Fix PR comments * Upgrade rudder-workflow-engine * Refactor handleCDKV2 to processCdkV2Workflow Co-authored-by: Dilip Kumar Kola <dilipkola@rudderstack.com> Co-authored-by: Dilip Kola <33080863+koladilip@users.noreply.github.com>
- Loading branch information
1 parent
00d16a3
commit e716d84
Showing
21 changed files
with
1,695 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
const fs = require("fs"); | ||
const path = require("path"); | ||
const { TRANSFORMER_METRIC } = require("../v0/util/constant"); | ||
const { processCdkV2Workflow } = require("../cdk/v2/handler"); | ||
|
||
const integration = "algolia"; | ||
const name = "Algolia"; | ||
|
||
const inputDataFile = fs.readFileSync( | ||
path.resolve(__dirname, `./data/${integration}_input.json`) | ||
); | ||
const outputDataFile = fs.readFileSync( | ||
path.resolve(__dirname, `./data/${integration}_output.json`) | ||
); | ||
const inputData = JSON.parse(inputDataFile); | ||
const expectedData = JSON.parse(outputDataFile); | ||
|
||
describe(`${name} Tests`, () => { | ||
describe("Processor Tests", () => { | ||
inputData.forEach((input, index) => { | ||
it(`${name} - payload: ${index}`, async () => { | ||
const expected = expectedData[index]; | ||
try { | ||
const output = await processCdkV2Workflow( | ||
integration, | ||
input, | ||
TRANSFORMER_METRIC.ERROR_AT.PROC | ||
); | ||
expect(output).toEqual(expected); | ||
} catch (error) { | ||
expect(error.message).toEqual(expected.message); | ||
} | ||
}); | ||
}); | ||
}); | ||
|
||
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("Router Tests", () => { | ||
inputRouterData.forEach((input, index) => { | ||
it(`${name} - payload: ${index}`, async () => { | ||
const expected = expectedRouterData[index]; | ||
try { | ||
const output = await processCdkV2Workflow( | ||
integration, | ||
input, | ||
TRANSFORMER_METRIC.ERROR_AT.RT | ||
); | ||
expect(output).toEqual(expected); | ||
} catch (error) { | ||
// console.log(error); | ||
expect(error.message).toEqual(expected.message); | ||
} | ||
}); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
[ | ||
[ | ||
{ | ||
"message": { | ||
"type": "track", | ||
|
@@ -251,5 +252,8 @@ | |
"IsProcessorEnabled": true | ||
} | ||
} | ||
] | ||
], | ||
[], | ||
{} | ||
] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.