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

When the Jenkinsfile is renamed and the path in the test is adjusted the test fails #7

Open
030 opened this issue Dec 1, 2017 · 1 comment

Comments

@030
Copy link

030 commented Dec 1, 2017

When Jenkinsfile was renamed, e.g. x.jenkins and the path in the test as well, the gradle build fails:

when cloned:

gradle clean build

BUILD SUCCESSFUL in 8s
4 actionable tasks: 4 executed

when Jenkinsfile renamed

gradle clean build

> Task :test 

tests.job.JenkinsfileTestSpec > Jenkinsfile should run gradle tests with expected command line validate:null gradle: null FAILED
    groovy.util.ResourceException at JenkinsfileTestSpec.groovy:26
        Caused by: groovy.util.ResourceException at JenkinsfileTestSpec.groovy:26

Then I thought perhaps there is another jenkins file. This was the case, i.e. ./exampleJobs/parallel/Jenkinsfile and when this was renamed the issue persisted.

Should all Jenkins. entries that reside in the test files be renamed as well?

@macg33zr
Copy link
Owner

If you rename the Jenkinsfile at the top level say to something like "Foo.groovy" you will need to look for the lines in the tests like "runScript('Jenkinsfile')" and change to "runScript('Foo.groovy')". Also, for tests that assert the pipeline call stacks to a file using 'testNonRegression', the content of all these call stack files will need updating for lines like 'Jenkinsfile.pipeline(groovy.lang.Closure)' which would become 'Foo.pipeline(groovy.lang.Closure)' (these are the files under 'tests/callstacks'. You don't need to update these call stack files manually though, you can go into the gradle.properties file and set 'pipeline.stack.write=true' then run all the tests and review the changes. Does this answer it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants