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

Add support for mocking library with mapped args #422

Merged

Conversation

nre-ableton
Copy link
Contributor

This PR adds support for mocking the library step when called with mapped arguments.

Fixes #418, FYI @dblock

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

@dblock
Copy link
Member

dblock commented Nov 11, 2021

Amazing! Thanks

@nre-ableton
Copy link
Contributor Author

@dblock regarding the scm and legacySCM parts of your original issue, is this PR enough? Or does it need something else to also cover those?

def lib = library(identifier: 'commons', changelog: false)
def utils = lib.net.courtanet.jenkins.Utils.new()
sh "${utils.gitTools()}"
sh 'sleep 3'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What’s this sleep about? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dunno, I just copy/pasted it from another library test. 🙈 However, let's keep things simple; I'll remove the line (see fixup).

@dblock
Copy link
Member

dblock commented Nov 11, 2021

@dblock regarding the scm and legacySCM parts of your original issue, is this PR enough? Or does it need something else to also cover those?

I think it’s definitely enough and we can add later the other stubs. I am not super familiar whether one expects scm or legacySCM to always be defined. If so we probably want those too.

@nre-ableton
Copy link
Contributor Author

@dblock regarding the scm and legacySCM parts of your original issue, is this PR enough? Or does it need something else to also cover those?

I think it’s definitely enough and we can add later the other stubs. I am not super familiar whether one expects scm or legacySCM to always be defined. If so we probably want those too.

scm should (and is) defined. I have no idea about legacySCM -- I don't find it in the pipeline steps docs, nor in the snippet generator. Let's ignore it out for now. In the meantime, I'll squash and merge this branch, and probably prepare a release sometime next week.

@nre-ableton nre-ableton force-pushed the nre/master/mock-library-with-map-args branch from b922359 to 34f1130 Compare November 11, 2021 13:52
@nre-ableton nre-ableton merged commit b98144e into jenkinsci:master Nov 11, 2021
@nre-ableton nre-ableton deleted the nre/master/mock-library-with-map-args branch November 11, 2021 15:02
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

Successfully merging this pull request may close these issues.

Mock library that takes map args
2 participants