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

Migrating Tests From JUnit 3 (GitAPITesCase) to JUnit 4 (GitAPITest) #675

Merged
merged 25 commits into from
Feb 25, 2021

Conversation

GAyan17
Copy link
Contributor

@GAyan17 GAyan17 commented Feb 24, 2021

JENKINS-60940 - Migrating Tests From JUnit 3 (GitAPITesCase) to JUnit 4 (GitAPITest)

Describe the big picture of your changes here to explain to the maintainers why this pull request should be accepted.
If it fixes a bug or resolves a feature request, include a link to the issue.

Tests Migrated in this PR:

  • PushTags
  • ListBranches
  • ListRemoteBranches
  • RemoteListTagsWithFilter
  • RemoteListTagsWithoutFilter
  • CreateTag
  • revparse SHA 1 HEAD or Tag
  • revparse throws expected exception
  • Has Git Repo With Invalid Repo
  • Push
  • Notes Add First Note
  • Notes Append First Note
  • Prune
  • revlist All
  • revlist_
  • revlist First Parent
  • revlist
  • Merge Strategy
  • Merge Strategy Correct Fail
  • Merge Fast Forward Mode FF
  • Merge Fast Forward Mode FF Only

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. This is simply a reminder of what we are going to look for before merging your code.

  • 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

What types of changes does your code introduce? Put an x in the boxes that apply

  • Test (non-breaking change which updates dependencies or improves infrastructure)

Further comments

  • Used GitSampleRepo class for temporary repo directory for the WorkingWithRepo workspace as a Rule, this made easier for creating multiple workspaces as used in some tests.
  • Implemented a separate function initializeWorkspace() to initialize the workspace with basic git initialization, also it made initialization of remote and bare workspaces easier.
  • Added a separate file GitAPITestForInvalidRepo so that the tests which doesn't need a working workspace can be implemented.

@MarkEWaite MarkEWaite added the test Automated test addition or improvement label Feb 24, 2021
MarkEWaite added a commit to MarkEWaite/bom that referenced this pull request Sep 2, 2021
Git client plugin 3.6.0 does not include
jenkinsci/git-client-plugin#675 that resolves a
test failure with command line git 2.33 and later.  Git client plugin
3.7.0 and later include that fix.

Git client plugin 3.6.0 also does not include the change for git LFS
execution on ci.jenkins.io.

This exclusion will no longer be needed when the bom drops support for
2.249.x.
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
2 participants