Skip to content

tests: remove deprecated dotnet7 tests - #9150

Open
roger-zhangg wants to merge 1 commit into
developfrom
remove-dotnet7-tests
Open

tests: remove deprecated dotnet7 tests#9150
roger-zhangg wants to merge 1 commit into
developfrom
remove-dotnet7-tests

Conversation

@roger-zhangg

Copy link
Copy Markdown
Member

Which issue(s) does this change fix?

N/A

Why is this change necessary?

The dotnet7 integration tests are failing on release builds (run 30662...). The build-dotnet7 image now installs Amazon.Lambda.Tools 7.0.0, which dropped net7.0:

error NU1202: Package Amazon.Lambda.Tools 7.0.0 is not compatible with net7.0
  Package Amazon.Lambda.Tools 7.0.0 supports: net10.0, net8.0

The Lambda dotnet7 runtime was deprecated on May 14, 2024 (container-only, AL2) and the public dotnet7 base image has not published a new version since 2024. These tests therefore cannot be made to pass, so they are removed rather than pinned to an out-of-support framework.

How does it address the issue?

Removes the dotnet7 tests and fixtures. The two failures in that run map exactly to the two removals:

  • test_dotnet_al2_1_provided_al2 → the dotnet7 + MountMode.WRITE param
  • test_dotnet_al2_in_container_0_provided_al2test_dotnet_al2_in_container (dotnet7 was its only param)

Also removed: tests/integration/testdata/buildcmd/Dotnet7/, template_build_method_dotnet_7.yaml, test_must_work_for_provided_with_build_method_dotnet7, the dotnet7 param of test_must_mount_with_write_for_dotnet_in_container, the unreachable Finch skip, and the now-unused USING_FINCH_RUNTIME import.

test_must_prompt_for_function_with_specified_workflow keeps its coverage by switching to BuildMethod: dotnet, which resolves to the same DOTNET_CLIPACKAGE_CONFIG and still exercises the must-mount-with-write prompt path.

The dotnet7 BuildMethod itself is intentionally kept in samcli/lib/build/workflow_config.py — only tests are removed here, so this is not a user-facing change.

What side effects does this change have?

This also fixes a latent bug. test_dotnet_al2 passed mode=None for all three cases, so if mode == "Dotnet" never matched and every case silently built the dotnet_7 template — confirmed in the failing run, where all four sam build invocations used template_build_method_dotnet_7.yaml. The retained ("provided.al2", "Dotnet", None, None) case now actually uses template_build_method_dotnet.yaml (net8.0), so AL2 dotnet coverage is real rather than accidental.

Related: aws/aws-sam-build-images#206 removes the dotnet7 build image.

Mandatory Checklist

PRs will only be reviewed after checklist is complete

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

The dotnet7 integration tests have been failing on release builds (see
run 30657529336). The build-dotnet7 image now installs Amazon.Lambda.Tools
7.0.0, which dropped net7.0:

  error NU1202: Package Amazon.Lambda.Tools 7.0.0 is not compatible with
  net7.0. Package Amazon.Lambda.Tools 7.0.0 supports: net10.0, net8.0

The Lambda dotnet7 runtime was deprecated May 14, 2024 and the public
dotnet7 base image has not published since 2024, so these tests cannot be
made to pass and are removed rather than pinned to an unsupported
framework.

The dotnet7 BuildMethod itself is intentionally left in place in
samcli/lib/build/workflow_config.py; only the tests are removed.

Removed:
- test_dotnet_al2 dotnet7 params (plain + MountMode.WRITE) and the
  now-unreachable Finch skip that guarded one of them
- TestBuildCommand_Dotnet_cli_package_interactive.test_dotnet_al2_in_container
  (dotnet7 was its only param)
- tests/integration/testdata/buildcmd/Dotnet7/ and
  template_build_method_dotnet_7.yaml
- test_must_work_for_provided_with_build_method_dotnet7 and the dotnet7
  param of test_must_mount_with_write_for_dotnet_in_container
- the now-unused USING_FINCH_RUNTIME import

test_must_prompt_for_function_with_specified_workflow keeps its coverage by
switching to BuildMethod "dotnet", which resolves to the same
DOTNET_CLIPACKAGE_CONFIG and so still exercises the must-mount-with-write
prompt path.

Note this also fixes a latent bug: test_dotnet_al2 passed mode=None for all
three cases, so `if mode == "Dotnet"` never matched and every case silently
built the dotnet_7 template -- confirmed in the failing run, where all four
sam build invocations used template_build_method_dotnet_7.yaml. The retained
case now actually uses template_build_method_dotnet.yaml (net8.0).

Testing: make pr passes (9345 passed, 25 skipped, coverage 94.11%).
@roger-zhangg
roger-zhangg requested a review from a team as a code owner July 31, 2026 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant