-
Notifications
You must be signed in to change notification settings - Fork 2
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
refactor: DBTP-1630 - copilot environment domain tests #716
Conversation
) | ||
def test_copilot_templating_generate_generates_expected_manifest(self, mock_get_cert_arn): | ||
mock_file_provider = Mock() | ||
mock_file_provider.mkfile.return_value = "im a file provider!" |
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 mock return value is only needed to assert on the writing part, which isn't needed for this test
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.
Good spot lol
@@ -8,7 +8,7 @@ | |||
|
|||
|
|||
class CloudFormation: | |||
def __init__(self, cloudformation_client, iam_client, ssm_client): | |||
def __init__(self, cloudformation_client, iam_client=None, ssm_client=None): |
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.
Not sure I like being able to initialise this class with or without iam and ssm clients, though I see these clients are only needed for certain functionalities... maybe a better pattern here would be to pass in the session and then the clients can be created when needed. Something to return to when we consolidate the way we're handling boto3 stuff I guess. Maybe could add a TODO? Or at least we should raise an exception if one of the functions is called without the client being there? e.g. if we try CloudFormation(cloudformation_client).add_stack_delete_policy_to_task_role
# "dbt_platform_helper.domain.copilot_environment.get_https_listener_for_application", | ||
# return_value="https_listener_arn", | ||
# ) | ||
# def test_when_no_certificate_present(self, mock_get_https_listener_for_application): |
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.
are we removing this test?
Addresses DBTP-1630
Refactor of copilot environment domain to align with pattern set in Terraform environment.
Checklist:
Title:
Description:
- [ ] If the work includes user interface changes, before and after screenshots included in description- [ ] Includes any applicable changes to the documentation in this code base- [ ] Includes link(s) to any applicable changes to the documentation in the [DBT Platform Documentation](https://platform.readme.trade.gov.uk/) (can be to a pull request)Tasks:
https://eu-west-2.console.aws.amazon.com/codesuite/codepipeline/pipelines/pull-request-end-to-end-tests/executions/75c32204-2033-426f-b445-b6a079160221/visualization?region=eu-west-2