-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[java] Separate test sources and resources #5746
Copy link
Copy link
Closed
Labels
an:enhancementAn improvement on existing features / rulesAn improvement on existing features / rulesin:testingAbout tests of pmd, eg the module pmd-lang-test or pmd-test [test]About tests of pmd, eg the module pmd-lang-test or pmd-test [test]
Milestone
Metadata
Metadata
Assignees
Labels
an:enhancementAn improvement on existing features / rulesAn improvement on existing features / rulesin:testingAbout tests of pmd, eg the module pmd-lang-test or pmd-test [test]About tests of pmd, eg the module pmd-lang-test or pmd-test [test]
Type
Fields
Give feedbackNo fields configured for issues without a type.
Is your feature request related to a problem? Please describe.
The test tree of pmd-java has some classes that are not functional code, but that we put there so that it gets compiled and then we can use the compiled classes in tests. This code is test data, and should be separate from the actual test sources. If we separate them then we can run more static analysis on our test sources and keep that part of the codebase cleaner.
Describe the solution you'd like
Create a new source tree
pmd-java/src/test/java-resources, and let it be compiled by javac.pmd-java/src/test/javashould have a dependency on those. Move the test data files there.Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context #5738 found a couple instances of UnusedPrivateMethod that we should legitimately fix. The rule is not used on our test sources precisely because they're mixed with the test data code, and legit violations could be mixed with bogus violations.