Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-60940

Convert git client plugin tests from JUnit 3 to JUnit 4

    Details

    • Similar Issues:

      Description

      The git client plugin tests have started their transition process to retire the JUnit 3 based GitAPITestCase, CliGitAPIImplTest, and JGitAPIImplTest. They should be replaced by the parameterized GitClientTest.

      For each test in GitAPITestCase, CliGitAPIImplTest, and JGitAPIImplTest:

      • If it is already tested in GitClientTest, delete the test from the JUnit 3 based tests
      • If it is not already tested in GitClientTest, write a test in GitClientTest or in a new test class and delete the test from the JUnit 3 based tests

      This issue could be worked by multiple people concurrently, so long as they coordinate with one another on the specific tests they are converting.

        Attachments

          Activity

          Hide
          markewaite Mark Waite added a comment -

          Loghi Perinpanayagam I like the suggestion from Rishabh Budhouliya to review the test names and the test assertions.

          Some assertions are not immediately visible (like the assertion of expected job status in the build() calls, but assertions are a very useful way to avoid losing knowledge in the transition from JUnit 3 to JUnit 4.

          Show
          markewaite Mark Waite added a comment - Loghi Perinpanayagam I like the suggestion from Rishabh Budhouliya to review the test names and the test assertions. Some assertions are not immediately visible (like the assertion of expected job status in the build() calls, but assertions are a very useful way to avoid losing knowledge in the transition from JUnit 3 to JUnit 4.
          Hide
          loghijiaha Loghi Perinpanayagam added a comment -

          Great thanks. Mark Waite and Rishabh Budhouliya I check it out. I think most of the test cases lie on GitAPITestCase. @NotImplementedInJGit annotations are helping to identify the relevant tests in my case.

          Show
          loghijiaha Loghi Perinpanayagam added a comment - Great thanks. Mark Waite and Rishabh Budhouliya I check it out. I think most of the test cases lie on GitAPITestCase. @NotImplementedInJGit annotations are helping to identify the relevant tests in my case.
          Hide
          darkphoenix17 Karan Mistry added a comment -

          Mark Waite Loghi Perinpanayagam Rishabh Budhouliya I will like to work on it!!

          I will do the remaining part which is GitAPITestCase!!

          Show
          darkphoenix17 Karan Mistry added a comment - Mark Waite Loghi Perinpanayagam Rishabh Budhouliya I will like to work on it!! I will do the remaining part which is GitAPITestCase !!
          Hide
          rishabhbudhouliya Rishabh Budhouliya added a comment - - edited

          Karan Mistry Great. I'd like to list some steps you can perform to do so: 

          • Look at GitClientTest, GitClientCliTest, GitClientCloneTest and GitClientFetchTest to understand the JUnit 3 to 4 transition of git client test cases. You can start with any of these classes if it seems too much at first (I'll recommend GitClientTest)
          • The transition involves using JUnit 4 APIs instead of JUnit 3 and avoiding the usage of `WorkingArea` (it provides the ability to create a temporary local workspace for git operations). We have tried using `WorkspaceWithRepo` to serve as a replacement for `WorkingArea`.
          • Feel free to ask any questions on the [gitter channel|https://gitter.im/jenkinsci/git-plugin] for the git plugin. Mark Waite and I would be more than happy to help!
          Show
          rishabhbudhouliya Rishabh Budhouliya added a comment - - edited Karan Mistry Great. I'd like to list some steps you can perform to do so:  Look at GitClientTest, GitClientCliTest, GitClientCloneTest and GitClientFetchTest to understand the JUnit 3 to 4 transition of git client test cases. You can start with any of these classes if it seems too much at first (I'll recommend GitClientTest) The transition involves using JUnit 4 APIs instead of JUnit 3 and avoiding the usage of `WorkingArea` (it provides the ability to create a temporary local workspace for git operations). We have tried using `WorkspaceWithRepo` to serve as a replacement for `WorkingArea`. Feel free to ask any questions on the [gitter channel| https://gitter.im/jenkinsci/git-plugin ] for the git plugin . Mark Waite and I would be more than happy to help!
          Hide
          darkphoenix17 Karan Mistry added a comment -
          Show
          darkphoenix17 Karan Mistry added a comment - Sure Rishabh Budhouliya

            People

            • Assignee:
              Unassigned
              Reporter:
              markewaite Mark Waite
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: