Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kotlin Build on travis-CI passes but no tests get run

I'm attempting to setup my project to run builds on travis-CI. I've gotten it setup so that it runs and passes but my tests don't get run at all. Locally they pass. To test I setup a test to fail and the proceeding build still passed. THis is a gradle project and uses testng.

build.gradle file

group 'org.napoleon'
version '1.0-SNAPSHOT'

buildscript {
    ext.kotlin_version = '1.1.4-3'

    repositories {
        mavenCentral()
        jcenter()
    }
    dependencies {
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

apply plugin: 'kotlin'

repositories {
    mavenCentral()
    jcenter()
}

dependencies {
    compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version"
    testCompile group : 'org.testng', name : 'testng', version: '6.8'
}

task wrapper(type: Wrapper) {
    gradleVersion = '3.4.1'
}

compileKotlin {
    kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
    kotlinOptions.jvmTarget = "1.8"
}

test {
    // enable TestNG support (default is JUnit)
    useTestNG()
}

and travis.yml

language: java
jdk:
  - oraclejdk8
before_install:
  - chmod +x gradlew
  - chmod +x gradle/wrapper/gradle-wrapper.jar

I'm basically new to both travis-CI and kotlin so struggling with a few things as I go.

like image 499
menapole Avatar asked Nov 08 '17 19:11

menapole


1 Answers

Try this:

language: java
jdk:
  - oraclejdk8
before_install:
  - chmod +x gradlew
  - chmod +x gradle/wrapper/gradle-wrapper.jar
script:
  - ./gradlew test build
like image 145
Artur Czopek Avatar answered Oct 21 '22 21:10

Artur Czopek