jenkins-spock
jenkins-spock copied to clipboard
getSharedLibraryVariables doesn't handle paths with spaces.
Expected Behavior
When Running the tests for the Shared Library example from a path that contains a space in it, then all the tests should pass.
Actual Behavior
Those tests for verifying "Deployer.call" all fail with
DefaultPipelineSpec > Attempts to deploy MASTER branch to PRODUCTION FAILED
java.lang.IllegalStateException: There is no pipeline step mock for [Deployer.call].
1. Is the name correct?
2. Does the pipeline step have a descriptor with that name?
3. Does that step come from a plugin? If so, is that plugin listed as a dependency in your pom.xml?
4. If not, you may need to call explicitlyMockPipelineStep('Deployer.call') in your test's setup: block.
at com.homeaway.devtools.jenkins.testing.JenkinsPipelineSpecification.getPipelineMock(JenkinsPipelineSpecification.groovy:803)
at DefaultPipelineSpec.Attempts to deploy MASTER branch to PRODUCTION(DefaultPipelineSpec.groovy:39)
DefaultPipelineSpec > Does NOT attempt to deploy non-MASTER branch PRODUCTION FAILED
java.lang.IllegalStateException: There is no pipeline step mock for [Deployer.call].
1. Is the name correct?
2. Does the pipeline step have a descriptor with that name?
3. Does that step come from a plugin? If so, is that plugin listed as a dependency in your pom.xml?
4. If not, you may need to call explicitlyMockPipelineStep('Deployer.call') in your test's setup: block.
at com.homeaway.devtools.jenkins.testing.JenkinsPipelineSpecification.getPipelineMock(JenkinsPipelineSpecification.groovy:803)
at DefaultPipelineSpec.Does NOT attempt to deploy non-MASTER branch PRODUCTION(DefaultPipelineSpec.groovy:48)
Steps to Reproduce
- checkout the jenkins-spock repository to a folder with a space in it (e.g. /home/user/source code/jenkins-spock)
- Run the tests in the shared library example
Additional Information
Based on some debugging that I did, the path that is being used in getSharedLibraryVariables contains url-encoded spaces (e.g. "%20"). The File object does not handle decoding them and returns null as expected, leading to this behavior.
Could you share line numbers of the locations where the File object's taking in a path with url encoding?