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

[JENKINS-50394] Add ability for JenkinsRule tests to insert custom GitClient implementation #420

Merged
merged 1 commit into from
Apr 11, 2019

Conversation

rsandell
Copy link
Member

@rsandell rsandell commented Apr 11, 2019

As what is returned from Git.getClient

JENKINS-50394 - When new commits are pushed to the repository while GitSCMSource is discovering branches then MissingObjectException

To be able to verify a fix for JENKINS-50394 I needed some way of detecting various phases in the descovery process of AbstractGitSCMSource, an easy way would be if I can use a custom "mocked" version of GitClient during the test that injects some more refs in the middle of the fetch/discoverBranches sequence.

Checklist

  • I have read the CONTRIBUTING doc
  • I have referenced the Jira issue related to my changes in one or more commit messages
  • I have added tests that verify my changes
  • Unit tests pass locally with my changes
  • I have added documentation as necessary
  • No Javadoc warnings were introduced with my changes
  • No spotbugs warnings were introduced with my changes

Types of changes

  • Infrastructure change (non-breaking change which updates dependencies or improves infrastructure)
  • New feature (non-breaking change which adds functionality)

Further comments

Added a guard so that this only activates during JenkinsRule tests so that normal production code won't be affected of able to be otherwise "persuaded".

Upstream to jenkinsci/git-plugin#702

…tClient implementation

As what is returned from Git.getClient
@rsandell
Copy link
Member Author

@rsandell rsandell closed this Apr 11, 2019
@rsandell rsandell reopened this Apr 11, 2019
Copy link
Contributor

@MarkEWaite MarkEWaite left a comment

Choose a reason for hiding this comment

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

Looks good to me. Won't merge it until the CI server passes tests.

@MarkEWaite MarkEWaite merged commit 8650b03 into jenkinsci:stable-2.7 Apr 11, 2019
@MarkEWaite MarkEWaite added the test Automated test addition or improvement label Jul 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test Automated test addition or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants