-
Notifications
You must be signed in to change notification settings - Fork 72
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
Migrate snippet generator tests from workflow-cps #27
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Create a freestyle project parameterized
with a boolean parameter named x
. Create a Pipeline job. In the Pipeline Syntax page, select build
and type in parameterized
in the Project to Build field. A checkbox labeled x will appear, and Generate Pipeline Script will produce
build job: 'parameterized', parameters: [booleanParam(name: 'x', value: false)]
With the newInstance
override removed, the generated script is
build 'parameterized'
I think https://github.com/jenkinsci/workflow-cps-plugin/blob/609bc51d4cca65e8c851cdbc05a3f0efd8d60638/src/test/java/org/jenkinsci/plugins/workflow/cps/SnippetizerTest.java#L203-L238 are the relevant tests. Possibly I forgot to move them from jenkinsci/pipeline-plugin#69 + jenkinsci/pipeline-plugin#190 during the 2.x split. |
Now I'm extra confused, because |
src/test/java/org/jenkinsci/plugins/workflow/support/steps/build/BuildTriggerStepTest.java
Outdated
Show resolved
Hide resolved
Ah, whoops, I missed those, was only looking at |
It looks like tests pass and the snippet generator works correctly even without this override, so I'm not sure what it's for. If it turns out it is necessary, I'd like to add a test and/comment explaining what it is here for.
EDIT: In the end, just migrating some tests from workflow-cps, see jenkinsci/workflow-cps-plugin#304.