test(code-image): refresh fixtures and assertions to md5-tree-v2#554
Open
FileSystemGuy wants to merge 1 commit into
Open
test(code-image): refresh fixtures and assertions to md5-tree-v2#554FileSystemGuy wants to merge 1 commit into
FileSystemGuy wants to merge 1 commit into
Conversation
Commit d8b8f0c (PR for issue #505) bumped the code-tree hash algorithm identifier from md5-tree-v1 to md5-tree-v2 so stale pre-#512 captures surface as MalformedHashFile. Production reads from submission_checker.tools.code_image._ALGORITHM = "md5-tree-v2" and load_code_image() rejects any other value with "Unknown algorithm" *before* checking other fields (see code_image.py:470). Two test files still encoded v1: * test_code_image.py - test_load_happy_path: asserted img.algorithm == "md5-tree-v1" - test_schema_invariants: asserted payload["algorithm"] == "md5-tree-v1" - test_load_malformed_json_raises[Invalid MD5 hash format]: payload's algorithm was "md5-tree-v1", so production raised "Unknown algorithm" first and the test never reached the hash-format check it was meant to exercise. Same for the [Invalid captured_at] and [Invalid git_sha] parameter sets — all need the current algorithm so the *specific* field-validation path under test fires. - The [Unknown algorithm] case (algorithm="v2") is preserved as-is — that one IS testing the unknown-algorithm branch. * test_submission_checker_structure.py - _write_valid_hash_json fixture wrote algorithm "md5-tree-v1", which every layered self-consistency test depends on for a "valid" .code- hash.json. All 15 downstream failures resolve once this single fixture string flips to v2. Result: 116 passed + 20 failed → 131 passed across both files.
|
MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅ |
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.
Summary
Commit `d8b8f0c` (issue #505 fix) bumped the code-tree hash algorithm identifier from `md5-tree-v1` to `md5-tree-v2` in `submission_checker.tools.code_image._ALGORITHM` so stale pre-#512 captures surface as `MalformedHashFile`. Production rejects any other value as "Unknown algorithm" before checking other fields (code_image.py:470).
Two test files still encoded v1, producing 20 failures across them:
`test_code_image.py`
`test_submission_checker_structure.py`
Test plan