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.
Try this:
language: java
jdk:
- oraclejdk8
before_install:
- chmod +x gradlew
- chmod +x gradle/wrapper/gradle-wrapper.jar
script:
- ./gradlew test build
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With