"gradle -C rebuild clean" doesn't make a difference. After experimenting some
more, I found that given the following build file, all test pass with 0.8,
but 42 out of 661 fail with 0.9-preview-1:

project(":spock-specs") {
  dependencies {
    compile project(":spock-core")
    compile junit
    testCompile easymock
    testCompile jmock_junit4
    testCompile jmock
    testCompile mockito
    testRuntime asm
    testRuntime cglib
    testRuntime objenesis
    testRuntime h2database
  }
}         

As soon as I change at least one of the two compile dependencies to
testCompile, all tests pass even with 0.9-preview-1. Considering that
"junit" refers to JUnit 4.8.1, and that spock-core also declares a
dependency on JUnit 4.8.1, I suppose that if none of the two dependencies is
a "compile" dependency, Gradle 0.9-preview-1 puts an older version of JUnit
on the test runtime classpath, resulting in some tests to fail. Looking at
the failing tests, I'm pretty sure this is it.

Cheers,
Peter


Adam Murdoch-3 wrote:
> 
> 
> 
> On 31/05/10 4:36 AM, Peter Niederwieser wrote:
>> After switching the Spock build from Gradle 0.8 to 0.9-preview-1, I got
>> lots
>> of test errors. After explicitly adding JUnit 4.8.1 as a test runtime
>> dependency (it had already been a compile dependency), most of these
>> errors
>> went away. Does this mean that compile dependencies are no longer on the
>> test runtime class path?
>>    
> 
> Nothing should have changed here. Any dependency declared in the compile 
> configuration should be included in the testRuntime configuration. You 
> shouldn't have to add junit to the testCompile configuration if it is 
> already declared in the compile configuration.
> 
> I wonder if you've run into http://jira.codehaus.org/browse/GRADLE-909, 
> which has since been fixed. Could you try running gradle -C rebuild 
> clean, and see if the problem goes away.
> 
> 
> -- 
> Adam Murdoch
> Gradle Developer
> http://www.gradle.org
> CTO, Gradle Inc. - Gradle Training, Support, Consulting
> http://www.gradle.biz
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
> 
>     http://xircles.codehaus.org/manage_email
> 
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Compile-dependencies-no-longer-on-test-runtime-class-path--tp28723918p28736547.html
Sent from the gradle-user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to