Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allowing previously passed ats tests to skip execution #15

Merged
merged 1 commit into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Comment on lines +107 to +108
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously passed tests will report skipped instead of passed, so set the correct status here

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Maybe we should set a dedicated status called PREVIOUSLY_PASSED ? Or are these values predefined by ats?

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
Loading