-
Notifications
You must be signed in to change notification settings - Fork 5
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
Added tests for CDK #22
Conversation
Signed-off-by: Brandon Shien <[email protected]>
Signed-off-by: Prudhvi Godithi <[email protected]> Rebase to add DCO
Signed-off-by: Prudhvi Godithi <[email protected]> Signed-off-by: Brandon Shien <[email protected]>
Signed-off-by: Prudhvi Godithi <[email protected]> Rebase for add endpoint for Cognito and enable WAF
Signed-off-by: Brandon Shien <[email protected]>
Signed-off-by: Brandon Shien <[email protected]>
@@ -16,6 +16,7 @@ jobs: | |||
|
|||
- name: Run CDK Test | |||
run: | | |||
./gradlew clean build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You dont need ./gradlew clean build
for CDK tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fairly sure it was failing just now before I added it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me try
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see now, you have a new test added test/workflow-stack.test.ts
that asserts for opensearch-metrics-1.0.zip
which is only created when called ./gradlew clean build
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, I wasn't asserting for the file but once that object is created something eventually depends on that zip.
@bshien please update the PR to a better title that can justify the contribution. |
Signed-off-by: Brandon Shien <[email protected]>
Signed-off-by: Brandon Shien <[email protected]>
}); | ||
const hostedZoneStackTemplate = Template.fromStack(hostedZoneStack); | ||
hostedZoneStackTemplate.resourceCountIs('AWS::Route53::HostedZone', 1); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add more assertions if the hosted zone is created as metrics.login.opensearch.org
and metrics.opensearch.org
. Try asserting if an a
record is created or not as well
hostedZone: Project.METRICS_HOSTED_ZONE, | ||
appName: "OpenSearchMetrics" | ||
}); | ||
const stack = new OpenSearchMetricsNginxReadonly(app, 'Test-OpenSearchMetricsNginxReadonly', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add more assertions for Nginx in class OpenSearchMetricsNginxCognito
from opensearchNginxProxyCognito.ts
.
@@ -27,4 +21,7 @@ test('OpenSearchDomain Stack Test', () => { | |||
}); | |||
const openSearchDomainStackTemplate = Template.fromStack(openSearchDomainStack); | |||
openSearchDomainStackTemplate.resourceCountIs('AWS::IAM::Role', 8); | |||
openSearchDomainStackTemplate.resourceCountIs('AWS::Cognito::UserPool', 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you assert if the userpool has the right authenticated and un-authenticated role? also assert for created admin group.
lambdaPackage: Project.LAMBDA_PACKAGE | ||
}); | ||
const template = Template.fromStack(OpenSearchMetricsWorkflow); | ||
template.resourceCountIs('AWS::Lambda::Function', 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you assert what the lambda handler is ? add more assertions related to step functions as well.
Signed-off-by: Brandon Shien <[email protected]>
Signed-off-by: Brandon Shien <[email protected]>
Signed-off-by: Brandon Shien <[email protected]>
Signed-off-by: Brandon Shien <[email protected]>
Closing this favor of #24. |
Description
Describe what this change achieves.
Created/added to tests for CDK
Issues Resolved
List any issues this PR will resolve, e.g. Closes [...].
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.