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

Improve priority sorter plugin automated test coverage

      Increase automated test coverage

      Automated test coverage of the priority sorter plugin is low. Improve the automated test coverage by submitting pull requests with new automated tests.

      Review current coverage

      Review the current test coverage with the commands:

      Linux

      $ mvn -P enable-jacoco clean install jacoco:report
      $ xdg-open target/site/jacoco/index.html
      

      Windows

      C:\Users\Yourname > mvn -P enable-jacoco clean install jacoco:report
      C:\Users\Yourname > start target\site\jacoco\index.html
      

      More information is in the "code coverage" section of the contributing guide.

      Create a new test for a class that is not well covered

      Most integrated development environments have tools that will create a test stub that is a good beginning. Apache Netbeans has "Create / Update tests" . JetBrains IntelliJ has "Create tests". Visual Studio Code has the "Extension Pack for Java".

      Use the IDE or your own coding to create a test for one of the classes that is not well covered by tests.

      Keep the test small so that the pull request is easy to review.

          [JENKINS-69757] Improve priority sorter plugin automated test coverage

          Udit added a comment -

          Hello markewaite, I would like to work on this new feature task
          Can you assign this to me?

           

          Udit added a comment - Hello markewaite , I would like to work on this new feature task Can you assign this to me?  

          Mark Waite added a comment -

          udit_damare you're welcome to work on it. I would love to have the contributions.

          I don't assign issues to individuals in general because in far too many cases the individual says they are interested then they don't contribute a pull request to actually work on the issue. Your comment "I would like to work on this task" is already enough that others who might be interested in the task will know that they need to coordinate efforts here. If we have multiple people working on the issue, we'll coordinate by dividing the classes to test or by some other partitioning of the effort. That has not been a problem yet.

          Mark Waite added a comment - udit_damare you're welcome to work on it. I would love to have the contributions. I don't assign issues to individuals in general because in far too many cases the individual says they are interested then they don't contribute a pull request to actually work on the issue. Your comment "I would like to work on this task" is already enough that others who might be interested in the task will know that they need to coordinate efforts here. If we have multiple people working on the issue, we'll coordinate by dividing the classes to test or by some other partitioning of the effort. That has not been a problem yet.

          Huikun added a comment -

          Huikun added a comment - I have proposed the PR. https://github.com/jenkinsci/priority-sorter-plugin/pull/259

          Yash added a comment -

          Hey markewaite does this plugin require work maybe I can help write more tests to increase the coverage

          Yash added a comment - Hey markewaite does this plugin require work maybe I can help write more tests to increase the coverage

          Mark Waite added a comment -

          does this plugin require work?

          yash_21 thanks for asking. Yes, it does need more automated tests.. The current test coverage is reported on ci.jenkins like this:

          I generally won't close a test coverage issue until the line coverage is at least 80% and the branch coverage is at least 80%..

          Writing automated tests is a great way to practice using a Java debugger to better understand code. That benefits you. The additional tests help us keep the plugin in good condition for future changes. That benefits the Jenkins project.

          Mark Waite added a comment - does this plugin require work? yash_21 thanks for asking. Yes, it does need more automated tests.. The current test coverage is reported on ci.jenkins like this: I generally won't close a test coverage issue until the line coverage is at least 80% and the branch coverage is at least 80%.. Writing automated tests is a great way to practice using a Java debugger to better understand code. That benefits you. The additional tests help us keep the plugin in good condition for future changes. That benefits the Jenkins project.

          Yash added a comment -

          Hey markewaite would you like the same tests-type as used in the nodelabelparameter plugin i.e. use of Jenkins Rule or would you also like Mock objects to be used in these tests for these classes?

            

          Yash added a comment - Hey markewaite would you like the same tests-type as used in the nodelabelparameter plugin i.e. use of Jenkins Rule or would you also like Mock objects to be used in these tests for these classes?   

          Mark Waite added a comment -

          I prefer JenkinsRule as much as can reasonably be done.

          Mark Waite added a comment - I prefer JenkinsRule as much as can reasonably be done.

          Yash added a comment -

          Yash added a comment - I have made a PR for  this: https://github.com/jenkinsci/priority-sorter-plugin/pull/416

            Unassigned Unassigned
            markewaite Mark Waite
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: