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

Investigate using the DSL of jenkins-client-plugin #146

Closed
michaelsauter opened this issue Oct 25, 2019 · 9 comments
Closed

Investigate using the DSL of jenkins-client-plugin #146

michaelsauter opened this issue Oct 25, 2019 · 9 comments
Labels
question Further information is requested

Comments

@michaelsauter
Copy link
Member

Instead of shelling out to the oc binary we might be better of using the DSL of https://github.com/openshift/jenkins-client-plugin. This plugin is already installed in the Jenkins master.

Thanks @oalyman for the suggestion.

One downside of using that plugin is that it is harder to try out changes - instead of being able to play with commands in the terminal, right now I don't see a way other than running a pipeline to experiment with the DSL.

@michaelsauter michaelsauter added the question Further information is requested label Oct 25, 2019
@tjaeschke
Copy link
Member

tjaeschke commented Oct 25, 2019

As far as I remember we started with this, but changed to oc, because of missing support for some features. I'm not sure what was missing and if this is still valid in the current version. @rattermeyer Do you remember, what had been missing? I have the oc patch in mind, but I'm not sure.

@michaelsauter
Copy link
Member Author

@tjaeschke Ah! As far as I understand the DSL allows to fallback to "raw" commands for such cases.

@tjaeschke
Copy link
Member

@michaelsauter This would be good. Hm, for experimenting locally with Jenkinsfiles I often use https://github.com/jenkinsci/jenkinsfile-runner since @ungerts recommended it to me a few months ago.

@michaelsauter
Copy link
Member Author

@tjaeschke Awesome! I will definitely check this out. Maybe we can use this for tests as well?

@tjaeschke
Copy link
Member

@michaelsauter I think so. On my agenda is also to take a look at https://github.com/jenkinsci/JenkinsPipelineUnit

@metmajer
Copy link
Member

metmajer commented Oct 25, 2019

@tjaeschke @michaelsauter we've successfully implemented roughly 200 unit tests for the MRO shared lib using just Spock. Why? Because when looking at frameworks targeted at pipeline unit testing, they had their fair share of limitations and had no major benefits over going with a solid general testing framework.

Also, it would be beneficial to settle on one approach for a type of tests. @tjaeschke know of a good framework for running integration tests against a live Jenkins instance?

@tjaeschke
Copy link
Member

@metmajer I'm with you using Spock for unit testing. Unfortunately I didn't find any good framework for integration tests, that satisfied me, yet.

@rattermeyer
Copy link
Member

oc patch was one thing. And having a complete mixture of DSL and raw things, we decided for one solution.
If looking, what seems to be available today (need still to check which version is included in the OpenShift images), using the DSL would be a real option.

@michaelsauter
Copy link
Member Author

Everything has been moved into OpenShiftService.groovy, and right now I don't see issues with that approach so I'll close this for now.

michaelsauter pushed a commit to BIX-Digital/ods-jenkins-shared-library that referenced this issue Apr 27, 2020
Add UTC timestamps prefix to log lines in Pipelinesteps.echo command
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants