Skip to content
Permalink
Browse files

Switch to using svn for JENKINS-26100 test so we can release.

  • Loading branch information...
abayer committed Jun 20, 2017
1 parent f5a2dac commit 65952d9ba01c2d79d41d3c5c32cbc22580df1b03
Showing with 11 additions and 11 deletions.
  1. +2 −2 pom.xml
  2. +9 −9 src/test/java/org/jenkinsci/plugins/workflow/steps/scm/SCMStepTest.java
@@ -42,8 +42,8 @@
<java.level>8</java.level>
<no-test-jar>false</no-test-jar>
<scm-api-plugin.version>2.1.1</scm-api-plugin.version>
<git-plugin.version>3.3.1-20170518.175415-4</git-plugin.version> <!-- TODO: Switch to release once https://github.com/jenkinsci/git-plugin/pull/492 is merged and released -->
<subversion-plugin.version>2.7.2</subversion-plugin.version>
<git-plugin.version>3.3.0</git-plugin.version>
<subversion-plugin.version>2.8</subversion-plugin.version>
</properties>
<dependencies>
<dependency>
@@ -62,20 +62,20 @@
public void scmVars() throws Exception {
r.addStep(new Statement() {
@Override public void evaluate() throws Throwable {
sampleGitRepo.init();
sampleGitRepo.write("Jenkinsfile", "node('remote') {\n" +
" def gitCommit = checkout(scm).GIT_COMMIT\n" +
" echo \"GIT_COMMIT is ${gitCommit}\"\n" +
sampleSvnRepo.init();
sampleSvnRepo.write("Jenkinsfile", "node('remote') {\n" +
" def svnRev = checkout(scm).SVN_REVISION\n" +
" echo \"SVN_REVISION is ${svnRev}\"\n" +
"}\n");
sampleGitRepo.git("add", "Jenkinsfile");
sampleGitRepo.git("commit", "--message=files");
String commitHash = sampleGitRepo.head();
sampleSvnRepo.svnkit("add", sampleSvnRepo.wc() + "/Jenkinsfile");
sampleSvnRepo.svnkit("commit", "--message=+Jenkinsfile", sampleSvnRepo.wc());
long revision = sampleSvnRepo.revision();
WorkflowJob p = r.j.jenkins.createProject(WorkflowJob.class, "p");
p.setDefinition(new CpsScmFlowDefinition(new jenkins.plugins.git.GitStep(sampleGitRepo.toString()).createSCM(), "Jenkinsfile"));
p.setDefinition(new CpsScmFlowDefinition(new SubversionStep(sampleSvnRepo.trunkUrl()).createSCM(), "Jenkinsfile"));

r.j.createOnlineSlave(Label.get("remote"));
WorkflowRun b = r.j.assertBuildStatusSuccess(p.scheduleBuild2(0));
r.j.assertLogContains("GIT_COMMIT is " + commitHash, b);
r.j.assertLogContains("SVN_REVISION is " + revision, b);
}
});
}

0 comments on commit 65952d9

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