Open Lisanderl opened 6 years ago
Hi @Lisanderl, I don't see anything obvious at the first look. I assume that you apply our plugin through meta-apps-lint
. I would look around parent class of your test. Here is one of our test which is kind of similar https://github.com/nebula-plugins/gradle-lint-plugin/blob/master/src/test/groovy/com/netflix/nebula/lint/rule/dependency/MinimumDependencyVersionRuleSpec.groovy Here is the parent class which we use https://github.com/nebula-plugins/gradle-lint-plugin/blob/master/src/test/groovy/com/netflix/nebula/lint/TestKitSpecification.groovy My guess is that Gradle which you run in the test doesn't see the project under test on its classpath. Our TestKitSpecification
is providing that feature. I believe a similar class is also provided by nebula-test project (https://github.com/nebula-plugins/nebula-test/blob/master/src/main/groovy/nebula/test/IntegrationTestKitSpec.groovy) so you don't have to copy-paste this code. We haven't migrated this project to nebula-test yet.
Complementing @chali comment, have you tried to look at your build/resources/main/META-INF/lint-rules
to check that the properties file is available when you execute your test?
Complementing @chali comment, have you tried to look at your
build/resources/main/META-INF/lint-rules
to check that the properties file is available when you execute your test?
Yeah, it's available, and default rules works if i add them to my src/main/resources/META-INF/lint-rules/wrong-script-rule.properties, like 'includes=unused-dependency,all-dependency'
Hi! I have written simple rule for my project, and it works. But in test it didn't. Probably test runner can't find rule id. Maybe someone have had the same problem ?
It's my test:
........................................................................................................
It's my rule: ............................................................................................
Also i create src/main/resources/META-INF/lint-rules/wrong-script-rule.properties file . If i use 'default rule' like unused-dependency it works.