Skip to content

Commit

Permalink
Upgrade PCT; Launchable improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
basil committed Apr 21, 2023
1 parent ea97e7a commit c4a906e
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 11 deletions.
36 changes: 26 additions & 10 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@ def mavenEnv(Map params = [:], Closure body) {
}
}

@NonCPS
def parsePlugins(plugins) {
def pluginsByRepository = [:]
plugins.each { plugin ->
def splits = plugins.split('\t')
pluginsByRepository[splits[0]] = splits[1].split(',')
}
pluginsByRepository
}

def pluginsByRepository
def lines
def fullTest = env.CHANGE_ID && pullRequest.labels.contains('full-test')
Expand All @@ -42,7 +52,9 @@ stage('prep') {
}
}
dir('target') {
pluginsByRepository = readFile('plugins.txt').split('\n')
def plugins = readFile('plugins.txt').split('\n')
pluginsByRepository = parsePlugins(plugins)

lines = readFile('lines.txt').split('\n')
if (!fullTest) {
// run PCT only on newest and oldest lines, to save resources
Expand All @@ -52,9 +64,12 @@ stage('prep') {
withCredentials([string(credentialsId: 'launchable-jenkins-bom', variable: 'LAUNCHABLE_TOKEN')]) {
lines.each { line ->
def commitHashes = readFile "commit-hashes-${line}.txt"
launchable("record build --name \"${BUILD_TAG}-${line}\" --no-commit-collection " + commitHashes)
launchable("record session --build \"${BUILD_TAG}-${line}\" --observation >launchable-session-${line}.txt")
stash name: "launchable-session-${line}.txt", includes: "launchable-session-${line}.txt"
launchable("record build --name ${env.BUILD_TAG}-${line} --no-commit-collection " + commitHashes + " --link \"View build in CI\"=${env.BUILD_URL}")

def jdk = line == 'weekly' ? 17 : 11
def sessionFile = "launchable-session-${line}.txt"
launchable("record session --build ${env.BUILD_TAG}-${line} --flavor platform=linux --flavor jdk=${jdk} --observation --link \"View session in CI\"=${env.BUILD_URL} >${sessionFile}")
stash name: sessionFile, includes: sessionFile
}
}
}
Expand All @@ -64,14 +79,14 @@ stage('prep') {

branches = [failFast: !fullTest]
lines.each {line ->
pluginsByRepository.each { plugins ->
branches["pct-$plugins-$line"] = {
pluginsByRepository.each { repository, plugins ->
branches["pct-$repository-$line"] = {
def jdk = line == 'weekly' ? 17 : 11
mavenEnv(jdk: jdk) {
deleteDir()
checkout scm
withEnv([
"PLUGINS=$plugins",
"PLUGINS=${plugins.join(',')}",
"LINE=$line",
'EXTRA_MAVEN_PROPERTIES=maven.test.failure.ignore=true:surefire.rerunFailingTestsCount=1'
]) {
Expand All @@ -80,9 +95,10 @@ lines.each {line ->
launchable.install()
withCredentials([string(credentialsId: 'launchable-jenkins-bom', variable: 'LAUNCHABLE_TOKEN')]) {
launchable('verify')
unstash "launchable-session-${line}.txt"
def launchableSession = readFile("launchable-session-${line}.txt").trim()
launchable("record tests --session ${launchableSession} maven './**/target/surefire-reports' './**/target/failsafe-reports'")
def sessionFile = "launchable-session-${line}.txt"
unstash sessionFile
def session = readFile(sessionFile).trim()
launchable("record tests --session ${session} --group ${repository} maven './**/target/surefire-reports' './**/target/failsafe-reports'")
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion prep-pct.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -euxo pipefail
cd "$(dirname "${0}")"

# Tracked by ./updatecli/updatecli.d/plugin-compat-tester.yml
pct_version=1316.v57c72c3efc5e
pct_version=1323.v3efd78e3d9d5
pct="$(mvn -Dexpression=settings.localRepository -q -DforceStdout help:evaluate)/org/jenkins-ci/tests/plugins-compat-tester-cli/${pct_version}/plugins-compat-tester-cli-${pct_version}.jar"
[ -f "${pct}" ] || mvn dependency:get -Dartifact=org.jenkins-ci.tests:plugins-compat-tester-cli:${pct_version}:jar -DremoteRepositories=repo.jenkins-ci.org::default::https://repo.jenkins-ci.org/public/,incrementals::default::https://repo.jenkins-ci.org/incrementals/ -Dtransitive=false
cp "${pct}" target/pct.jar
Expand Down

0 comments on commit c4a906e

Please sign in to comment.