Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion aws_lambda_builders/workflows/custom_make/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class CustomMakeWorkflow(BaseWorkflow):

CAPABILITY = Capability(language="provided", dependency_manager=None, application_framework=None)

EXCLUDED_FILES = (".aws-sam", ".git")
EXCLUDED_FILES = (".aws-sam", ".git", ".vs")

DEFAULT_BUILD_DIR = BuildDirectory.SCRATCH
BUILD_IN_SOURCE_SUPPORT = BuildInSourceSupport.OPTIONALLY_SUPPORTED
Expand Down
2 changes: 1 addition & 1 deletion aws_lambda_builders/workflows/java_maven/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class JavaMavenWorkflow(BaseWorkflow):

CAPABILITY = Capability(language="java", dependency_manager="maven", application_framework=None)

EXCLUDED_FILES = (".aws-sam", ".git")
EXCLUDED_FILES = (".aws-sam", ".git", ".vs")

DEFAULT_BUILD_DIR = BuildDirectory.SCRATCH
BUILD_IN_SOURCE_SUPPORT = BuildInSourceSupport.NOT_SUPPORTED
Expand Down
2 changes: 1 addition & 1 deletion aws_lambda_builders/workflows/nodejs_npm/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class NodejsNpmWorkflow(BaseWorkflow):

CAPABILITY = Capability(language="nodejs", dependency_manager="npm", application_framework=None)

EXCLUDED_FILES = (".aws-sam", ".git")
EXCLUDED_FILES = (".aws-sam", ".git", ".vs")

CONFIG_PROPERTY = "aws_sam"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class NodejsNpmEsbuildWorkflow(BaseWorkflow):

CAPABILITY = Capability(language="nodejs", dependency_manager="npm-esbuild", application_framework=None)

EXCLUDED_FILES = (".aws-sam", ".git", "node_modules")
EXCLUDED_FILES = (".aws-sam", ".git", ".vs", "node_modules")

CONFIG_PROPERTY = "aws_sam"

Expand Down
1 change: 1 addition & 0 deletions aws_lambda_builders/workflows/python_pip/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class PythonPipWorkflow(BaseWorkflow):
# TODO: Move the commonly ignored files to base class
".vscode",
".idea",
".vs",
)

PYTHON_VERSION_THREE = "3"
Expand Down
1 change: 1 addition & 0 deletions aws_lambda_builders/workflows/python_uv/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ class PythonUvWorkflow(BaseWorkflow):
# Editors
".vscode",
".idea",
".vs",
)

DEFAULT_BUILD_DIR = BuildDirectory.SCRATCH
Expand Down
2 changes: 1 addition & 1 deletion aws_lambda_builders/workflows/ruby_bundler/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class RubyBundlerWorkflow(BaseWorkflow):

CAPABILITY = Capability(language="ruby", dependency_manager="bundler", application_framework=None)

EXCLUDED_FILES = (".aws-sam", ".git")
EXCLUDED_FILES = (".aws-sam", ".git", ".vs")

DEFAULT_BUILD_DIR = BuildDirectory.ARTIFACTS
BUILD_IN_SOURCE_SUPPORT = BuildInSourceSupport.NOT_SUPPORTED
Expand Down
39 changes: 38 additions & 1 deletion tests/functional/test_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,48 @@
from parameterized import parameterized


from aws_lambda_builders.actions import CopyDependenciesAction, LinkSinglePathAction, MoveDependenciesAction
from aws_lambda_builders.actions import (
CopyDependenciesAction,
CopySourceAction,
LinkSinglePathAction,
MoveDependenciesAction,
)
from aws_lambda_builders.utils import copytree
from aws_lambda_builders.workflows.custom_make.workflow import CustomMakeWorkflow
from aws_lambda_builders.workflows.java_maven.workflow import JavaMavenWorkflow
from aws_lambda_builders.workflows.nodejs_npm.workflow import NodejsNpmWorkflow
from aws_lambda_builders.workflows.nodejs_npm_esbuild.workflow import NodejsNpmEsbuildWorkflow
from aws_lambda_builders.workflows.python_pip.workflow import PythonPipWorkflow
from aws_lambda_builders.workflows.python_uv.workflow import PythonUvWorkflow
from aws_lambda_builders.workflows.ruby_bundler.workflow import RubyBundlerWorkflow
from tests.testing_utils import read_link_without_junction_prefix


class TestCopySourceAction(TestCase):
@parameterized.expand(
[
(CustomMakeWorkflow,),
(JavaMavenWorkflow,),
(NodejsNpmWorkflow,),
(NodejsNpmEsbuildWorkflow,),
(PythonPipWorkflow,),
(PythonUvWorkflow,),
(RubyBundlerWorkflow,),
]
)
def test_must_skip_visual_studio_folder(self, workflow):
# Visual Studio keeps files under .vs locked while it is open (aws/aws-sam-cli#7886)
with tempfile.TemporaryDirectory() as tmpdir:
source_dir = os.path.join(tmpdir, "source")
target_dir = os.path.join(tmpdir, "target")
os.makedirs(os.path.join(source_dir, ".vs"))
Path(source_dir, "app.py").touch()

CopySourceAction(source_dir, target_dir, excludes=workflow.EXCLUDED_FILES).execute()

self.assertEqual(os.listdir(target_dir), ["app.py"])


class TestCopyDependenciesAction(TestCase):
@parameterized.expand(
[
Expand Down
1 change: 1 addition & 0 deletions tests/unit/workflows/python_uv/test_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ def test_workflow_excluded_files(self):
"uv.lock.bak",
".vscode",
".idea",
".vs",
)
self.assertEqual(self.workflow.EXCLUDED_FILES, expected_excluded_files)

Expand Down