Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(INT-562): update component test suite #2744

Merged
merged 27 commits into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
30a1764
component tests(chore): update component test data
Sanjay-Veernala Oct 18, 2023
49d702d
componentTestSuite(chore): remove unwanted files
Sanjay-Veernala Oct 23, 2023
3a2b249
Merge branch 'develop' of github.com:rudderlabs/rudder-transformer in…
Oct 23, 2023
9ce3eca
chore: clean-up un-used tests
Oct 24, 2023
095a563
chore: clean-up vero tests
Oct 24, 2023
49e21bc
fix: snapchat tests, remove unnecessary tests for snapchat
Oct 24, 2023
852387b
Merge branch 'develop' of github.com:rudderlabs/rudder-transformer in…
Oct 24, 2023
4dd9103
Merge branch 'develop' of github.com:rudderlabs/rudder-transformer in…
Oct 25, 2023
eec51f5
fix: data-delivery component tests for salesforce
Oct 26, 2023
9f2780a
fix: remove salesforce from original proxy tests & correct the migrat…
Oct 26, 2023
ce68813
Merge branch 'develop' of github.com:rudderlabs/rudder-transformer in…
Oct 26, 2023
bcd31af
migrate marketo-proxy tests to component tests
utsabc Oct 26, 2023
a542c80
chore: migrate proxy tests to component tests (#2770)
utsabc Oct 26, 2023
48e40b3
chore: migrating intercom, braze, marketo_static_list, snapchat_custo…
Oct 26, 2023
3ed965d
fix: move tiktok_ads data-delivery tests to component test suite
Oct 26, 2023
a6ec298
fix: mock clone
Oct 26, 2023
a877a3c
chore: decreasing the code-coverage to 75%
Oct 26, 2023
37fb091
chore: moving am to component test suite to cover generic handler tests
Oct 27, 2023
d53eec9
chore: remove proxy.test
Oct 27, 2023
ce25191
chore: clean-up braze mocks, un-comment twitter_ads processor test-cases
Oct 27, 2023
d118c34
chore: add router component tests for tiktok offline events
Oct 27, 2023
012635c
fix: salesforce router test-case format for router component tests
Oct 27, 2023
e0594ad
fix: tiktok_ads router test-case format in component tests
Oct 27, 2023
48303e3
fix: vero, splitio router test-case format in component tests
Oct 27, 2023
7f618b4
chore: move back threshold for coverage to 80
Oct 27, 2023
20de3f0
chore: move threshold for coverage to 75
Oct 27, 2023
2a08ca9
chore: updated test case descriptions
krishna2020 Oct 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/v0/destinations/clevertap/transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ const processRouterDest = (inputs, reqMetadata) => {
batchedEvents.forEach((batch) => {
const batchedRequest = generateClevertapBatchedPayload(batch.events, batch.destination);
batchResponseList.push(
getSuccessRespEvents(batchedRequest, batch.metadata, batch.destination)
getSuccessRespEvents(batchedRequest, batch.metadata, batch.destination),
);
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/v0/destinations/hs/HSTransform-v1.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const processLegacyIdentify = async (message, destination, propertyMap) => {
)}/${hsSearchId}`;
response.method = defaultPatchRequestConfig.requestMethod;
}

traits = await populateTraits(propertyMap, traits, destination);
response.body.JSON = removeUndefinedAndNullValues({ properties: traits });
response.source = 'rETL';
Expand Down
38 changes: 20 additions & 18 deletions src/v0/destinations/hs/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,16 @@ const validatePayloadDataTypes = (propertyMap, hsSupportedKey, value, traitsKey)

if (propertyMap[hsSupportedKey] === 'bool' && typeof propValue === 'object') {
throw new InstrumentationError(
`Property ${traitsKey} data type ${typeof propValue} is not matching with Hubspot property data type ${propertyMap[hsSupportedKey]
`Property ${traitsKey} data type ${typeof propValue} is not matching with Hubspot property data type ${
propertyMap[hsSupportedKey]
}`,
);
}

if (propertyMap[hsSupportedKey] === 'number' && typeof propValue !== 'number') {
throw new InstrumentationError(
`Property ${traitsKey} data type ${typeof propValue} is not matching with Hubspot property data type ${propertyMap[hsSupportedKey]
`Property ${traitsKey} data type ${typeof propValue} is not matching with Hubspot property data type ${
propertyMap[hsSupportedKey]
}`,
);
}
Expand All @@ -175,15 +177,15 @@ const validatePayloadDataTypes = (propertyMap, hsSupportedKey, value, traitsKey)

/**
* Converts date to UTC Midnight TimeStamp
* @param {*} propValue
* @returns
* @param {*} propValue
* @returns
*/
const getUTCMidnightTimeStampValue = (propValue) => {
const time = propValue;
const date = new Date(time);
date.setUTCHours(0, 0, 0, 0);
return date.getTime();
}
};

/**
* add addtional properties in the payload that is provided in traits
Expand Down Expand Up @@ -532,15 +534,15 @@ const getExistingData = async (inputs, destination) => {
searchResponse =
Config.authorizationType === 'newPrivateAppApi'
? await httpPOST(url, requestData, requestOptions, {
destType: 'hs',
feature: 'transformation',
endpointPath,
})
destType: 'hs',
feature: 'transformation',
endpointPath,
})
: await httpPOST(url, requestData, {
destType: 'hs',
feature: 'transformation',
endpointPath,
});
destType: 'hs',
feature: 'transformation',
endpointPath,
});
searchResponse = processAxiosResponse(searchResponse);

if (searchResponse.status !== 200) {
Expand Down Expand Up @@ -637,9 +639,9 @@ const getHsSearchId = (message) => {

/**
* returns updated traits
* @param {*} propertyMap
* @param {*} traits
* @param {*} destination
* @param {*} propertyMap
* @param {*} traits
* @param {*} destination
*/
const populateTraits = async (propertyMap, traits, destination) => {
const populatedTraits = traits;
Expand All @@ -655,10 +657,10 @@ const populateTraits = async (propertyMap, traits, destination) => {
if (propertyToTypeMap[key] === 'date') {
populatedTraits[key] = getUTCMidnightTimeStampValue(value);
}
})
});

return populatedTraits;
}
};

module.exports = {
validateDestinationConfig,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,90 +1,90 @@
[
{
"destKey": "description",
"sourceKeys": "properties.description",
"required": false
},
{
"destKey": "brands",
"sourceKeys": "properties.brands",
"required": false,
"metadata": {
"type": "IsArray"
}
},
{
"destKey": "event_tag",
"sourceKeys": "properties.event_tag",
"required": false
},
{
"destKey": "click_id",
"sourceKeys": "properties.click_id",
"required": false
},
{
"destKey": "level",
"sourceKeys": "properties.level",
"required": false
},
{
"destKey": "uuid_c1",
"sourceKeys": "properties.uuid_c1",
"required": false
},
{
"destKey": "customer_status",
"sourceKeys": "properties.customer_status",
"required": false
},
{
"destKey": "data",
"sourceKeys": "properties.data",
"required": false
},
{
"destKey": "att_status",
"sourceKeys": "properties.att_status",
"required": false
},
{
"destKey": "sign_up_method",
"sourceKeys": "properties.sign_up_method",
"required": false
},
{
"destKey": "advertiser_cookie_1",
"sourceKeys": "properties.advertiser_cookie_1",
"required": false
},
{
"destKey": "delivery_method",
"sourceKeys": "properties.delivery_method",
"required": false
},
{
"sourceKeys": "context.device.model",
"destKey": "device_model",
"required": false
},
{
"sourceKeys": "country",
"destKey": "country",
"sourceFromGenericMap": true,
"required": false
},
{
"sourceKeys": "region",
"destKey": "region",
"sourceFromGenericMap": true,
"required": false
},
{
"sourceKeys": "context.userAgent",
"destKey": "user_agent",
"metadata": {
"type": "toLower"
},
"required": false
{
"destKey": "description",
"sourceKeys": "properties.description",
"required": false
},
{
"destKey": "brands",
"sourceKeys": "properties.brands",
"required": false,
"metadata": {
"type": "IsArray"
}
]
},
{
"destKey": "event_tag",
"sourceKeys": "properties.event_tag",
"required": false
},
{
"destKey": "click_id",
"sourceKeys": "properties.click_id",
"required": false
},
{
"destKey": "level",
"sourceKeys": "properties.level",
"required": false
},
{
"destKey": "uuid_c1",
"sourceKeys": "properties.uuid_c1",
"required": false
},
{
"destKey": "customer_status",
"sourceKeys": "properties.customer_status",
"required": false
},
{
"destKey": "data",
"sourceKeys": "properties.data",
"required": false
},
{
"destKey": "att_status",
"sourceKeys": "properties.att_status",
"required": false
},
{
"destKey": "sign_up_method",
"sourceKeys": "properties.sign_up_method",
"required": false
},
{
"destKey": "advertiser_cookie_1",
"sourceKeys": "properties.advertiser_cookie_1",
"required": false
},
{
"destKey": "delivery_method",
"sourceKeys": "properties.delivery_method",
"required": false
},
{
"sourceKeys": "context.device.model",
"destKey": "device_model",
"required": false
},
{
"sourceKeys": "country",
"destKey": "country",
"sourceFromGenericMap": true,
"required": false
},
{
"sourceKeys": "region",
"destKey": "region",
"sourceFromGenericMap": true,
"required": false
},
{
"sourceKeys": "context.userAgent",
"destKey": "user_agent",
"metadata": {
"type": "toLower"
},
"required": false
}
]
2 changes: 1 addition & 1 deletion src/v0/destinations/snapchat_conversion/transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -397,4 +397,4 @@ const processRouterDest = async (inputs, reqMetadata) => {
return [...batchResponseList, ...errorRespList];
};

module.exports = { process, processRouterDest };
module.exports = { process, processRouterDest };
2 changes: 1 addition & 1 deletion test/__tests__/data/hs_router_rETL_output.json
Original file line number Diff line number Diff line change
Expand Up @@ -228,4 +228,4 @@
"isProcessorEnabled": true
}
}
]
]
Loading
Loading