-
Notifications
You must be signed in to change notification settings - Fork 249
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
chore(all): reduce cognitive complexity #1009
Conversation
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
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.
Great addition of tests and clean up.
const containerName = "custom-container-name"; | ||
const serviceName = "custom-service-name"; | ||
const familyName = "custom-family-name"; | ||
|
||
const props: FargateToKinesisStreamsProps = { | ||
publicApi, | ||
ecrRepositoryArn: defaults.fakeEcrRepoArn, | ||
clusterProps: { clusterName }, | ||
containerDefinitionProps: { containerName }, | ||
fargateTaskDefinitionProps: { family: familyName }, | ||
fargateServiceProps: { serviceName }, | ||
existingVpc: defaults.getTestVpc(stack), | ||
vpcProps: { }, | ||
}; |
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.
This code is duplicated in many tests. May be worth creating a function that takes in stack
and returns this props object?
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.
Hmm.... Now I see below that its the same fargate-based params, but the other service making up the construct is in there too. Perhaps still creating the default set of fargate props and passing them to the construct props object with a ...fargateProps
call?
Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.