test: add unit testings for specific checkers#225
Merged
Conversation
Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>
Contributor
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... Modified Files
|
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds comprehensive unit test coverage for the T4 devkit sanity checker suite and improves error reporting in the skip logic. The tests validate format field types, record-level constraints, reference integrity checks, structural requirements, and Tier4 loader behavior.
Key changes:
- Added test suites for format, record, reference, and structure checkers with both passing and failing scenarios
- Enhanced
TIV001.can_skipto return "Data root not found" instead ofNothingfor better diagnostics - Tests verify proper skip behavior when optional schemas are missing
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/sanity/test_tier4_checker.py | Tests for TIV001 checker covering pass, skip, and fail scenarios |
| tests/sanity/test_structure_checkers.py | Tests for STR001-STR009 structure checkers validating directory and file presence requirements |
| tests/sanity/test_reference_checkers.py | Tests for REF001-REF014 reference integrity checkers with mutation-based failure scenarios |
| tests/sanity/test_record_checkers.py | Tests for REC001-REC006 record-level checkers ensuring proper record count validation |
| tests/sanity/test_format_checkers.py | Tests for FMT001-FMT018 format field type checkers including optional schema handling |
| t4_devkit/sanity/tier4/tiv001.py | Updated skip logic to return informative reason when data root is missing |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
What
This pull request introduces comprehensive test coverage for the sanity checkers in the T4 devkit, adding new test suites for format, record, and reference checkers. It also refines the skip logic in the
can_skipmethod for improved error reporting. The main changes are grouped below:1. New Test Suites for Sanity Checkers
test_format_checkers.pyto test all format field type checkers, ensuring they correctly pass or skip when optional schemas are missing.test_record_checkers.pyto verify record-level checkers, including both passing and failing scenarios by mutating sample data.test_reference_checkers.pyto validate reference integrity across annotation files, including tests for both valid and invalid references and handling of optional files.2. Improved Error Reporting
can_skipmethod intiv001.pyto return a more informative reason ("Data root not found") when the data root is missing, instead of returningNothing.These changes significantly improve the reliability of the sanity checker suite by providing robust, automated regression tests and clearer error diagnostics.