# obs packages need a unified test framework

XMLWordPrintable

#### Details

• Type: Epic
• Status: Done
• Resolution: Done
• Fix Version/s: None
• Component/s:
• Labels:
• Epic Name:
obs testing framework
• Story Points:
40
• WBS:
02C.03.05
• Team:
• 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.

#### Stories in Epic (Custom Issue Matrix)

Key Summary Story Points Assignee Status

DM-8076 0.5 John Parejko Done

DM-7578 8 John Parejko Done

DM-7949 0.5 John Parejko Done

DM-7915 4 John Parejko Done

DM-7731 4 Unassigned Won't Fix

#### Activity

Hide
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
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
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
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:
John Parejko
Reporter:
John Parejko
Watchers:
Colin Slater, John Parejko, Michael Wood-Vasey, Simon Krughoff, Tim Jenness