diff --git a/Jenkinsfile b/Jenkinsfile index b8ff1da..94f1024 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,11 +1,13 @@ #!groovy @Library('github.com/wooga/atlas-jenkins-pipeline@1.x') _ withCredentials([usernamePassword(credentialsId: 'github_integration', passwordVariable: 'githubPassword', usernameVariable: 'githubUser'), - string(credentialsId: 'spock_github_extension_coveralls_token', variable: 'coveralls_token')]) { + string(credentialsId: 'snyk-wdk-token', variable: 'SNYK_TOKEN')]) { def testEnvironment = [ "ATLAS_GITHUB_INTEGRATION_USER=${githubUser}", "ATLAS_GITHUB_INTEGRATION_PASSWORD=${githubPassword}" ] - buildJavaLibraryOSSRH coverallsToken: coveralls_token, testEnvironment: testEnvironment + withEnv(['SNYK_ORG_NAME=wooga-pipeline', 'SNYK_AUTO_DOWNLOAD=YES']) { + buildJavaLibraryOSSRH testEnvironment: testEnvironment + } } diff --git a/build.gradle b/build.gradle index e24f3fd..570cb0d 100644 --- a/build.gradle +++ b/build.gradle @@ -22,8 +22,10 @@ plugins { id 'signing' id 'nebula.release' version '15.3.1' id 'jacoco' - id 'com.github.kt3k.coveralls' version '2.12.0' id "io.github.gradle-nexus.publish-plugin" version "1.1.0" + id 'net.wooga.snyk' version '0.10.0' + id "net.wooga.snyk-wdk-java" version "0.3.0" + id "net.wooga.cve-dependency-resolution" version "0.3.0" } group "com.wooga.spock.extensions" @@ -35,9 +37,9 @@ if (cliTasks.contains("rc")) { } dependencies { - implementation 'org.codehaus.groovy:groovy-all:2.4.15' + implementation 'org.codehaus.groovy:groovy-all:2.5.14' api 'org.kohsuke:github-api:[1.95,2)' - implementation('org.spockframework:spock-core:1.2-groovy-2.4') + implementation('org.spockframework:spock-core:1.3-groovy-2.5') testImplementation 'net.bytebuddy:byte-buddy:[1.9,2)' testImplementation 'com.github.stefanbirkner:system-rules:[1.18,2)' diff --git a/src/test/groovy/com/wooga/spock/extensions/github/GithubRepositoryBuilderSpec.groovy b/src/test/groovy/com/wooga/spock/extensions/github/GithubRepositoryBuilderSpec.groovy index b4fb0a2..05ac2b8 100644 --- a/src/test/groovy/com/wooga/spock/extensions/github/GithubRepositoryBuilderSpec.groovy +++ b/src/test/groovy/com/wooga/spock/extensions/github/GithubRepositoryBuilderSpec.groovy @@ -73,7 +73,7 @@ class GithubRepositoryBuilderSpec extends Specification { repo.createIssue("Test Issue").create() then: - e = thrown(GHFileNotFoundException) + e = thrown(HttpException) e.message.contains("Issues are disabled for this repo") and: "has no wiki" diff --git a/src/test/groovy/com/wooga/spock/extensions/github/api/RateLimitHandlerWaitSpec.groovy b/src/test/groovy/com/wooga/spock/extensions/github/api/RateLimitHandlerWaitSpec.groovy index 839d805..20350d2 100644 --- a/src/test/groovy/com/wooga/spock/extensions/github/api/RateLimitHandlerWaitSpec.groovy +++ b/src/test/groovy/com/wooga/spock/extensions/github/api/RateLimitHandlerWaitSpec.groovy @@ -55,8 +55,8 @@ class RateLimitHandlerWaitSpec extends Specification { rateLimitResetMilis << [5000, 15000] message = rateLimitResetMilis < 10000 ? "for minimum wait time of 10 sec" : "until rate limit resets" - minTimeout = (Math.max(10000, rateLimitResetMilis) - 1000).longValue() - maxTimeout = (Math.max(10000, rateLimitResetMilis) + 1000).longValue() + minTimeout = (Math.max(10000, rateLimitResetMilis) - 2000).longValue() + maxTimeout = (Math.max(10000, rateLimitResetMilis) + 2000).longValue() waitTimeRange = (minTimeout..maxTimeout) }