Repository navigation
[apex] Fix #6988: Add ApexUnitTestClassShouldHaveRunRelevantTestsAnnotation rule - #6991
Conversation
… (WIP) Co-authored-by: Cursor <[email protected]>
…ShouldHaveRunRelevantTestsAnnotation rule to check for 'critical' and 'testFor' modifiers based on API version. Add method to retrieve API version from companion metadata XML.
…d remove unnecessary whitespace. Update test class visibility from public to package-private.
|
Compared to main: (comment created at 2026-09-21 18:18:15+00:00 for ef74377) |
|
Hi @adangel |
adangel
left a comment
There was a problem hiding this comment.
Thanks for the PR.
Please verify the behavior, when there are additional annotations and not just @IsTest.
Also, we might need to have tests, that mark individual test cases as "critical", if that's a thing...
…practices/ApexUnitTestClassShouldHaveRunRelevantTestsAnnotationRule.java Co-authored-by: Andreas Dangel <[email protected]>
…exFile.java Co-authored-by: Andreas Dangel <[email protected]>
…exFile.java Co-authored-by: Andreas Dangel <[email protected]>
…exFile.java Co-authored-by: Andreas Dangel <[email protected]>
…filter annotation parameters by 'IsTest' annotation. Update test XML to include new test case for class using critical=true with additional annotation.
…ionTest by removing dependency on PmdRuleTst class to simplify test structure.
|
Hi @adangel, |
I've created #7093 to track the version enhancement. |
Describe the PR
ApexUnitTestClassShouldHaveRunRelevantTestsAnnotationthat flags test classes missing either thecriticalortestFormodifier on the@IsTestannotation.RunRelevantTestsdeployment test level (API v66.0+, Beta).*-meta.xmldeclares an API version older than 66.0 are not flagged, since the modifiers aren't available to them.Related issues
Ready?
./mvnw clean verifypasses (checked automatically by github actions)