robospock / RoboSpock

A testing framework which brings powers of Spock and Groovy to Android app testing
http://robospock.org
MIT License
249 stars 44 forks source link

Run tests from cli #52

Closed fougere-mike closed 9 years ago

fougere-mike commented 9 years ago

Hi, I've been using robospock with android studio and it's working quite well. I can run my tests from the IDE with no problems. However, I'm now attempting to set up a CI server, and I'm having difficulty executing the tests from command line.

When running ./gradlew clean assemble test I can see the test tasks are being executed, but my tests are not actually running. The build always succeeds even when I add tests that should always fail:

public class FailureTest extends Specification {
   def "Failing Test"() {
      expect:
      false
   }
}

I expect I'm just missing something simple like a config option. Any help would be appreciated :)

wojtekerbetowski commented 9 years ago

Which version of gradle groovy plugin are you using?

fougere-mike commented 9 years ago

'org.codehaus.groovy:gradle-groovy-android-plugin:0.3.6'

pjakubczyk commented 9 years ago

It depends on Google Android plugin. Versions lower than 1.3.0 are compatible with 0.3.6 plugin. However newer not. Unfortunately authors of didn't release a fix to central repository.

In my project I use jitpack to make it work:

buildscript {
  repositories {
    maven {
      url "https://jitpack.io"
    }

  dependencies {
    classpath 'com.github.groovy:groovy-android-gradle-plugin:570c650ee00622120ad0d0653f8329b64321f37d'
  }
} 
fougere-mike commented 9 years ago

Sweet, using jitpack with that commit seems to have fixed the issue. Cheers!