Skip to content
Permalink
Browse files

test JENKINS-48061 no tag, no branch

  • Loading branch information...
MarkEWaite committed Apr 6, 2018
1 parent b1c67a3 commit 96ae30edf0efe2cd54b419c80815a41a60aa8e90
Showing with 51 additions and 16 deletions.
  1. +51 −16 Jenkinsfile
@@ -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)

0 comments on commit 96ae30e

Please sign in to comment.
You can’t perform that action at this time.