New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adapt test for git plugin 5.0 #40
Conversation
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.
@jglick are you the preferred person to review this pull request or is there someone else that I should ask? |
if (r.jenkins.get().getPlugin("git").getWrapper().getVersion().startsWith("4.")) { | ||
snippetizerTester.assertRoundTrip(s, "library changelog: false, identifier: 'foo@master', retriever: legacySCM([$class: 'GitSCM', branches: [[name: '${library.foo.version}']], extensions: [], userRemoteConfigs: [[url: 'https://nowhere.net/']]])"); | ||
} else { | ||
snippetizerTester.assertRoundTrip(s, "library changelog: false, identifier: 'foo@master', retriever: legacySCM(scmGit(branches: [[name: '${library.foo.version}']], extensions: [], userRemoteConfigs: [[url: 'https://nowhere.net/']]))"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this is not simply git
because that would conflict with the Step
? 😞
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's correct. I wanted to use git
but there is already a git
step defined.
@@ -85,7 +85,11 @@ public class LibraryStepTest { | |||
null, null, Collections.<GitSCMExtension>emptyList()))); | |||
s.setChangelog(false); | |||
r.assertEqualDataBoundBeans(s, stepTester.configRoundTrip(s)); | |||
snippetizerTester.assertRoundTrip(s, "library changelog: false, identifier: 'foo@master', retriever: legacySCM([$class: 'GitSCM', branches: [[name: '${library.foo.version}']], extensions: [], userRemoteConfigs: [[url: 'https://nowhere.net/']]])"); | |||
if (r.jenkins.get().getPlugin("git").getWrapper().getVersion().startsWith("4.")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK for now (a cleanup PR in a few weeks would be appreciated) though in general we prefer to avoid this kind of switch—rather just update the test dependency to the newer version. If you have not released that version yet, file a draft PR with an incremental version so it is ready to go and be included in an omnibus bom
PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do.
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.
It would be nice to have a new release of this plugin ready to go at (or before) the release of git plugin 5.0.0 so that the bom can include git plugin 5.0.0 soon after the release of git plugin 5.0.0.