From 0f1b62aebfbd013dd5f6a79a74cc3a0f65c52276 Mon Sep 17 00:00:00 2001 From: Anthony Islas Date: Mon, 6 Jan 2025 13:52:41 -0700 Subject: [PATCH 1/2] Use common return to always stash and pop current dir --- .ci/runner.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.ci/runner.py b/.ci/runner.py index 87087ba..a9c1dd7 100755 --- a/.ci/runner.py +++ b/.ci/runner.py @@ -432,6 +432,10 @@ def runMultitest( self, tests ) : # main entry point for testing def run( self, tests ) : + currentDir = os.getcwd() + self.log( "Storing current working directory [{cwd}]".format( cwd=currentDir ) ) + self.log( " Will return to this directory at the end of testing" ) + for test in tests : if test not in self.tests_.keys() : msg = "Error: no test named '{0}'".format( test ) @@ -443,18 +447,23 @@ def run( self, tests ) : self.setWorkingDirectory() # Let joining steps into a single HPC job take precedence + success = True + logs = [] if self.globalOpts_.forceSingle : success = True logs = [] for test in tests : success = success and self.tests_[ test ].run() logs.append( self.tests_[ test ].logfile_ ) - return success, logs else : if hasattr( self.globalOpts_, 'joinHPC' ) : - return self.runHPCJoin( tests ) + success, logs = self.runHPCJoin( tests ) else : - return self.runMultitest( tests ) + success, logs = self.runMultitest( tests ) + + # Popping back to old cwd + os.chdir( currentDir ) + return success, logs # A separated helper function to wrap this in a callable format def runSuite( options ) : From 7d2237974044d69a716b70943d643ae766f0ff4d Mon Sep 17 00:00:00 2001 From: Anthony Islas Date: Mon, 6 Jan 2025 13:53:00 -0700 Subject: [PATCH 2/2] Add some logging for mapped alt dirs --- .ci/runner.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.ci/runner.py b/.ci/runner.py index a9c1dd7..96f98be 100755 --- a/.ci/runner.py +++ b/.ci/runner.py @@ -363,6 +363,12 @@ def runMultitest( self, tests ) : for testIdx, opt in enumerate( individualTestOpts ) : opt.testsConfig = testDirs[testIdx] + "/" + os.path.basename( self.globalOpts_.testsConfig ) + if testDirs : + self.log_push() + for testIdx, opt in enumerate( individualTestOpts ) : + self.log( "Test [{test}] will run {config} from {cwd}".format( test=opt.tests[0], config=opt.testsConfig, cwd=os.getcwd() ) ) + self.log_pop() + self.log_pop() self.log( "Spawning process pool of size {0} to perform {1} tests".format( self.globalOpts_.pool, len(tests) ) )