Skip to content

Commit

Permalink
Merge pull request #47 from RedPillAnalytics/develop
Browse files Browse the repository at this point in the history
Gradle 5.1.1 upgrade.
  • Loading branch information
stewartbryson authored Jan 18, 2019
2 parents ab3d0af + 8d9dda2 commit a001d93
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 35 deletions.
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pipeline {

stage('Integration') {
steps {
sh "$gradle ksqlServertest ksqlPipelinesTest deployTest"
sh "$gradle runAllTests"
}
}

Expand Down
16 changes: 9 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,6 @@ tasks.withType(Test) {
systemProperty 'projectDir', temporaryDir
}

//release.onlyIf { gradle.rootProject.extensions.analytics.gitBranch == 'master' }
//publishPlugins.onlyIf { gradle.rootProject.extensions.analytics.gitBranch == 'master' }
//
//release.doLast {
// logger.info "branch: ${gradle.rootProject.extensions.analytics.gitBranch}"
//}

testSets {
ksqlServerTest
ksqlPipelinesTest
Expand Down Expand Up @@ -154,3 +147,12 @@ task publishDocs {
}

tasks.publishPlugins.dependsOn publishDocs

task runAllTests {
description 'Run all defined tests.'
group 'verification'
}

tasks.withType(Test) {
runAllTests.dependsOn it
}
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Thu Jan 10 17:57:29 EST 2019
#Fri Jan 18 10:16:40 EST 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
61 changes: 36 additions & 25 deletions src/test/groovy/LoadConfigTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class LoadConfigTest extends Specification {
def result, taskList

@Shared
String projectName = 'load-config'
String taskName, projectName = 'load-config'

def setupSpec() {

Expand Down Expand Up @@ -62,6 +62,26 @@ class LoadConfigTest extends Specification {
processed.delete()
}

// helper method
def executeSingleTask(String taskName, List args, Boolean logOutput = true) {

args.add(0, taskName)

log.warn "runner arguments: ${args.toString()}"

// execute the Gradle test build
result = GradleRunner.create()
.withProjectDir(projectDir)
.withArguments(args)
.withPluginClasspath()
.build()

// log the results
if (logOutput) log.warn result.getOutput()

return result
}

def "Application Plugin expand works with default file"() {

given:
Expand All @@ -71,16 +91,11 @@ class LoadConfigTest extends Specification {
TOPIC_PREFIX = 'dev-'
""")

result = GradleRunner.create()
.withProjectDir(projectDir)
.withArguments('-Si', 'build', '--rerun-tasks')
.withPluginClasspath()
.build()

log.warn result.getOutput()
taskName = 'build'
result = executeSingleTask(taskName, ['--rerun-tasks', '-Si'])

expect:
['SUCCESS', 'UP_TO_DATE', 'SKIPPED'].contains(result.task(":build").outcome.toString())
result.task(":${taskName}").outcome.name() != 'FAILED'
processed.exists()
processed.text.contains('APPLICATION_ID = dev-application')
processed.text.contains('TOPIC_PREFIX = dev-')
Expand All @@ -95,21 +110,18 @@ class LoadConfigTest extends Specification {
TOPIC_PREFIX = 'dev-'
""")

result = GradleRunner.create()
.withProjectDir(projectDir)
.withArguments('-Si', 'build', "-P.confluent.configPath=streams.config", '--rerun-tasks')
.withPluginClasspath()
.build()

log.warn result.getOutput()
taskName = 'build'
result = executeSingleTask(taskName, ['--rerun-tasks', '-Si', "-Pconfluent.configPath=streams.config"])

expect:
['SUCCESS', 'UP_TO_DATE', 'SKIPPED'].contains(result.task(":build").outcome.toString())
result.task(":${taskName}").outcome.name() != 'FAILED'
processed.exists()
processed.text.contains('APPLICATION_ID = dev-application')
processed.text.contains('TOPIC_PREFIX = dev-')
}

// using executeTask is not working for this test
// something to do with the "-P" parameter referencing a variable.
def "Application Plugin expand works with absolute file"() {

given:
Expand All @@ -134,6 +146,8 @@ class LoadConfigTest extends Specification {
processed.text.contains('TOPIC_PREFIX = dev-')
}

// using executeTask is not working for this test
// something to do with the "-P" parameter referencing a variable.
def "Application Plugin expand works with absolute file and environment"() {

given:
Expand Down Expand Up @@ -165,6 +179,8 @@ class LoadConfigTest extends Specification {
processed.text.contains('TOPIC_PREFIX = test-')
}

// using executeTask is not working for this test
// something to do with the "-P" parameter referencing a variable.
def "Application Plugin expand works with absolute file and bogus environment"() {

given:
Expand Down Expand Up @@ -206,16 +222,11 @@ class LoadConfigTest extends Specification {
applicationDefaultJvmArgs = '-Djava.io.tmpdir=/tmp'
""")

result = GradleRunner.create()
.withProjectDir(projectDir)
.withArguments('-Si', 'build', '--rerun-tasks')
.withPluginClasspath()
.build()

log.warn result.getOutput()
taskName = 'build'
result = executeSingleTask(taskName, ['--rerun-tasks', '-Si'])

expect:
['SUCCESS', 'UP_TO_DATE', 'SKIPPED'].contains(result.task(":build").outcome.toString())
result.task(":${taskName}").outcome.name() != 'FAILED'
unixScript.exists()
unixScript.text.contains('''DEFAULT_JVM_OPTS="-Djava.io.tmpdir=/tmp"''')
windowsScript.exists()
Expand Down

0 comments on commit a001d93

Please sign in to comment.