Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 0 additions & 26 deletions tests/integration/deploy/test_deploy_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -1197,29 +1197,3 @@ def test_deploy_logs_warning_with_cdk_project(self):
deploy_process_execute = run_command(deploy_command_list)
self.assertIn(warning_message, deploy_process_execute.stdout)
self.assertEqual(deploy_process_execute.process.returncode, 0)

def _method_to_stack_name(self, method_name):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we don't need this anymore?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above, why do we delete these methods?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is already in package's base class, this is a duplicate and missed imports caused some failures

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I refactored these methods to be shared together by sync and deploy through package base

"""Method expects method name which can be a full path. Eg: test.integration.test_deploy_command.method_name"""
method_name = method_name.split(".")[-1]
return f"{method_name.replace('_', '-')}-{CFN_PYTHON_VERSION_SUFFIX}"

def _stack_name_to_companion_stack(self, stack_name):
return CompanionStack(stack_name).stack_name

def _delete_companion_stack(self, cfn_client, ecr_client, companion_stack_name):
repos = list()
try:
cfn_client.describe_stacks(StackName=companion_stack_name)
except ClientError:
return
stack = boto3.resource("cloudformation").Stack(companion_stack_name)
resources = stack.resource_summaries.all()
for resource in resources:
if resource.resource_type == "AWS::ECR::Repository":
repos.append(resource.physical_resource_id)
for repo in repos:
try:
ecr_client.delete_repository(repositoryName=repo, force=True)
except ecr_client.exceptions.RepositoryNotFoundException:
pass
cfn_client.delete_stack(StackName=companion_stack_name)
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ source "https://rubygems.org"

gem "ruby-statistics"

ruby '~> 2.7.0'
ruby '~> 2.5.0'
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
source "https://rubygems.org"

ruby '~> 2.7.0'
ruby '~> 2.5.0'
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ source "https://rubygems.org"

gem "ruby-statistics"

ruby '~> 2.7.0'
ruby '~> 2.5.0'
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
source "https://rubygems.org"

ruby '~> 2.7.0'
ruby '~> 2.5.0'
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Resources:
AutoPublishAlias: Hello1Alias
CodeUri: after/Ruby/function/
Handler: app.lambda_handler
Runtime: ruby2.7
Runtime: ruby2.5
Architectures:
- x86_64
Layers:
Expand All @@ -25,6 +25,6 @@ Resources:
Description: Hello World Ruby Layer
ContentUri: after/Ruby/layer/
CompatibleRuntimes:
- ruby2.7
- ruby2.5
Metadata:
BuildMethod: ruby2.7
BuildMethod: ruby2.5
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Resources:
AutoPublishAlias: Hello1Alias
CodeUri: before/Ruby/function/
Handler: app.lambda_handler
Runtime: ruby2.7
Runtime: ruby2.5
Architectures:
- x86_64
Layers:
Expand All @@ -25,6 +25,6 @@ Resources:
Description: Hello World Ruby Layer
ContentUri: before/Ruby/layer/
CompatibleRuntimes:
- ruby2.7
- ruby2.5
Metadata:
BuildMethod: ruby2.7
BuildMethod: ruby2.5