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
39 changes: 1 addition & 38 deletions tests/integration/buildcmd/test_build_cmd_dotnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
SKIP_DOCKER_TESTS,
SKIP_DOCKER_BUILD,
SKIP_DOCKER_MESSAGE,
USING_FINCH_RUNTIME,
run_command_with_input,
)
from tests.integration.buildcmd.build_integ_base import (
Expand All @@ -23,36 +22,19 @@
class TestBuildCommand_Dotnet_cli_package(BuildIntegDotnetBase):
@parameterized.expand(
[
("provided.al2", "Dotnet7", None, None),
("provided.al2", "Dotnet7", None, MountMode.WRITE),
("provided.al2", "Dotnet", None, None),
]
)
@skipIf(SKIP_DOCKER_TESTS or SKIP_DOCKER_BUILD, SKIP_DOCKER_MESSAGE)
def test_dotnet_al2(self, runtime, code_uri, mode, mount_mode):
# Skip specific test case when using Finch runtime
if (
runtime == "provided.al2"
and code_uri == "Dotnet7"
and mode is None
and mount_mode is None
and USING_FINCH_RUNTIME
):
self.skipTest(
"Skip test when using Finch runtime: Terraform uses Docker provider that connect to Finch daemon via Docker socket"
)

overrides = {
"Runtime": runtime,
"CodeUri": code_uri,
"Handler": "HelloWorld::HelloWorld.Function::FunctionHandler",
"Architectures": "x86_64",
}

if mode == "Dotnet":
self.template_path = self.template_path.replace("template.yaml", "template_build_method_dotnet.yaml")
else:
self.template_path = self.template_path.replace("template.yaml", "template_build_method_dotnet_7.yaml")
self.template_path = self.template_path.replace("template.yaml", "template_build_method_dotnet.yaml")

self.validate_build_command(overrides, mode, mount_mode)
self.validate_build_artifacts(self.EXPECTED_FILES_PROJECT_MANIFEST_PROVIDED)
Expand Down Expand Up @@ -141,25 +123,6 @@ def test_tier1_dotnet_build_in_container(self):
@pytest.mark.dotnet
@skipIf(SKIP_DOCKER_TESTS or SKIP_DOCKER_BUILD, SKIP_DOCKER_MESSAGE)
class TestBuildCommand_Dotnet_cli_package_interactive(BuildIntegDotnetBase):
@parameterized.expand(
[
("provided.al2", "Dotnet7", None),
]
)
def test_dotnet_al2_in_container(self, runtime, code_uri, mode):
overrides = {
"Runtime": runtime,
"CodeUri": code_uri,
"Handler": "HelloWorld::HelloWorld.Function::FunctionHandler",
"Architectures": "x86_64",
}

self.template_path = self.template_path.replace("template.yaml", "template_build_method_dotnet_7.yaml")

self.validate_build_command(overrides, mode, use_container=True, input="y")
self.validate_build_artifacts(self.EXPECTED_FILES_PROJECT_MANIFEST_PROVIDED)
self.validate_invoke_command(overrides, runtime)

@parameterized.expand(
[
("dotnet6", "Dotnet6", None),
Expand Down
25 changes: 0 additions & 25 deletions tests/integration/testdata/buildcmd/Dotnet7/HelloWorld.csproj

This file was deleted.

38 changes: 0 additions & 38 deletions tests/integration/testdata/buildcmd/Dotnet7/Program.cs

This file was deleted.

This file was deleted.

6 changes: 0 additions & 6 deletions tests/integration/testdata/buildcmd/Dotnet7/rd.xml

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion tests/unit/commands/buildcmd/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def test_must_prompt_for_function_with_specified_workflow(self, prompt_mock):
metadata=metadata1,
)

metadata2 = {"BuildMethod": "dotnet7"}
metadata2 = {"BuildMethod": "dotnet"}

function = Function(
stack_path="somepath",
Expand Down
14 changes: 1 addition & 13 deletions tests/unit/lib/build_module/test_workflow_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,7 @@ def test_must_work_for_provided(self, runtime):
self.assertIn(Event("BuildWorkflowUsed", "provided-None"), EventTracker.get_tracked_events())
self.assertFalse(result.must_mount_with_write_in_container)

@parameterized.expand([("provided.al2",)])
def test_must_work_for_provided_with_build_method_dotnet7(self, runtime):
result = get_workflow_config(runtime, self.code_dir, self.project_dir, specified_workflow="dotnet7")
self.assertEqual(result.language, "dotnet")
self.assertEqual(result.dependency_manager, "cli-package")
self.assertEqual(result.application_framework, None)
self.assertEqual(result.manifest_name, ".csproj")
self.assertIsNone(result.executable_search_paths)
self.assertEqual(len(EventTracker.get_tracked_events()), 1)
self.assertIn(Event("BuildWorkflowUsed", "dotnet-cli-package"), EventTracker.get_tracked_events())
self.assertTrue(result.must_mount_with_write_in_container)

@parameterized.expand([("dotnet6",), ("provided.al2", "dotnet7")])
@parameterized.expand([("dotnet6",)])
def test_must_mount_with_write_for_dotnet_in_container(self, runtime, specified_workflow=None):
result = get_workflow_config(runtime, self.code_dir, self.project_dir, specified_workflow)
self.assertTrue(result.must_mount_with_write_in_container)
Expand Down
Loading