You're very much welcome, Gordon.

On Thu, May 14, 2020 at 11:50 PM Gordon Freeman <[email protected]>
wrote:

> Marcin, thanks a lot! I very appreciate it. 👍
>
> On Thursday, May 14, 2020 at 8:30:22 PM UTC+3, Marcin Erdmann wrote:
>>
>> On Wed, May 13, 2020 at 10:50 PM Gordon Freeman <[email protected]>
>> wrote:
>>
>>> *For 2. *I found this article
>>> https://blog.jdriven.com/2018/10/combining-spock-junit-5-tests/ so,
>>> Junit5 and Spock 1.2 should work together.
>>> I`m not familiar with categories in Junit, should I somehow mark tests
>>> to some categories before create Gradle task?
>>>
>>
>> Yes, like shown here for example:
>> https://mkyong.com/unittest/junit-categories-test/
>>
>>
>>> On Wednesday, May 13, 2020 at 11:06:53 PM UTC+3, Marcin Erdmann wrote:
>>>>
>>>> Gordon,
>>>>
>>>> For 1., why don't you simply use built in test filtering provided by
>>>> Gradle Test task?
>>>>
>>>> ./gradlew uiTest --tests=ui.Ui1Spec --tests=ui.Ui5Spec
>>>> --tests=ui.Ui17Spec --tests=ui.UiRegression78Spec
>>>>
>>>> See
>>>> https://docs.gradle.org/current/javadoc/org/gradle/api/tasks/testing/Test.html#setTestNameIncludePatterns-java.util.List-
>>>>  and
>>>> https://docs.gradle.org/current/javadoc/org/gradle/api/tasks/testing/TestFilter.html
>>>> .
>>>>
>>>> For 2., I don't think Spock 1.2 supports JUnit5. Why don't you use
>>>> JUnit categories instead as described at the beginning of
>>>> https://docs.gradle.org/current/userguide/java_testing.html#test_grouping
>>>> ?
>>>>
>>>> Marcin
>>>>
>>>> On Mon, May 11, 2020 at 11:52 AM Gordon Freeman <[email protected]>
>>>> wrote:
>>>>
>>>>> Hi, guys! I need your advice.
>>>>>
>>>>> I have 2 test folders:
>>>>> \src\test\groovy\tests\ui
>>>>> \src\test\groovy\tests\api
>>>>>
>>>>> And have 2 tasks in Gradle:
>>>>> task uiTest(type: Test) {
>>>>>     doFirst {
>>>>>         include "**/ui/${System.getProperty("testPackage", "")}"
>>>>>         exclude "**/api/*"
>>>>>     }
>>>>>     maxParallelForks = 4
>>>>>     forkEvery = 4
>>>>>     testLogging.showStandardStreams = true
>>>>> }
>>>>>
>>>>> task apiTest(type: Test) {
>>>>>     doFirst {
>>>>>         include "**/api/${System.getProperty("testPackage", "")}"
>>>>>         exclude "**/ui/*"
>>>>>     }
>>>>>     maxParallelForks = 4
>>>>>     forkEvery = 4
>>>>>     testLogging.showStandardStreams = true
>>>>> }
>>>>>
>>>>> I can easily execute one particular test OR all tests in one folder
>>>>> without any execution issues, example for ui tests:
>>>>> gradlew.bat "-DtestPackage=/" clean uiTest -b build.gradle
>>>>> gradlew.bat "-DtestPackage=/Ui1Spec*" clean uiTest -b build.gradle
>>>>>
>>>>>
>>>>> So, I have 2 questions:
>>>>> *1. *How can I execute more than 1 test simultaneously for one
>>>>> *testPackage*, but not all tests from *testPackage*?
>>>>> *For example:* in
>>>>>  '\src\test\groovy\tests\ui'
>>>>> I have 100 tests, but I need to execute only* 'Ui1Spec', 'Ui5Spec',
>>>>> 'Ui17Spec'* and *'UiRegression78Spec'*
>>>>>
>>>>> *2.* How can I execute tests by *Junit5 *tag?
>>>>> *Let me explain:* previously I was working on another framework and
>>>>> we used Selenide+JUnit5, it was very easy to mark test by annotation
>>>>> @Tag('regression')
>>>>> and then execute only tests which were marked:
>>>>>  '-Dtag=regression'
>>>>>
>>>>> I was trying to create gradle task with this closure:
>>>>>  useJUnitPlatform {
>>>>>         includeTags 'regression' //or System.getProperty('tag') to
>>>>> make it generic
>>>>>     }
>>>>>
>>>>> Found it here <https://www.baeldung.com/junit-5-gradle>but it doesn`t
>>>>> work with *Spock/Geb*, maybe because test classes doesn`t contain '
>>>>> *Test*' suffix?
>>>>>
>>>>> FYI my dependencies:
>>>>>
>>>>> gebVersion = '3.4'
>>>>> junitVersion = '5.6.1'
>>>>> spockVersion = '1.2-groovy-2.5'
>>>>> groovyVersion = '2.5.10'
>>>>> compile "org.gebish:geb-spock:$gebVersion"
>>>>> compile "org.codehaus.groovy:groovy-all:$groovyVersion"
>>>>> compile "org.codehaus.groovy:groovy-dateutil:$groovyVersion"
>>>>> compile "org.codehaus.groovy:groovy-all:$groovyVersion"
>>>>> compile "org.codehaus.groovy:groovy-dateutil:$groovyVersion"
>>>>> testImplementation("org.junit.jupiter:junit-jupiter:$junitVersion")
>>>>> testCompile("org.spockframework:spock-core:$spockVersion") {
>>>>>         exclude group: "org.codehaus.groovy"
>>>>>     }
>>>>>
>>>>> Thanks in advance!
>>>>>
>>>>> --
>>>>> 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/c2449a17-05b7-45d4-9e0d-4af8bf5208bd%40googlegroups.com
>>>>> <https://groups.google.com/d/msgid/geb-user/c2449a17-05b7-45d4-9e0d-4af8bf5208bd%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/4bb8a13c-0f3a-40a6-beda-14836d672421%40googlegroups.com
>>> <https://groups.google.com/d/msgid/geb-user/4bb8a13c-0f3a-40a6-beda-14836d672421%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/df6ea5de-98fd-4818-8bd9-0b6c45815b1d%40googlegroups.com
> <https://groups.google.com/d/msgid/geb-user/df6ea5de-98fd-4818-8bd9-0b6c45815b1d%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%2B52dQRRctbWXbEX5m5LYtv9MJbp3KMr33WNVyAJCrgtCtRO-A%40mail.gmail.com.

Reply via email to