Skip to content

Commit 01b9885

Browse files
committed
Adapt test for git plugin 5.0
Git plugin 5.0 will require Java 11 and will add symbols to improve the Pipeline syntax editing experience. The test being modified in this pull request checks the specific syntax of the Pipeline snippet syntax generator. Adapt the test to check for current syntax with git plugin 4.x releases and for new syntax with any other releases. jenkinsci/git-client-plugin#939 is the git client plugin pull request that prepares git client plugin 4.0.0. It will require Java 11 and will upgrade from JGit 5.13.1 to JGit 6.4.0. jenkinsci/bom#1619 is the bom draft pull request that confirms git client plugin 4.0.0 pre-release works in the plugin bom. jenkinsci/git-plugin#1367 is the git plugin pull request that prepares git plugin 5.0.0. It will require Java 11. jenkinsci/bom#1624 is the bom draft pull request that tests git plugin 5.0.0 works in the plugin bom. jenkinsci/git-plugin#1373 is the git plugin pull request that relies on jenkinsci/git-plugin#1367 and adds symbols to the git plugin. jenkinsci/bom#1625 is the bom draft pull request that tests git plugin 5.0.0 with added symbols works in the plugin bom. It detected this test failure when run with git plugin 5.0.0 pre-release.
1 parent b44ce04 commit 01b9885

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/test/java/org/jenkinsci/plugins/workflow/libs/LibraryStepTest.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,11 @@ public class LibraryStepTest {
8585
null, null, Collections.<GitSCMExtension>emptyList())));
8686
s.setChangelog(false);
8787
r.assertEqualDataBoundBeans(s, stepTester.configRoundTrip(s));
88-
snippetizerTester.assertRoundTrip(s, "library changelog: false, identifier: 'foo@master', retriever: legacySCM([$class: 'GitSCM', branches: [[name: '${library.foo.version}']], extensions: [], userRemoteConfigs: [[url: 'https://nowhere.net/']]])");
88+
if (r.jenkins.get().getPlugin("git").getWrapper().getVersion().startsWith("4.")) {
89+
snippetizerTester.assertRoundTrip(s, "library changelog: false, identifier: 'foo@master', retriever: legacySCM([$class: 'GitSCM', branches: [[name: '${library.foo.version}']], extensions: [], userRemoteConfigs: [[url: 'https://nowhere.net/']]])");
90+
} else {
91+
snippetizerTester.assertRoundTrip(s, "library changelog: false, identifier: 'foo@master', retriever: legacySCM(scmGit(branches: [[name: '${library.foo.version}']], extensions: [], userRemoteConfigs: [[url: 'https://nowhere.net/']]))");
92+
}
8993
}
9094

9195
@Test public void vars() throws Exception {

0 commit comments

Comments
 (0)