Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Switch to using svn for JENKINS-26100 test so we can release.
  • Loading branch information
abayer committed Jun 20, 2017
1 parent f5a2dac commit 65952d9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Expand Up @@ -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>
Expand Down
Expand Up @@ -62,20 +62,20 @@ public class SCMStepTest {
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);
}
});
}
Expand Down

0 comments on commit 65952d9

Please sign in to comment.