I think this should help:
https://www.baeldung.com/junit-5-migration#4-tagging-and-filtering. And
then https://mkyong.com/junit5/junit-5-tagging-and-filtering-tag-examples/
shows how to filter in gradle based on @Tag.

On Fri, Feb 26, 2021 at 5:30 PM [email protected] <[email protected]>
wrote:

> Hello jc,
>
> there is always the option to create a new Test task in Gradle, and
> include tests from there.
>
> Example:
>
> ```
> task smokeTest(type: Test) {
>     // ...
>     filter {
>         includeTestsMatching 'my_package.ThisTest'
>         includeTestsMatching 'my_package.OtherTest'
>     }
> }
> ```
> See also:
> https://docs.gradle.org/current/userguide/java_testing.html#test_filtering
>
> Cheers,
> Thomas
> jc schrieb am Freitag, 26. Februar 2021 um 16:57:07 UTC+1:
>
>> This might be a Spock question vs a Geb question but I'm hoping someone
>> here can help.  We currently have our Smoketests setup to run by tagging
>> them with @Category.
>>
>> So we have an interface class setup like this:
>>
>> [image: Screen Shot 2021-02-26 at 9.50.38 AM.png]
>>
>> This allows us to tag any test we want to run as a smoke test with
>> @Category(SmokeTest).  We have a grade job setup that will run all tests
>> with this tag that uses useJUnit and the includeCategories to grab those
>> tags:
>> [image: Screen Shot 2021-02-26 at 9.53.20 AM.png]
>>
>> I know Spock 2.0 removes Category and breaks this setup completely and
>> I'm not really sure how to fix this.  I've read that Category has been
>> replaced with @Tag, but I don't know how this works with changing the
>> interfaces and the gradle job to run them correctly.  As soon as I update
>> to Spock 2.0 it all breaks.
>>
>> I'd really appreciate some input on how to fix this, or like some
>> insights on how others are tagging their tests to run Smoke tests.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Geb User Mailing List" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/geb-user/25d037a0-aa85-4a2b-a7d2-29c4e18f543cn%40googlegroups.com
> <https://groups.google.com/d/msgid/geb-user/25d037a0-aa85-4a2b-a7d2-29c4e18f543cn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups "Geb 
User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/geb-user/CA%2B52dQTLy68jdLTxJ6sPF7pxP8wHArb6N4QFDrEvhyokzp6zmA%40mail.gmail.com.

Reply via email to