Repository navigation
test(image_uris): derive pytorch-amzn2023 versions from config - #6385
Conversation
test_pytorch_amzn2023_training_uris compared the config's version list against a hardcoded ["2.11", "2.12", "2.13"]. The automated image_uri_configs update (aws#6374) added 2.14, so the exact-equality assertion broke sagemaker-core unit tests on master. Iterate over the versions present in the config, require a minimum set of known versions, and check that the "latest" alias points to a defined version, so future version additions do not break the test.
|
Claude finished @lucasjia-aws's task in 50s —— View job PR Review:
|
Issue
The sagemaker-core unit tests have failed on master since #6374 (CI Health V3 Master, e.g. https://github.com/aws/sagemaker-python-sdk/actions/runs/37428327833/job/112153018582). The only failure is
tests/unit/image_uris/test_pytorch_amzn2023.py::test_pytorch_amzn2023_training_uris[pytorch-amzn2023.json], on py310, py311 and py312.Root cause
The test compared the configured versions in
pytorch-amzn2023.jsonagainst a hardcoded["2.11", "2.12", "2.13"]using exact equality. The automated image_uri_configs update in #6374 added PyTorch2.14and movedlatestto it without updating the test, so the first assertion failed. Because that assertion failed, the per-region URI checks never ran for the iso/eusc regions that #6374 also added.Fix
REQUIRED_AMZN2023_VERSIONS(now including2.14) and assert that it is a subset of the configured versions.version_aliases["latest"]points to a defined version.Testing
pytest tests/unit/image_uris/test_pytorch_amzn2023.py: 3 passed, including the exact URI checks for 2.14 and the newly added iso/eusc regions.black --checkandflake8pass on the changed file.