New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Integration Tests + fixes for JENKINS-56312 and JENKINS-57320 #140
Merged
Merged
Changes from 5 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
c51e9a7
First stab at adding PCT ITs for the Docker image
batmat 17c5944
Download Jenkins.war to run always on the same
batmat 67436a3
Prepare parallelization
batmat 50365d3
Add same run on JDK8
batmat 6bd3014
Remove dupe run
batmat e70e9e2
Update the Makefile to use 2.164.2 by default
oleg-nenashev d6ce90e
[JENKINS-56312] - Implement proper version comparison for plugin splits
oleg-nenashev ce2ff5d
[JENKINS-57320] - PCT was malfunctional on any Jenkins WAR without bu…
oleg-nenashev File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,6 +50,73 @@ for (int i = 0; i < platforms.size(); ++i) { | |
} | ||
} | ||
} | ||
|
||
/* Execute our platforms in parallel */ | ||
parallel(branches) | ||
|
||
// Integration testing, using a locally built Docker image | ||
def itBranches = [:] | ||
|
||
|
||
itBranches['buildtriggerbadge:2.10 tests success on JDK11'] = { | ||
node('docker') { | ||
checkout scm | ||
|
||
// should we build the image only once and somehow export and stash/unstash it then? | ||
// not sure this would be that quicker | ||
stage('Build Docker Image') { | ||
sh 'make docker' | ||
} | ||
|
||
stage('Download Jenkins 2.164.1') { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use 2.164.2? |
||
sh ''' | ||
curl -sL http://mirrors.jenkins.io/war-stable/2.164.1/jenkins.war --output jenkins.war | ||
echo "65543f5632ee54344f3351b34b305702df12393b3196a95c3771ddb3819b220b jenkins.war" | sha256sum --check | ||
''' | ||
} | ||
|
||
stage("Run known successful case(s)") { | ||
sh '''docker run --rm \ | ||
-v $(pwd)/jenkins.war:/pct/jenkins.war:ro \ | ||
-v $(pwd)/out:/pct/out -e JDK_VERSION=11 \ | ||
-e ARTIFACT_ID=buildtriggerbadge -e VERSION=buildtriggerbadge-2.10 \ | ||
jenkins/pct | ||
''' | ||
archiveArtifacts artifacts: "out/**" | ||
|
||
sh 'cat out/pct-report.html | grep "Tests : Success"' | ||
} | ||
} | ||
} | ||
|
||
itBranches['buildtriggerbadge:2.10 tests success on JDK8'] = { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would it be possible to prevent copy-paste ? |
||
node('docker') { | ||
checkout scm | ||
|
||
// should we build the image only once and somehow export and stash/unstash it then? | ||
// not sure this would be that quicker | ||
stage('Build Docker Image') { | ||
sh 'make docker' | ||
} | ||
|
||
stage('Download Jenkins 2.164.1') { | ||
sh ''' | ||
curl -sL http://mirrors.jenkins.io/war-stable/2.164.1/jenkins.war --output jenkins.war | ||
echo "65543f5632ee54344f3351b34b305702df12393b3196a95c3771ddb3819b220b jenkins.war" | sha256sum --check | ||
''' | ||
} | ||
|
||
stage("Run known successful case(s)") { | ||
sh '''docker run --rm \ | ||
-v $(pwd)/jenkins.war:/pct/jenkins.war:ro \ | ||
-v $(pwd)/out:/pct/out -e JDK_VERSION=8 \ | ||
-e ARTIFACT_ID=buildtriggerbadge -e VERSION=buildtriggerbadge-2.10 \ | ||
jenkins/pct | ||
''' | ||
archiveArtifacts artifacts: "out/**" | ||
|
||
sh 'cat out/pct-report.html | grep "Tests : Success"' | ||
} | ||
} | ||
} | ||
|
||
itBranches.failFast = false | ||
parallel itBranches |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is definitely some level of copy paste below. I think we'll want to factor this out at some point.
But I didn't want to spend too much making this generic yet (like having a way to simply provide the command the pass, the expected result, etc.). I'd rather first have this merged as-is, once green, and we iterate on growing the test coverage and will refactor in followups.