Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Listen to checkout instead of on started. #13
Listen to checkout instead of on started. #13
Changes from 2 commits
ab606af
430aab9
072aabf
cbeae0e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
The Codecov annotation is really nice 🥰
I think this is a good topic for a thesis for one of my students that can be based on the new Coverage and Checks API plugins...
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.
Is it a problem if this method will be invoked multiple times in a job? E.g., a job may have several SCM checkouts. I'm not sure how our CI is configured, but from https://ci.jenkins.io/job/Plugins/job/analysis-model/job/master/984/ it looks like we have 2 checkouts for each job.
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.
is there a way to inject an extension to Jenkins in integration test?
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.
I wonder why there are two checkouts so that I can reproduce that and test.
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.
Yes you can have a static inner class annotated with TestExtension.
Our jobs should be just checking out the shared library and the repo.
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.
I didn't find a better way to test the listeners than adding log information (maybe fine level) and then check the log, but I don't know if this is a good practice to add such log information for tests.
I don't understand this, should we do any other works (check whether the checkout is about the shared library or the repo) in this
onCheckout
method?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.
should be fine.
re: testing,
I wouldn't worry about testing listeners get invoked that's tested by Jenkins, if there's logic in it you should test that separately by just passing required params and checking it does what is expected