Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-11725

Add coverage testing of unittest

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: sconsUtils
    • Labels:
      None
    • Story Points:
      3
    • Team:
      Architecture

      Description

      The pytest-cov plugin should be enabled to write coverage reports from unit testing. This ticket covers the work to enable per-product coverage testing solely from the unittests associated with that product. This can be enabled as part of normal test execution. It is possible to write coverage results to html, the terminal and XML. XML is needed for Jenkins support – it may be desirable to default to HTML and terminal reporting but allow Jenkins to enable XML output via an environment variable.

        Attachments

          Issue Links

            Activity

            Hide
            tjenness Tim Jenness added a comment -

            I've pushed some test code to experiment with this test coverage.

            Show
            tjenness Tim Jenness added a comment - I've pushed some test code to experiment with this test coverage.
            Hide
            tjenness Tim Jenness added a comment -

            John Parejko Thanks for agreeing to look at this. I was delaying merging this because I wasn't entirely sure what Joshua Hoblitt wants to do with the coverage output on Jenkins. I think to first order we can enable it without having to decide how people see the output on Jenkins.

            Show
            tjenness Tim Jenness added a comment - John Parejko Thanks for agreeing to look at this. I was delaying merging this because I wasn't entirely sure what Joshua Hoblitt wants to do with the coverage output on Jenkins. I think to first order we can enable it without having to decide how people see the output on Jenkins.
            Hide
            jhoblitt Joshua Hoblitt added a comment -

            I wasn't aware that I was blocking this ticket. I was waiting for it be enabled before implementing reporting on the jenkins side; this is the critical path direction that is in jira as well.

            Show
            jhoblitt Joshua Hoblitt added a comment - I wasn't aware that I was blocking this ticket. I was waiting for it be enabled before implementing reporting on the jenkins side; this is the critical path direction that is in jira as well.
            Hide
            tjenness Tim Jenness added a comment -

            Don't worry about it. It was a long time ago and I think I was at the point of wanting to discuss options with you but then got distracted.

            Show
            tjenness Tim Jenness added a comment - Don't worry about it. It was a long time ago and I think I was at the point of wanting to discuss options with you but then got distracted.
            Hide
            rowen Russell Owen added a comment -

            This looks like a useful addition. I had some requests for clarification and doc fixes on github, but nothing major

            Show
            rowen Russell Owen added a comment - This looks like a useful addition. I had some requests for clarification and doc fixes on github, but nothing major
            Hide
            tjenness Tim Jenness added a comment - - edited

            I have updated the code based on John Parejko's review on GitHub. He reports on Slack that he is okay with writing coverage HTML files into tests/.test/pytest-PACKAGE.xml-htmlcov/ – this simplifies the code path significantly since it can now use the SCons ${TARGET} scheme. I am currently running a Jenkins job and will merge when that completes.

            Show
            tjenness Tim Jenness added a comment - - edited I have updated the code based on John Parejko 's review on GitHub. He reports on Slack that he is okay with writing coverage HTML files into tests/.test/pytest-PACKAGE.xml-htmlcov/ – this simplifies the code path significantly since it can now use the SCons ${TARGET} scheme. I am currently running a Jenkins job and will merge when that completes.
            Hide
            tjenness Tim Jenness added a comment -

            Coverage is now enabled. The next step is to integrate the output into Jenkins.

            Show
            tjenness Tim Jenness added a comment - Coverage is now enabled. The next step is to integrate the output into Jenkins.

              People

              Assignee:
              tjenness Tim Jenness
              Reporter:
              tjenness Tim Jenness
              Reviewers:
              John Parejko
              Watchers:
              Gabriele Comoretto [X] (Inactive), John Parejko, Joshua Hoblitt, Kian-Tat Lim, Russell Owen, Tim Jenness
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Jenkins

                  No builds found.