Skip to content

Commit

Permalink
Allowing prevously passed ats tests to skip (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
cssherman authored Apr 26, 2024
1 parent 7dc048f commit bd68266
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
8 changes: 7 additions & 1 deletion geos_ats_package/geos_ats/reporting.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class TestStepRecord:
class TestCaseRecord:
steps: dict
status: atsut._StatusCode
previous_status: atsut._StatusCode
test_number: int
elapsed: float
current_step: str
Expand Down Expand Up @@ -83,6 +84,7 @@ def __init__( self, test_steps ):
if test_name not in self.test_results:
self.test_results[ test_name ] = TestCaseRecord( steps={},
status=EXPECTED,
previous_status=t.options[ 'last_status' ],
test_number=test_id,
elapsed=0.0,
current_step=' ',
Expand All @@ -102,7 +104,11 @@ def __init__( self, test_steps ):
elapsed=elapsed )

# Check the status and the latest step
self.test_results[ test_name ].status = max_status( t.status, self.test_results[ test_name ].status )
if self.test_results[ test_name ].previous_status == PASSED:
self.test_results[ test_name ].status = PASSED
else:
self.test_results[ test_name ].status = max_status( t.status, self.test_results[ test_name ].status )

if t.status not in ( EXPECTED, CREATED, BATCHED, FILTERED, SKIPPED ):
self.test_results[ test_name ].current_step = t.name

Expand Down
7 changes: 6 additions & 1 deletion geos_ats_package/geos_ats/test_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import inspect
from configparser import ConfigParser
from ats import atsut
from ats import ( PASSED, FAILED, FILTERED, SKIPPED )
from ats import ( EXPECTED, PASSED, FAILED, FILTERED, SKIPPED )
from geos_ats.common_utilities import Error, Log, removeLogDirectories
from geos_ats.configuration_record import config, globalTestTimings

Expand Down Expand Up @@ -348,12 +348,17 @@ def testCreate( self ):
np=np,
ngpu=ngpu,
label=label,
last_status=str( self.last_status ),
serial=( not step.useMPI() and not config.script_launch ),
independent=self.independent,
batch=self.batch.enabled,
**kw )
atsTest.step_outputs = step.resultPaths()

# Override the status if previously passed
if self.last_status == PASSED:
atsTest.status = SKIPPED

# End the group
ats.tests.AtsTest.endGroup()

Expand Down

0 comments on commit bd68266

Please sign in to comment.