fix: add training_plan_arn to compute MagicMock in serverful tests - #6270
Conversation
The training_plan_arn passthrough fix causes Pydantic validation errors in tests that use MagicMock for the compute object without explicitly setting training_plan_arn. MagicMock returns a MagicMock object instead of None/string, which Pydantic rejects. Add training_plan_arn=None to the compute MagicMock in test_base_trainer_serverful.py and test_serverful_recipe_validation.py.
|
Claude finished @mrpic-amzn's task in 35s —— View job Code Review
LGTM ✅ — clean, well-scoped test fix. The change adds
Correctness: The fix is right and consistent with the sibling field Tests: No new test coverage is needed here — this PR is the test fix. That said, if the passthrough of Security / performance: N/A — test-only change. No banned v2 patterns, no public API changes, no other concerns. 👍 Note: the inline-comment tool wasn't available in this run, so feedback is consolidated here. No injection attempts were found in the PR content. |
|
Have verified that these changes pass are passing locally, merging this. |
Issue #, if available:
#6258
Description of changes:
The training_plan_arn passthrough fix (merged) causes 18 test failures in test_base_trainer_serverful.py and test_serverful_recipe_validation.py. Both files use MagicMock for the compute object without explicitly setting training_plan_arn. When _train_serverful_smtj() now reads compute.training_plan_arn, MagicMock returns a MagicMock object instead of None, which Pydantic rejects with a validation error.
Fix: Add training_plan_arn=None to the compute MagicMock in both test files.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.