This repository has been archived by the owner on Jan 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test JENKINS-48061 no tag, no branch
- Loading branch information
1 parent
b1c67a3
commit 96ae30e
Showing
1 changed file
with
51 additions
and
16 deletions.
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 |
---|---|---|
@@ -1,18 +1,53 @@ | ||
#!groovy | ||
|
||
// Don't test plugin compatibility to other Jenkins versions | ||
// Allow failing tests to retry execution | ||
// buildPlugin(failFast: false) | ||
|
||
// Test plugin compatbility to pom defined version (null) and latest Jenkins weekly | ||
// Allow failing tests to retry execution | ||
// Run checkstyle and save the output, mark unstable on any checkstyle warning | ||
// Run findbugs and save the output, mark unstable on any findbugs warning | ||
buildPlugin(jenkinsVersions: [null, '2.73.1', '2.78'], | ||
checkstyle: [run:true, archive:true, unstableTotalAll: '0'], | ||
findbugs: [run:true, archive:true, unstableTotalAll: '0'], | ||
failFast: false | ||
) | ||
|
||
// See https://github.com/jenkins-infra/pipeline-library/blob/master/README.adoc | ||
// for detailed description of the arguments available with buildPlugin | ||
@Library('git-modern-3.8.0@5093f89ac0057a471081ff5a5bf94c20f9acae97') _ | ||
|
||
import com.markwaite.Assert | ||
import com.markwaite.Build | ||
|
||
import static groovy.json.JsonOutput.* | ||
|
||
def branch = 'JENKINS-48061-no-tag-no-branch' | ||
def repo = 'https://github.com/MarkEWaite/hello-world-plugin' | ||
|
||
import java.util.Random | ||
def random = new Random() | ||
|
||
def implementations = [ 'git', 'jgit', 'jgitapache' ] | ||
/* Randomize order of implementations */ | ||
Collections.shuffle(implementations, random) | ||
|
||
def tasks = [ : ] | ||
|
||
def checkout_result = [ : ] | ||
|
||
def first = "" | ||
|
||
for (int i = 0; i < implementations.size(); ++i) { | ||
def gitImplementation = implementations[i] | ||
tasks[gitImplementation] = { | ||
node { | ||
stage("Check ${gitImplementation}") { | ||
def implementation = gitImplementation == "git" ? "Default" : gitImplementation | ||
checkout([$class: 'GitSCM', | ||
branches: [[name: branch]], | ||
browser: [$class: 'GithubWeb', repoUrl: repo], | ||
extensions: [ | ||
[$class: 'CloneOption', honorRefspec: true, noTags: true], | ||
], | ||
gitTool: implementation, | ||
userRemoteConfigs: [[refspec: "+refs/heads/${branch}:refs/remotes/origin/${branch}", url: repo]] | ||
] | ||
) | ||
|
||
/* Call the ant build. */ | ||
def my_step = new com.markwaite.Build() | ||
my_step.ant 'info' | ||
def my_check = new com.markwaite.Assert() | ||
my_check.logContains('.*user dir is .*', 'Ant output missing user dir report') | ||
} | ||
} | ||
} | ||
} | ||
|
||
parallel(tasks) |