Skip to content

Commit

Permalink
chore: refactor repititions
Browse files Browse the repository at this point in the history
  • Loading branch information
yashasvibajpai committed Mar 11, 2024
1 parent fdea6f1 commit c99f646
Showing 1 changed file with 31 additions and 119 deletions.
150 changes: 31 additions & 119 deletions test/integrations/destinations/marketo/dataDelivery/other.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,26 @@ import { ProxyV1TestData } from '../../../testTypes';
import { generateProxyV1Payload } from '../../../testUtils';

const statTags = {
destType: 'MARKETO',
destinationId: 'default-destinationId',
errorCategory: 'network',
errorType: 'aborted',
feature: 'dataDelivery',
implementation: 'native',
module: 'destination',
workspaceId: 'default-workspaceId',
aborted: {
destType: 'MARKETO',
destinationId: 'default-destinationId',
errorCategory: 'network',
errorType: 'aborted',
feature: 'dataDelivery',
implementation: 'native',
module: 'destination',
workspaceId: 'default-workspaceId',
},
retryable: {
errorCategory: 'network',
errorType: 'retryable',
destType: 'MARKETO',
module: 'destination',
implementation: 'native',
feature: 'dataDelivery',
destinationId: 'default-destinationId',
workspaceId: 'default-workspaceId',
},
};

const metadata = {
Expand Down Expand Up @@ -54,30 +66,10 @@ export const otheMarketoScenariosV1: ProxyV1TestData[] = [
error:
'{"error":{"message":"Service Unavailable","description":"The server is currently unable to handle the request due to temporary overloading or maintenance of the server. Please try again later."}}',
statusCode: 503,
metadata: {
jobId: 1,
attemptNum: 1,
userId: 'default-userId',
destinationId: 'default-destinationId',
workspaceId: 'default-workspaceId',
sourceId: 'default-sourceId',
secret: {
accessToken: 'default-accessToken',
},
dontBatch: false,
},
metadata,
},
],
statTags: {
errorCategory: 'network',
errorType: 'retryable',
destType: 'MARKETO',
module: 'destination',
implementation: 'native',
feature: 'dataDelivery',
destinationId: 'default-destinationId',
workspaceId: 'default-workspaceId',
},
statTags: statTags.retryable,
message: 'Request failed with status: 503',
status: 503,
},
Expand Down Expand Up @@ -111,30 +103,10 @@ export const otheMarketoScenariosV1: ProxyV1TestData[] = [
{
error: '"Internal Server Error"',
statusCode: 500,
metadata: {
jobId: 1,
attemptNum: 1,
userId: 'default-userId',
destinationId: 'default-destinationId',
workspaceId: 'default-workspaceId',
sourceId: 'default-sourceId',
secret: {
accessToken: 'default-accessToken',
},
dontBatch: false,
},
metadata,
},
],
statTags: {
errorCategory: 'network',
errorType: 'retryable',
destType: 'MARKETO',
module: 'destination',
implementation: 'native',
feature: 'dataDelivery',
destinationId: 'default-destinationId',
workspaceId: 'default-workspaceId',
},
statTags: statTags.retryable,
message: 'Request failed with status: 500',
status: 500,
},
Expand Down Expand Up @@ -168,30 +140,10 @@ export const otheMarketoScenariosV1: ProxyV1TestData[] = [
{
error: '"Gateway Timeout"',
statusCode: 504,
metadata: {
jobId: 1,
attemptNum: 1,
userId: 'default-userId',
destinationId: 'default-destinationId',
workspaceId: 'default-workspaceId',
sourceId: 'default-sourceId',
secret: {
accessToken: 'default-accessToken',
},
dontBatch: false,
},
metadata,
},
],
statTags: {
errorCategory: 'network',
errorType: 'retryable',
destType: 'MARKETO',
module: 'destination',
implementation: 'native',
feature: 'dataDelivery',
destinationId: 'default-destinationId',
workspaceId: 'default-workspaceId',
},
statTags: statTags.retryable,
message: 'Request failed with status: 504',
status: 504,
},
Expand Down Expand Up @@ -225,30 +177,10 @@ export const otheMarketoScenariosV1: ProxyV1TestData[] = [
{
error: '""',
statusCode: 500,
metadata: {
jobId: 1,
attemptNum: 1,
userId: 'default-userId',
destinationId: 'default-destinationId',
workspaceId: 'default-workspaceId',
sourceId: 'default-sourceId',
secret: {
accessToken: 'default-accessToken',
},
dontBatch: false,
},
metadata,
},
],
statTags: {
errorCategory: 'network',
errorType: 'retryable',
destType: 'MARKETO',
module: 'destination',
implementation: 'native',
feature: 'dataDelivery',
destinationId: 'default-destinationId',
workspaceId: 'default-workspaceId',
},
statTags: statTags.retryable,
message: 'Request failed with status: 500',
status: 500,
},
Expand Down Expand Up @@ -283,30 +215,10 @@ export const otheMarketoScenariosV1: ProxyV1TestData[] = [
{
error: '""',
statusCode: 500,
metadata: {
jobId: 1,
attemptNum: 1,
userId: 'default-userId',
destinationId: 'default-destinationId',
workspaceId: 'default-workspaceId',
sourceId: 'default-sourceId',
secret: {
accessToken: 'default-accessToken',
},
dontBatch: false,
},
metadata,
},
],
statTags: {
errorCategory: 'network',
errorType: 'retryable',
destType: 'MARKETO',
module: 'destination',
implementation: 'native',
feature: 'dataDelivery',
destinationId: 'default-destinationId',
workspaceId: 'default-workspaceId',
},
statTags: statTags.retryable,
message: 'Request failed with status: 500',
status: 500,
},
Expand Down Expand Up @@ -337,7 +249,7 @@ export const otheMarketoScenariosV1: ProxyV1TestData[] = [
body: {
output: {
status: 400,
statTags,
statTags: statTags.aborted,
message: 'Request failed with status: 400',
response: [
{
Expand Down

0 comments on commit c99f646

Please sign in to comment.