grails / grails-gradle-plugin

Apache License 2.0
6 stars 9 forks source link

`:integrationTest` also executes `:test` #240

Closed felixscheinost closed 10 months ago

felixscheinost commented 10 months ago

Steps to reproduce:

  1. Create new project at start.grails.org
  2. Add test class to src/test/groovy
  3. Execute ./gradlew clean :integrationTest --tests com.example.DemoSpec

What I expect:

Only com.example.DemoSpec integration test is executed.

What happens:

:test is executed as well.

$ ./gradlew clean :integrationTest --tests com.example.DemoSpec

> Task :integrationTest

Gradle Test Executor 12 STANDARD_OUT
    16:30:43,354 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
    16:30:43,354 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [file:/Users/fesc/Downloads/demo%202/build/resources/integrationTest/logback.xml]
    16:30:43,354 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs multiple times on the classpath.
    16:30:43,354 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs at [file:/Users/fesc/Downloads/demo%202/build/resources/integrationTest/logback.xml]
    16:30:43,354 |-WARN in ch.qos.logback.classic.LoggerContext[default] - Resource [logback.xml] occurs at [file:/Users/fesc/Downloads/demo%202/build/resources/main/logback.xml]
    16:30:43,382 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - debug attribute not set
    16:30:43,383 |-INFO in ch.qos.logback.core.joran.action.ConversionRuleAction - registering conversion word clr with class [org.springframework.boot.logging.logback.ColorConverter]
    16:30:43,383 |-INFO in ch.qos.logback.core.joran.action.ConversionRuleAction - registering conversion word wex with class [org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter]
    16:30:43,383 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
    16:30:43,386 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
    16:30:43,388 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
    16:30:43,399 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to ERROR
    16:30:43,399 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
    16:30:43,400 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
    16:30:43,400 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@24855019 - Registering current configuration as safe fallback point

DemoSpec STANDARD_OUT
    Grails application running at http://localhost:49332 in environment: test

DemoSpec > test something PASSED

> Task :test

UnitSpec > test something STANDARD_OUT
    foo

UnitSpec > test something PASSED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.6.2/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 8s
11 actionable tasks: 9 executed, 1 from cache, 1 up-to-date

Example project

https://github.com/felixscheinost/showcase-grails-bug-gradle-integration-test-also-executes-unit-test