Skip to content
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

WIP: bump parent pom to test JTH 2.46 #661

Closed
wants to merge 7 commits into from

Conversation

thomasgl-orange
Copy link

Following jenkinsci/jenkins-test-harness#89, jenkinsci/plugin-pom#93 and jenkinsci/git-client-plugin#393, here is a test PR to see how jenkinsci/git-plugin unit tests behave when there is a space character in their temporary workdir path.

Results are pretty good on my environment (Linux and recent git version), but for one worrisome test failure (GitSCMTest.testDataCompatibility1):

[ERROR] testDataCompatibility1(hudson.plugins.git.GitSCMTest)  Time elapsed: 9.92 s  <<< ERROR!
java.io.IOException: Failed to persist config.xml
	at hudson.model.ItemGroupMixIn.createProjectFromXML(ItemGroupMixIn.java:292)
	at jenkins.model.Jenkins.createProjectFromXML(Jenkins.java:3824)
	at hudson.plugins.git.GitSCMTest.testDataCompatibility1(GitSCMTest.java:1558)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48)
	at org.jvnet.hudson.test.JenkinsRule$1.evaluate(JenkinsRule.java:553)
	at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:298)
	at org.junit.internal.runners.statements.FailOnTimeout$CallableStatement.call(FailOnTimeout.java:292)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.lang.Thread.run(Thread.java:748)
Caused by: javax.xml.transform.TransformerException: java.io.FileNotFoundException: /home/lwjs1183/git/jenkins-git-plugin/target/tmp/j%20h6664057865101334020/jobs/foo/config.xml (No such file or directory)
	at org.apache.xalan.transformer.TransformerIdentityImpl.createResultContentHandler(TransformerIdentityImpl.java:297)
	at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:330)
	at jenkins.util.xml.XMLUtils._transform(XMLUtils.java:212)
	at jenkins.util.xml.XMLUtils.safeTransform(XMLUtils.java:84)
	at hudson.model.ItemGroupMixIn.createProjectFromXML(ItemGroupMixIn.java:272)
	... 17 more
Caused by: java.io.FileNotFoundException: /home/.../jenkins-git-plugin/target/tmp/j%20h6664057865101334020/jobs/foo/config.xml (No such file or directory)
	at java.io.FileOutputStream.open0(Native Method)
	at java.io.FileOutputStream.open(FileOutputStream.java:270)
	at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
	at java.io.FileOutputStream.<init>(FileOutputStream.java:101)
	at org.apache.xalan.transformer.TransformerIdentityImpl.createResultContentHandler(TransformerIdentityImpl.java:287)
	... 21 more

Note the URL-encoded space character in a Java File path.

I've not understood yet where it comes from, but at first glance it looks unlikely that it would be specific to this plugin unit tests, and it might rather be an issue in core...
I've tested with Jenkins 2.150.1 instead of 2.107.3, and got the same error.

Anyway, I'm opening this PR just to reproduce the issue and share with reviewers from jenkinsci/jenkins-test-harness#89.

@thomasgl-orange
Copy link
Author

Note on additional commits:

@thomasgl-orange
Copy link
Author

f2da193 overrides javax.xml.transform.TransformerFactory, to avoid the xalan version from being used. It fixes test failures. But as discussed in jenkinsci/jenkins-test-harness#89, it's not something that should be done like this in the plugin code itself, it should rather be done in JTH, or something similar

See discussion in jenkinsci/jenkins-test-harness#89, the plan is to disable Xalan-J JAXP self-registration by maven-shading it in jenkins-test-harness-htmlunit.

@jglick jglick changed the title WIP: bump parent pom to test JTH 2.45 WIP: bump parent pom to test JTH 2.46 Jan 22, 2019
@MarkEWaite MarkEWaite closed this Mar 9, 2019
@MarkEWaite MarkEWaite added the skip-changelog Exclude from the changelog label Jul 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip-changelog Exclude from the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants