Skip to content

test: add unit testings for specific checkers#225

Merged
ktro2828 merged 1 commit into
mainfrom
test/sanity/checkers
Nov 18, 2025
Merged

test: add unit testings for specific checkers#225
ktro2828 merged 1 commit into
mainfrom
test/sanity/checkers

Conversation

@ktro2828

Copy link
Copy Markdown
Collaborator

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_skip method for improved error reporting. The main changes are grouped below:

1. New Test Suites for Sanity Checkers

  • Added test_format_checkers.py to test all format field type checkers, ensuring they correctly pass or skip when optional schemas are missing.
  • Added test_record_checkers.py to verify record-level checkers, including both passing and failing scenarios by mutating sample data.
  • Added test_reference_checkers.py to validate reference integrity across annotation files, including tests for both valid and invalid references and handling of optional files.

2. Improved Error Reporting

  • Updated the can_skip method in tiv001.py to return a more informative reason ("Data root not found") when the data root is missing, instead of returning Nothing.

These changes significantly improve the reliability of the sanity checker suite by providing robust, automated regression tests and clearer error diagnostics.

Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>
Copilot AI review requested due to automatic review settings November 17, 2025 07:25
@github-actions github-actions Bot added the ci Continuous Integration (CI) processes and testing label Nov 17, 2025
@github-actions

github-actions Bot commented Nov 17, 2025

Copy link
Copy Markdown
Contributor

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
3900 3234 83% 50% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
t4_devkit/sanity/tier4/tiv001.py 97% 🟢
TOTAL 97% 🟢

updated for commit: 6d3ed8f by action🐍

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_skip to return "Data root not found" instead of Nothing for 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.

Comment thread tests/sanity/test_reference_checkers.py
Comment thread tests/sanity/test_reference_checkers.py
@ktro2828 ktro2828 merged commit 4e0b365 into main Nov 18, 2025
4 of 5 checks passed
@ktro2828 ktro2828 deleted the test/sanity/checkers branch November 18, 2025 05:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continuous Integration (CI) processes and testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants