I tried to take a look at this today and something isn't making sense to me. I updated geb-spock to 4.0 and I updated spock-core to 2.0-M4-groovy-3.0 <https://mvnrepository.com/artifact/org.spockframework/spock-core/2.0-M4-groovy-3.0>. When i tried the @Tag method I am getting errors that the import cannot be resolved for the @Tag. Upon further digging it looks like spock-core 2.0-M4-groovy-3.0 <https://mvnrepository.com/artifact/org.spockframework/spock-core/2.0-M4-groovy-3.0> isn't bringing in any JUnit 5 dependencies? I know for sure that spock-core 1.3-groovy-2.5 is bringing in junit 4.12. Am I supposed to be bringing the JUnit 5 dependency in myself or is it because Spock 2 hasn't been officially released?
I guess I am confused because Geb 4.0 seems to still work with our setup, which I thought it would break. Perhaps I shouldn't worry about this for now? On Saturday, February 27, 2021 at 9:02:41 AM UTC-6 jc wrote: > So it looks like maybe JUnit 5 added the includeTags and i completely > remove the interfaces part of this out of it. I will have to give this a > try. > > On Saturday, February 27, 2021 at 5:29:06 AM UTC-6 [email protected] > wrote: > >> 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/09ba87d6-104c-47c8-9dde-75216d260fb8n%40googlegroups.com.
