-
Notifications
You must be signed in to change notification settings - Fork 399
[JENKINS-70303] Remove leading and trailing spaces from refspec #1096
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
base: master
Are you sure you want to change the base?
Changes from 6 commits
62b403a
cb65539
2b04ed4
bce6f58
31ecb75
01afbe3
4dabf5e
03f01ff
b9f95b0
3fb3ae2
9847dfe
08cb1eb
69e5269
ef865e4
76b416c
021801a
034c027
88420e2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,6 +40,7 @@ | |
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.junit.runners.Parameterized; | ||
import org.jvnet.hudson.test.Issue; | ||
|
||
@RunWith(Parameterized.class) | ||
public class GitClientCloneTest { | ||
|
@@ -328,11 +329,16 @@ public void test_clone_refspec() throws Exception { | |
})); | ||
} | ||
|
||
private String randomSpace() { | ||
return random.nextBoolean() ? " " : ""; | ||
} | ||
|
||
@Test | ||
@Issue("JENKINS-70303") // spaces at start or end of refspec should be ignored | ||
public void test_clone_refspecs() throws Exception { | ||
List<RefSpec> refspecs = Arrays.asList( | ||
new RefSpec("+refs/heads/master:refs/remotes/origin/master"), | ||
new RefSpec("+refs/heads/1.4.x:refs/remotes/origin/1.4.x")); | ||
new RefSpec(randomSpace() + "+refs/heads/master:refs/remotes/origin/master" + randomSpace()), | ||
new RefSpec(randomSpace() + "+refs/heads/1.4.x:refs/remotes/origin/1.4.x" + randomSpace())); | ||
Comment on lines
+340
to
+341
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This may be exactly the wrong place for this type of test. We generally prefer tests that are nearer to what a user would do. This is changing an argument to the RefSpec constructor when the real end user provides a string into a data entry field on a Jenkins form or they provide a string to an option of a Pipeline There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The test case did pass in my local. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Which test case tests the Pipeline There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think that we'll be able to test Pipeline checkout from this plugin because it would require a dependency on the git plugin. That would result in a circular dependency, since the git plugin depends on this plugin. We'll need to test interactively. |
||
testGitClient | ||
.clone_() | ||
.url(workspace.localMirror()) | ||
|
Uh oh!
There was an error while loading. Please reload this page.