Skip to content

Commit bd68266

Browse files
authored
Allowing prevously passed ats tests to skip (#15)
1 parent 7dc048f commit bd68266

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

geos_ats_package/geos_ats/reporting.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ class TestStepRecord:
4646
class TestCaseRecord:
4747
steps: dict
4848
status: atsut._StatusCode
49+
previous_status: atsut._StatusCode
4950
test_number: int
5051
elapsed: float
5152
current_step: str
@@ -83,6 +84,7 @@ def __init__( self, test_steps ):
8384
if test_name not in self.test_results:
8485
self.test_results[ test_name ] = TestCaseRecord( steps={},
8586
status=EXPECTED,
87+
previous_status=t.options[ 'last_status' ],
8688
test_number=test_id,
8789
elapsed=0.0,
8890
current_step=' ',
@@ -102,7 +104,11 @@ def __init__( self, test_steps ):
102104
elapsed=elapsed )
103105

104106
# Check the status and the latest step
105-
self.test_results[ test_name ].status = max_status( t.status, self.test_results[ test_name ].status )
107+
if self.test_results[ test_name ].previous_status == PASSED:
108+
self.test_results[ test_name ].status = PASSED
109+
else:
110+
self.test_results[ test_name ].status = max_status( t.status, self.test_results[ test_name ].status )
111+
106112
if t.status not in ( EXPECTED, CREATED, BATCHED, FILTERED, SKIPPED ):
107113
self.test_results[ test_name ].current_step = t.name
108114

geos_ats_package/geos_ats/test_case.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import inspect
77
from configparser import ConfigParser
88
from ats import atsut
9-
from ats import ( PASSED, FAILED, FILTERED, SKIPPED )
9+
from ats import ( EXPECTED, PASSED, FAILED, FILTERED, SKIPPED )
1010
from geos_ats.common_utilities import Error, Log, removeLogDirectories
1111
from geos_ats.configuration_record import config, globalTestTimings
1212

@@ -348,12 +348,17 @@ def testCreate( self ):
348348
np=np,
349349
ngpu=ngpu,
350350
label=label,
351+
last_status=str( self.last_status ),
351352
serial=( not step.useMPI() and not config.script_launch ),
352353
independent=self.independent,
353354
batch=self.batch.enabled,
354355
**kw )
355356
atsTest.step_outputs = step.resultPaths()
356357

358+
# Override the status if previously passed
359+
if self.last_status == PASSED:
360+
atsTest.status = SKIPPED
361+
357362
# End the group
358363
ats.tests.AtsTest.endGroup()
359364

0 commit comments

Comments
 (0)