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

getSharedLibraryVariables doesn't handle paths with spaces. #101

Open
camara-tech opened this issue May 21, 2021 · 1 comment
Open

getSharedLibraryVariables doesn't handle paths with spaces. #101

camara-tech opened this issue May 21, 2021 · 1 comment
Assignees

Comments

@camara-tech
Copy link

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

  1. checkout the jenkins-spock repository to a folder with a space in it (e.g. /home/user/source code/jenkins-spock)
  2. 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.

@awittha
Copy link
Contributor

awittha commented Aug 17, 2021

Could you share line numbers of the locations where the File object's taking in a path with url encoding?

@awittha awittha self-assigned this Aug 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants