Skip to content

Commit

Permalink
chore: updating docs & adding UT
Browse files Browse the repository at this point in the history
  • Loading branch information
rudrateja-clickup committed Jan 25, 2024
1 parent 1d9742f commit c6248d0
Show file tree
Hide file tree
Showing 3 changed files with 138 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/cdk-diff/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,21 @@ Details follow.
+ oidcRoleArn: `arn:aws:iam::${core.Environment.usQa.account}:role/${name}-github-actions-role`,
+ labelToApplyWhenNoDiffPresent: 'no-changes-qa',
+ stackSearchString: 'Qa',
roleDuration: 1800, // Set this value to a desired value only if the diff workflow is expected to take longer than 900 seconds.
+ },
+ {
+ name: 'staging',
+ oidcRoleArn: `arn:aws:iam::${core.Environment.globalStaging.account}:role/${name}-github-actions-role`,
+ labelToApplyWhenNoDiffPresent: 'no-changes-staging',
+ stackSearchString: 'Staging',
roleDuration: 1800, // Set this value to a desired value only if the diff workflow is expected to take longer than 900 seconds.
+ },
+ {
+ name: 'prod',
+ oidcRoleArn: `arn:aws:iam::${core.Environment.globalProd.account}:role/${name}-github-actions-role`,
+ labelToApplyWhenNoDiffPresent: 'no-changes-prod',
+ stackSearchString: 'Prod',
roleDuration: 1800, // Set this value to a desired value only if the diff workflow is expected to take longer than 900 seconds.
+ },
+ ],
+ createOidcRoleStack: true,
Expand Down
114 changes: 114 additions & 0 deletions test/__snapshots__/cdk-diff-workflow.test.ts.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions test/cdk-diff-workflow.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,27 @@ describe('addCdkDiffWorkflowYml - cdk diff.yml file added', () => {
expect(synth['.github/workflows/cdk-diff.yml']).toMatchSnapshot();
});

test('diff with roleDuration value set', () => {
const project = new clickupCdk.ClickUpCdkTypeScriptApp({
cdkVersion: '2.91.0',
defaultReleaseBranch: 'main',
name: 'test',
});
cdkDiffWorkflow.addCdkDiffWorkflowYml(project, {
envsToDiff: [
{
name: 'qa',
oidcRoleArn: 'arn:aws:iam::123456789012:role/squad-github-actions-oidc-role-name-qa',
labelToApplyWhenNoDiffPresent: 'qa-no-changes',
stackSearchString: 'Qa',
roleDuration: 1800,
},
],
});
const synth = Testing.synth(project);
expect(synth['.github/workflows/cdk-diff.yml']).toMatchSnapshot();
});

test('node20', () => {
const project = new clickupCdk.ClickUpCdkTypeScriptApp({
cdkVersion: '2.91.0',
Expand Down

0 comments on commit c6248d0

Please sign in to comment.