tests: remove deprecated dotnet7 tests - #9150
Open
roger-zhangg wants to merge 1 commit into
Open
Conversation
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%).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-dotnet7image now installs Amazon.Lambda.Tools 7.0.0, which droppednet7.0:The Lambda
dotnet7runtime 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.WRITEparamtest_dotnet_al2_in_container_0_provided_al2→test_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 oftest_must_mount_with_write_for_dotnet_in_container, the unreachable Finch skip, and the now-unusedUSING_FINCH_RUNTIMEimport.test_must_prompt_for_function_with_specified_workflowkeeps its coverage by switching toBuildMethod: dotnet, which resolves to the sameDOTNET_CLIPACKAGE_CONFIGand still exercises the must-mount-with-write prompt path.The
dotnet7BuildMethod itself is intentionally kept insamcli/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_al2passedmode=Nonefor all three cases, soif mode == "Dotnet"never matched and every case silently built the dotnet_7 template — confirmed in the failing run, where all foursam buildinvocations usedtemplate_build_method_dotnet_7.yaml. The retained("provided.al2", "Dotnet", None, None)case now actually usestemplate_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
make prpassesmake update-reproducible-reqsif dependencies were changedBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.