Skip to content

Commit

Permalink
Reduce noise in CDK template snapshots (#1649)
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronMoat authored Sep 6, 2024
1 parent 3f41357 commit 92b669e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ exports[`returns expected CloudFormation stack for dev 1`] = `
"Tags": [
{
"Key": "aws-codedeploy-hooks",
"Value": "2.1.1-8a9d620b7ff7fbe76112f7c96c06f51e36bb2cb3",
"Value": "x.x.x-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
},
],
"Timeout": 30,
Expand Down Expand Up @@ -321,7 +321,7 @@ exports[`returns expected CloudFormation stack for dev 1`] = `
"Tags": [
{
"Key": "aws-codedeploy-hooks",
"Value": "2.1.1-8a9d620b7ff7fbe76112f7c96c06f51e36bb2cb3",
"Value": "x.x.x-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
},
],
},
Expand Down Expand Up @@ -352,7 +352,7 @@ exports[`returns expected CloudFormation stack for dev 1`] = `
"Tags": [
{
"Key": "aws-codedeploy-hooks",
"Value": "2.1.1-8a9d620b7ff7fbe76112f7c96c06f51e36bb2cb3",
"Value": "x.x.x-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
},
],
},
Expand Down Expand Up @@ -389,7 +389,7 @@ exports[`returns expected CloudFormation stack for dev 1`] = `
"Tags": [
{
"Key": "aws-codedeploy-hooks",
"Value": "2.1.1-8a9d620b7ff7fbe76112f7c96c06f51e36bb2cb3",
"Value": "x.x.x-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
},
],
},
Expand Down Expand Up @@ -534,7 +534,7 @@ exports[`returns expected CloudFormation stack for dev 1`] = `
"Tags": [
{
"Key": "aws-codedeploy-hooks",
"Value": "2.1.1-8a9d620b7ff7fbe76112f7c96c06f51e36bb2cb3",
"Value": "x.x.x-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
},
],
},
Expand Down Expand Up @@ -885,7 +885,7 @@ exports[`returns expected CloudFormation stack for prod 1`] = `
"Tags": [
{
"Key": "aws-codedeploy-hooks",
"Value": "2.1.1-8a9d620b7ff7fbe76112f7c96c06f51e36bb2cb3",
"Value": "x.x.x-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
},
],
"Timeout": 30,
Expand Down Expand Up @@ -1024,7 +1024,7 @@ exports[`returns expected CloudFormation stack for prod 1`] = `
"Tags": [
{
"Key": "aws-codedeploy-hooks",
"Value": "2.1.1-8a9d620b7ff7fbe76112f7c96c06f51e36bb2cb3",
"Value": "x.x.x-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
},
],
},
Expand Down Expand Up @@ -1055,7 +1055,7 @@ exports[`returns expected CloudFormation stack for prod 1`] = `
"Tags": [
{
"Key": "aws-codedeploy-hooks",
"Value": "2.1.1-8a9d620b7ff7fbe76112f7c96c06f51e36bb2cb3",
"Value": "x.x.x-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
},
],
},
Expand Down Expand Up @@ -1092,7 +1092,7 @@ exports[`returns expected CloudFormation stack for prod 1`] = `
"Tags": [
{
"Key": "aws-codedeploy-hooks",
"Value": "2.1.1-8a9d620b7ff7fbe76112f7c96c06f51e36bb2cb3",
"Value": "x.x.x-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
},
],
},
Expand Down Expand Up @@ -1237,7 +1237,7 @@ exports[`returns expected CloudFormation stack for prod 1`] = `
"Tags": [
{
"Key": "aws-codedeploy-hooks",
"Value": "2.1.1-8a9d620b7ff7fbe76112f7c96c06f51e36bb2cb3",
"Value": "x.x.x-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
},
],
},
Expand Down
5 changes: 4 additions & 1 deletion template/lambda-sqs-worker-cdk/infra/appStack.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,11 @@ it.each(['dev', 'prod'])(
.replaceAll(
/workerCurrentVersion([0-9a-zA-Z]+)"/g,
(_, hash) => `workerCurrentVersion${'x'.repeat(hash.length)}"`,
)
.replaceAll(
/"Value":"\d+\.\d+\.\d+-([^"]+)"/g,
(_, hash) => `"Value": "x.x.x-${'x'.repeat(hash.length)}"`,
);

expect(JSON.parse(json)).toMatchSnapshot();
},
);

0 comments on commit 92b669e

Please sign in to comment.