Skip to content
Permalink
Browse files
Add integration tests task
Patch by Chris Lohfink, reviewed by Dinesh Joshi and Vinay Chella for CASSANDRA-15031
  • Loading branch information
clohfink committed Mar 5, 2019
1 parent a9e1555 commit 2dc4b1d0077a6096d5f51aa0500159a7ec67e6d3
Showing 19 changed files with 1,046 additions and 135 deletions.
@@ -0,0 +1,43 @@
# Java Gradle CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-java/ for more details
#
version: 2
jobs:
build:
docker:
- image: circleci/openjdk:8-jdk

working_directory: ~/repo

environment:
TERM: dumb

steps:
- checkout

# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "build.gradle" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-

- run: ./gradlew dependencies

- save_cache:
paths:
- ~/.gradle
key: v1-dependencies-{{ checksum "build.gradle" }}

# make sure it builds with build steps like swagger docs and dist
- run: ./gradlew build

# run tests!
- run: ./gradlew check

- store_artifacts:
path: build/reports
destination: test-reports
- store_test_results:
path: build/reports
@@ -74,6 +74,7 @@ lib/jsr223/scala/*.jar
/.ant-targets-build.xml

# Generated files from the documentation
doc/source/configuration/cassandra_config_file.rst
doc/source/tools/nodetool
src/main/resources/docs/*

src/dist/*
*.logdir_IS_UNDEFINED
@@ -2,6 +2,9 @@ plugins {
id 'java'
id 'application'
id 'idea'
id 'checkstyle'
id 'jacoco'
id 'findbugs'
id 'org.hidetake.swagger.generator' version '2.16.0'
}

@@ -52,10 +55,23 @@ sourceSets {
srcDirs = [main.resources, "src/test/resources"]
}
}
integrationTest {
java {
compileClasspath += main.output + test.output
runtimeClasspath += main.output + test.output
srcDir file('src/integration/java')
}
resources {
srcDirs = [main.resources, "src/integration/resources"]
}
}
}

configurations {
jolokia

integrationTestCompile.extendsFrom testCompile
integrationTestRuntime.extendsFrom testRuntime
}

dependencies {
@@ -82,6 +98,8 @@ dependencies {
testCompile 'org.apache.commons:commons-exec:1.3+'
testCompile group: 'org.mockito', name: 'mockito-all', version: '1.10.19'
testCompile group: 'io.vertx', name: 'vertx-junit5', version: '3.6.3'

integrationTestCompile group: 'com.datastax.oss.simulacron', name: 'simulacron-driver-3x', version: '0.8.7'
}

swaggerSources {
@@ -124,7 +142,6 @@ clean {
delete "$projectDir/src/dist/agents"
println "Deleting generated docs $projectDir/src/main/resources/docs"
delete "$projectDir/src/main/resources/docs"

}

test {
@@ -133,6 +150,29 @@ test {
systemProperty "javax.net.ssl.trustStorePassword", "password"
}

task integrationTest(type: Test) {
jacoco {
enabled = false
}
useJUnitPlatform()
testClassesDirs = sourceSets.integrationTest.output.classesDirs
classpath = sourceSets.integrationTest.runtimeClasspath
shouldRunAfter test
}

checkstyle {
toolVersion '7.8.1'
configFile file("checkstyle.xml")
}

tasks.withType(FindBugs) {
reports {
xml.enabled false
html.enabled true
}
}

// copyDist gets called on every build
copyDist.dependsOn installDist
check.dependsOn checkstyleMain, checkstyleTest, integrationTest, jacocoTestReport
build.dependsOn copyDist, generateReDoc, generateSwaggerUI, copyJolokia

0 comments on commit 2dc4b1d

Please sign in to comment.