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

obs packages need a unified test framework

    Details

    • Epic Name:
      obs testing framework
    • Story Points:
      40
    • WBS:
      02C.03.05
    • Team:
      Alert Production
    • Cycle:
      Fall 2016

      Description

      The various obs* package test cases should derive from a set of parent TestCases, so that they all trivially have the same testing functionality. obs_decam has more tests written for it than most of the other packages, but most of those tests could be lifted into some higher package, with the obs_decam test looking like, e.g.

      ...boilerplate...
      class GetIdTestCase(obs_test_helper.tests.IdTestCase):
          def setUp(self):
              self.mapper = DecamMapper(root=".")
              super(GetIdTestCase, self).setUp()
              self.dataId = {'visit'=229388, 'ccdnum'=13, 'filter'='z'}
              self.result_id = 22938813'
      ...boilerplate...
      

      with all of the test* methods living obs_test_helper.tests.IdTestCase. This is just a sketch of a design, but I think it would both simplify deploying new obs packages and allow us to almost trivially improve testing coverage in the existing packages.

        Attachments

          Issue Links

          Stories in Epic (Custom Issue Matrix)

            Activity

            Hide
            tjenness Tim Jenness added a comment -

            Is it just tests that have lots of code duplication? I was under the impression that many of the obs_ packages share a lot of boiler plate that could be refactored into an obs_generic package.

            Show
            tjenness Tim Jenness added a comment - Is it just tests that have lots of code duplication? I was under the impression that many of the obs_ packages share a lot of boiler plate that could be refactored into an obs_generic package.
            Hide
            Parejkoj John Parejko added a comment - - edited

            Some code duplication, but more cases where tests don't exist in some packages and they totally should. For example, obs_cfht only has two tests, testButler.py and testColorterms, the latter of which is CFHT-specific. There are 4 tests in obs_decam that would be perfectly fine for obs_cfht, if setUp appropriately as I describe above.

            Having obs_generic would also be quite helpful, as there is certainly other boilerplate that could be lifted out of the obs packages. Doing the tests first would be a good start on that.

            Show
            Parejkoj John Parejko added a comment - - edited Some code duplication, but more cases where tests don't exist in some packages and they totally should. For example, obs_cfht only has two tests, testButler.py and testColorterms , the latter of which is CFHT-specific. There are 4 tests in obs_decam that would be perfectly fine for obs_cfht, if setUp appropriately as I describe above. Having obs_generic would also be quite helpful, as there is certainly other boilerplate that could be lifted out of the obs packages. Doing the tests first would be a good start on that.

              People

              • Assignee:
                Parejkoj John Parejko
                Reporter:
                Parejkoj John Parejko
                Watchers:
                Colin Slater, John Parejko, Michael Wood-Vasey, Simon Krughoff, Tim Jenness
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Summary Panel