Skip to content
This repository was archived by the owner on Jan 31, 2024. It is now read-only.

Commit e0bf64e

Browse files
feat(synchecks): adding userId to CloudWatchSynthetics (#1092)
1 parent db9d2b9 commit e0bf64e

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

src/pocket/PocketCloudwatchSynthetics.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const testConfig: PocketAwsSyntheticCheckProps = {
1010
query: [
1111
{
1212
endpoint: 'acme.getpocket.dev',
13+
userId: '1',
1314
data: '{"query": "query { someGraphQlQuery(arg1: \\"1\\", arg2: \\"1\\") {returnedAttr} }"}',
1415
jmespath: 'errors[0].message',
1516
response: 'Error - Not Found: A resource by that arg1 could not be found',

src/pocket/PocketCloudwatchSynthetics.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { Construct } from 'constructs';
1919
*/
2020
interface PocketAwsSyntheticQueryConfig {
2121
data?: string;
22+
userId?: string;
2223
endpoint?: string;
2324
jmespath?: string;
2425
response?: string;
@@ -276,6 +277,7 @@ export class PocketAwsSyntheticChecks extends Construct {
276277
runConfig: {
277278
environmentVariables: {
278279
GRAPHQL_ENDPOINT: queryConfig.endpoint,
280+
GRAPHQL_USERID: queryConfig.userId,
279281
GRAPHQL_JMESPATH: queryConfig.jmespath,
280282
GRAPHQL_QUERY: queryConfig.data,
281283
GRAPHQL_RESPONSE: queryConfig.response,

src/pocket/__snapshots__/PocketCloudwatchSynthetics.spec.ts.snap

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,8 @@ exports[`Pocket Cloudwatch Synthetics adds optional Alarms & Alarm Actions to Sy
199199
"GRAPHQL_ENDPOINT": "acme.getpocket.dev",
200200
"GRAPHQL_JMESPATH": "errors[0].message",
201201
"GRAPHQL_QUERY": "{\\"query\\": \\"query { someGraphQlQuery(arg1: \\\\\\"1\\\\\\", arg2: \\\\\\"1\\\\\\") {returnedAttr} }\\"}",
202-
"GRAPHQL_RESPONSE": "Error - Not Found: A resource by that arg1 could not be found"
202+
"GRAPHQL_RESPONSE": "Error - Not Found: A resource by that arg1 could not be found",
203+
"GRAPHQL_USERID": "1"
203204
},
204205
"timeout_in_seconds": 180
205206
},
@@ -429,7 +430,8 @@ exports[`Pocket Cloudwatch Synthetics renders desired AWS Synthetic Checks 1`] =
429430
"GRAPHQL_ENDPOINT": "acme.getpocket.dev",
430431
"GRAPHQL_JMESPATH": "errors[0].message",
431432
"GRAPHQL_QUERY": "{\\"query\\": \\"query { someGraphQlQuery(arg1: \\\\\\"1\\\\\\", arg2: \\\\\\"1\\\\\\") {returnedAttr} }\\"}",
432-
"GRAPHQL_RESPONSE": "Error - Not Found: A resource by that arg1 could not be found"
433+
"GRAPHQL_RESPONSE": "Error - Not Found: A resource by that arg1 could not be found",
434+
"GRAPHQL_USERID": "1"
433435
},
434436
"timeout_in_seconds": 180
435437
},

0 commit comments

Comments
 (0)