diff --git a/aws_lambda_builders/workflows/ruby_bundler/workflow.py b/aws_lambda_builders/workflows/ruby_bundler/workflow.py index 826d51fed..013c67dd7 100644 --- a/aws_lambda_builders/workflows/ruby_bundler/workflow.py +++ b/aws_lambda_builders/workflows/ruby_bundler/workflow.py @@ -21,7 +21,7 @@ class RubyBundlerWorkflow(BaseWorkflow): dependency_manager="bundler", application_framework=None) - EXCLUDED_FILES = (".aws-sam") + EXCLUDED_FILES = (".aws-sam", ".git") def __init__(self, source_dir, diff --git a/tests/integration/workflows/ruby_bundler/test_ruby.py b/tests/integration/workflows/ruby_bundler/test_ruby.py index b286cc8c8..5ed47e7f3 100644 --- a/tests/integration/workflows/ruby_bundler/test_ruby.py +++ b/tests/integration/workflows/ruby_bundler/test_ruby.py @@ -46,6 +46,15 @@ def test_builds_project_with_dependencies(self): output_files = set(os.listdir(self.artifacts_dir)) self.assertEquals(expected_files, output_files) + def test_builds_project_and_ignores_excluded_files(self): + source_dir = os.path.join(self.TEST_DATA_FOLDER, "excluded-files") + self.builder.build(source_dir, self.artifacts_dir, self.scratch_dir, + os.path.join(source_dir, "Gemfile"), + runtime=self.runtime) + expected_files = {"handler.rb", "Gemfile", "Gemfile.lock", ".bundle", "vendor"} + output_files = set(os.listdir(self.artifacts_dir)) + self.assertEquals(expected_files, output_files) + def test_fails_if_bundler_cannot_resolve_dependencies(self): source_dir = os.path.join(self.TEST_DATA_FOLDER, "broken-deps") with self.assertRaises(WorkflowFailedError) as ctx: diff --git a/tests/integration/workflows/ruby_bundler/testdata/excluded-files/.aws-sam/.keep b/tests/integration/workflows/ruby_bundler/testdata/excluded-files/.aws-sam/.keep new file mode 100644 index 000000000..e69de29bb diff --git a/tests/integration/workflows/ruby_bundler/testdata/excluded-files/Gemfile b/tests/integration/workflows/ruby_bundler/testdata/excluded-files/Gemfile new file mode 100644 index 000000000..5b48b7797 --- /dev/null +++ b/tests/integration/workflows/ruby_bundler/testdata/excluded-files/Gemfile @@ -0,0 +1,4 @@ +source 'https://rubygems.org' + +# This shouldn't even need to exist, that's a pending feature request. +# If no dependencies, leave blank. diff --git a/tests/integration/workflows/ruby_bundler/testdata/excluded-files/handler.rb b/tests/integration/workflows/ruby_bundler/testdata/excluded-files/handler.rb new file mode 100644 index 000000000..0093e4da1 --- /dev/null +++ b/tests/integration/workflows/ruby_bundler/testdata/excluded-files/handler.rb @@ -0,0 +1,3 @@ +def handle(event:,context:) + "Hello!" +end