From aba34198d1ee53ef7364d5ef214adb298e1c63b0 Mon Sep 17 00:00:00 2001 From: Christopher Sherman Date: Fri, 31 May 2024 10:59:23 -0700 Subject: [PATCH 1/3] Adding failrun status to geos_ats --- .../geos_ats/helpers/log_check.py | 22 ++++++++++++++++--- geos_ats_package/geos_ats/reporting.py | 9 ++++++-- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/geos_ats_package/geos_ats/helpers/log_check.py b/geos_ats_package/geos_ats/helpers/log_check.py index ce324044..b73ddfce 100644 --- a/geos_ats_package/geos_ats/helpers/log_check.py +++ b/geos_ats_package/geos_ats/helpers/log_check.py @@ -49,9 +49,11 @@ def log_check( fname: str, yaml_file: str, ignored: Iterable[ str ] ) -> None: Nignore = 0 ignore_names = [] Nfail = 0 - status_fail = [ 'timedout', 'halted', 'lsferror', 'failed' ] + Nfailrun = 0 + status_fail = [ 'timedout', 'halted', 'lsferror', 'failed', 'failrun' ] overall_status = 'PASSED' fail_names = [] + failrun_names = [] print( '=======================' ) print( 'Integrated test results' ) @@ -69,12 +71,18 @@ def log_check( fname: str, yaml_file: str, ignored: Iterable[ str ] ) -> None: print( f'{status_code}: {Na} ({Nb} ignored)' ) else: print( f'{status_code}: {Na}' ) - Nfail += Na - fail_names.extend( tmp_a ) Nignore += Nb ignore_names.extend( tmp_b ) + if ( status_code == 'failrun' ): + Nfailrun += Na + failrun_names.extend( tmp_a ) + else: + Nfail += Na + fail_names.extend( tmp_a ) + else: print( f'{status_code}: {Na+Nb}' ) + else: print( f'{status_code}: 0' ) @@ -93,6 +101,14 @@ def log_check( fname: str, yaml_file: str, ignored: Iterable[ str ] ) -> None: for name in sorted( fail_names, key=lambda v: v.lower() ): print( name ) + if Nfailrun: + overall_status = 'FAIL RUN' + print( '=======================' ) + print( 'Run failures' ) + print( '=======================' ) + for name in sorted( failrun_names, key=lambda v: v.lower() ): + print( name ) + print( '=======================' ) print( f'Overall status: {overall_status}' ) print( '=======================' ) diff --git a/geos_ats_package/geos_ats/reporting.py b/geos_ats_package/geos_ats/reporting.py index 9222cb65..861fd637 100644 --- a/geos_ats_package/geos_ats/reporting.py +++ b/geos_ats_package/geos_ats/reporting.py @@ -18,7 +18,8 @@ logger = logging.getLogger( 'geos_ats' ) # Status value in priority order -STATUS = ( EXPECTED, CREATED, BATCHED, FILTERED, SKIPPED, RUNNING, PASSED, TIMEDOUT, HALTED, LSFERROR, FAILED ) +FAILRUN = atsut.StatusCode( 'FAILRUN' ) +STATUS = ( EXPECTED, CREATED, BATCHED, FILTERED, SKIPPED, RUNNING, PASSED, TIMEDOUT, HALTED, LSFERROR, FAILED, FAILRUN ) COLORS: Mapping[ str, str ] = { EXPECTED.name: "black", @@ -32,6 +33,7 @@ HALTED.name: "brown", LSFERROR.name: "brown", FAILED.name: "red", + FAILRUN.name: "magenta", } @@ -102,7 +104,10 @@ def __init__( self, test_steps ): self.test_results[ test_name ].elapsed += elapsed # Add the step - self.test_results[ test_name ].steps[ t.name ] = TestStepRecord( status=t.status, + s = t.status + if ( 'geosx' in t.name ) and ( s == FAILED ): + s = FAILRUN + self.test_results[ test_name ].steps[ t.name ] = TestStepRecord( status=s, log=t.outname, output=t.step_outputs, number=t.groupSerialNumber, From 018f0ad575f6f1edc59190aee5edd0a98a757ced Mon Sep 17 00:00:00 2001 From: Christopher Sherman Date: Fri, 31 May 2024 16:07:34 -0700 Subject: [PATCH 2/3] Using INVALID as FAILRUN in geos_ats --- geos_ats_package/geos_ats/helpers/log_check.py | 4 ++-- geos_ats_package/geos_ats/reporting.py | 11 +++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/geos_ats_package/geos_ats/helpers/log_check.py b/geos_ats_package/geos_ats/helpers/log_check.py index b73ddfce..ade97573 100644 --- a/geos_ats_package/geos_ats/helpers/log_check.py +++ b/geos_ats_package/geos_ats/helpers/log_check.py @@ -50,7 +50,7 @@ def log_check( fname: str, yaml_file: str, ignored: Iterable[ str ] ) -> None: ignore_names = [] Nfail = 0 Nfailrun = 0 - status_fail = [ 'timedout', 'halted', 'lsferror', 'failed', 'failrun' ] + status_fail = [ 'timedout', 'halted', 'lsferror', 'failed', 'invalid' ] overall_status = 'PASSED' fail_names = [] failrun_names = [] @@ -73,7 +73,7 @@ def log_check( fname: str, yaml_file: str, ignored: Iterable[ str ] ) -> None: print( f'{status_code}: {Na}' ) Nignore += Nb ignore_names.extend( tmp_b ) - if ( status_code == 'failrun' ): + if ( status_code == 'invalid' ): Nfailrun += Na failrun_names.extend( tmp_a ) else: diff --git a/geos_ats_package/geos_ats/reporting.py b/geos_ats_package/geos_ats/reporting.py index 861fd637..ef675a18 100644 --- a/geos_ats_package/geos_ats/reporting.py +++ b/geos_ats_package/geos_ats/reporting.py @@ -12,14 +12,13 @@ from dataclasses import dataclass from ats import atsut from ats.times import hms -from ats import ( PASSED, FAILED, TIMEDOUT, EXPECTED, BATCHED, FILTERED, SKIPPED, CREATED, RUNNING, HALTED, LSFERROR ) +from ats import ( PASSED, FAILED, TIMEDOUT, EXPECTED, BATCHED, FILTERED, SKIPPED, CREATED, RUNNING, HALTED, LSFERROR, INVALID ) # Get the active logger instance logger = logging.getLogger( 'geos_ats' ) # Status value in priority order -FAILRUN = atsut.StatusCode( 'FAILRUN' ) -STATUS = ( EXPECTED, CREATED, BATCHED, FILTERED, SKIPPED, RUNNING, PASSED, TIMEDOUT, HALTED, LSFERROR, FAILED, FAILRUN ) +STATUS = ( EXPECTED, CREATED, BATCHED, FILTERED, SKIPPED, RUNNING, PASSED, TIMEDOUT, HALTED, LSFERROR, FAILED, INVALID ) COLORS: Mapping[ str, str ] = { EXPECTED.name: "black", @@ -33,7 +32,7 @@ HALTED.name: "brown", LSFERROR.name: "brown", FAILED.name: "red", - FAILRUN.name: "magenta", + INVALID.name: "magenta", } @@ -103,10 +102,10 @@ def __init__( self, test_steps ): elapsed = t.endTime - t.startTime self.test_results[ test_name ].elapsed += elapsed - # Add the step + # Add the step (Note: use the INVALID code to represent the FAILRUN state) s = t.status if ( 'geosx' in t.name ) and ( s == FAILED ): - s = FAILRUN + s = INVALID self.test_results[ test_name ].steps[ t.name ] = TestStepRecord( status=s, log=t.outname, output=t.step_outputs, From 692df6ceb90d5f481826102f4e433cef6d34dd88 Mon Sep 17 00:00:00 2001 From: Christopher Sherman Date: Fri, 31 May 2024 16:51:37 -0700 Subject: [PATCH 3/3] Using INVALID as FAILRUN in geos_ats --- geos_ats_package/geos_ats/reporting.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/geos_ats_package/geos_ats/reporting.py b/geos_ats_package/geos_ats/reporting.py index ef675a18..7353f518 100644 --- a/geos_ats_package/geos_ats/reporting.py +++ b/geos_ats_package/geos_ats/reporting.py @@ -104,7 +104,7 @@ def __init__( self, test_steps ): # Add the step (Note: use the INVALID code to represent the FAILRUN state) s = t.status - if ( 'geosx' in t.name ) and ( s == FAILED ): + if ( 'geos' in t.name ) and ( s == FAILED ): s = INVALID self.test_results[ test_name ].steps[ t.name ] = TestStepRecord( status=s, log=t.outname,