- Notifications
You must be signed in to change notification settings - Fork334
Evaluate TestRequestBuilder.CustomFilters also on class, not just on test.#2209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Conversation
brettchabot left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Can you also add an entry to runner/android_junit_runner/CHANGELOG.md
consp1racy left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I'm missing a test case where the annotation is both on the class and on the methods, with different values.
true { true, false, none } --> 2| publicvoidtestTwoSkip() {} | ||
| } | ||
| publicstaticclassSampleCustomFilterOnClassextendsAbstractFilter { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This test code esentially simulates consumer code. The consumer shouldn't need to override anything butevaluateTest for this PR to work on classes. And they don't, thanks to the changes inCustomFilters.shouldRun above.
This class shouldn't exist. Usages can be replaced by the existingSampleCustomFilter class.
| @Retention(RetentionPolicy.RUNTIME) | ||
| @Target({ElementType.TYPE}) | ||
| @CustomFilter(filterClass =SampleCustomFilterOnClass.class) | ||
| public @interfaceSampleCustomAnnotationOnClass { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This annotation shouldn't exist, it's essentially the same asSampleCustomAnnotation, just below.
Now
TestRequestBuilder.CustomFiltersdoes not evaluate@CustomFilteron test classes, just on tests. It will be great to have evaluation also for classes.Because of this missing feature, I need to apply my annotation with
@CustomFilterto every test method, or I have to configure instrumentation runner in build.gradle.kts (or in my custom runner). All these solutions are kind of painful in large multimodule project.or