Repository navigation
Add optional enhanced metadata fields to test categories - #3897
tony-davis wants to merge 1 commit into
Conversation
- Add documentation for optional fields (notes, source_coverage, api_coverage, feature_tags, dependencies) - Add clarifying comment to parser (no logic changes - YAML naturally ignores unknown fields) - Enhance level1 category as example, keep level2-level6 minimal to show backward compatibility All fields are optional and backward compatible. Teams can adopt incrementally. Enables richer test documentation and future AI-assisted test selection.
|
Quick note on the changes: parse_test_categories.py: The diff looks larger than it is - I added a 3-line clarifying comment, and then pre-commit hooks (black formatter, trailing whitespace) auto-reformatted the file. No functional changes to the parser logic. Actual substantive changes:
Everything else is formatting. |
There was a problem hiding this comment.
Pull request overview
This PR extends the test_categories.yaml schema with optional metadata fields to support richer test documentation and future AI-assisted test selection capabilities. The enhancement maintains 100% backward compatibility by making all new fields optional and leveraging the YAML parser's natural behavior of ignoring unknown fields.
Changes:
- Enhanced documentation to describe new optional metadata fields (
notes,source_coverage,api_coverage,feature_tags,dependencies,llm_context) - Added clarifying comment in parser explaining that optional fields are preserved but not processed
- Updated code formatting from single quotes to double quotes for consistency
- Demonstrated backward compatibility by enhancing only one test category (level1) while keeping others minimal
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| shared/ctest/parse_test_categories.py | Code formatting improvements (single to double quotes) and added comment documenting optional enhancement fields |
| shared/ctest/README.md | Added comprehensive documentation for optional metadata fields with examples and use cases |
| projects/hipblas/clients/gtest/test_categories.yaml | Enhanced level1 category with optional metadata as an example; other categories remain minimal to demonstrate backward compatibility |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
## Add Optional Enhanced Metadata Fields to Test Categories
This PR adds optional fields to the `test_categories.yaml` schema to
enable richer test documentation and future AI-assisted test selection.
### Key Points ✅
- **All new fields are optional** - Zero burden on teams that don't want
them
- **100% backward compatible** - Existing YAML files work unchanged
- **Minimal code changes** - Parser naturally ignores unknown fields (no
code changes needed!)
- **Incremental adoption** - Teams add fields only when they see value
- **Clear documentation** - Enhanced README with examples and use cases
### Changes
1. **README.md**: Document optional enhancement fields with examples and
use cases
### Examples
**Minimal usage (works exactly as base PR):**
```yaml
test_categories:
smoke:
description: "Quick sanity tests"
test_patterns: ["*smoke*"]
labels: ["smoke"]
```
**Enhanced usage (when team wants better documentation):**
```yaml
test_categories:
smoke:
description: "Quick sanity tests"
notes: "Run for any API changes. Critical path tests."
source_coverage: ["library/src/api.cpp"]
api_coverage: ["initialize", "cleanup"]
feature_tags: ["fast", "critical-path"]
test_patterns: ["*smoke*"]
labels: ["smoke"]
```
### Why Include Optional Fields in the Standard?
1. **Consistency** - Teams wanting richer metadata have a standardized
structure
2. **Flexibility** - No mandatory adoption, teams use what they need
3. **Prevents divergence** - Projects like hipBLASlt that need extra
metadata can adopt the standard as-is rather than creating
project-specific extensions
4. **Future-proof** - Enables innovation (AI-assisted test selection,
better documentation) without breaking changes
### Testing
- ✅ Parser gracefully ignores optional fields (no code changes needed)
- ✅ CTest execution behavior unchanged
- ✅ Backward compatible with existing deployments
### Context
This enables projects like hipBLASlt (with ~200+ test configurations) to
adopt the standardized approach with rich test metadata, rather than
implementing project-specific extensions that would defeat the
standardization effort.
This PR is a rebase of #3897 to target the new MIOpen branch
(`users/dravindr/ctest_miopen` from PR #3513) instead of the abandoned
PR #2411.
Add Optional Enhanced Metadata Fields to Test Categories
This PR adds optional fields to the
test_categories.yamlschema to enable richer test documentation and future AI-assisted test selection.Key Points ✅
Changes
level1category as example, keptlevel2-level6unchangedExamples
Minimal usage (works exactly as base PR):
Enhanced usage (when team wants better documentation):
Why Include Optional Fields in the Standard?
Testing
Context
This enables projects like hipBLASlt (with ~200+ test configurations) to adopt the standardized approach with rich test metadata, rather than implementing project-specific extensions that would defeat the standardization effort.