"--conf-file", dest="confFile", default=None, help="Specify configuration file to load skipped tests from." ) parser.add_option( "--min-value", dest="minValue", default=0.0, type="float", help="Display only tests with statistics greater than this.", ) (options, args) = parser.parse_args(sys.argv) except optparse.OptionError, msg: raise Usage(msg) # Extract the names of all the processes that failed failedTests = common.getFailedTests(options.confFile) def extractNumbersFromString(text): """Find all the floating point numbers in a string""" parts = re.findall(r"[+-]?[0-9.]+", text) return [float(x) for x in parts] def getTestStats(f, minValue): """Print the stats for a single test""" # Get paths testFolder = os.path.join(common.TEST_FOLDER, f) goldFolder = os.path.join(testFolder, "gold") runFolder = os.path.join(testFolder, "run")
# Handle arguments try: usage = "usage: check_failing_stats.py [--help]\n " parser = optparse.OptionParser(usage=usage) parser.add_option("--conf-file", dest="confFile", default=None, help="Specify configuration file to load skipped tests from.") parser.add_option("--min-value", dest="minValue", default=0.0, type="float", help="Display only tests with statistics greater than this.") (options, args) = parser.parse_args(sys.argv) except optparse.OptionError, msg: raise Usage(msg) # Extract the names of all the processes that failed failedTests = common.getFailedTests(options.confFile) def extractNumbersFromString(text): '''Find all the floating point numbers in a string''' parts = re.findall(r'[+-]?[0-9.]+', text) return [float(x) for x in parts] def getTestStats(f, minValue): '''Print the stats for a single test''' # Get paths testFolder = os.path.join(common.TEST_FOLDER, f) goldFolder = os.path.join(testFolder, 'gold') runFolder = os.path.join(testFolder, 'run') goldDem = os.path.join(goldFolder, 'run-DEM.tif')
import os, sys, subprocess, re, common OLEG_FOLDER = '/home/oalexan1/projects/StereoPipelineTest/' def replaceGold(f): '''Replace the gold folder with one from Oleg's directory''' # Get paths testFolder = os.path.join(common.TEST_FOLDER, f) goldFolder = os.path.join(testFolder, 'gold') olegFolder = os.path.join(OLEG_FOLDER, f) olegGoldFolder = os.path.join(olegFolder, 'gold') cmd = 'rm -rf ' + goldFolder print cmd os.system(cmd) cmd = 'rsync -arv lunokhod1:' + olegGoldFolder +' ' + testFolder print cmd os.system(cmd) # Extract the names of all the processes that failed casesToReplace = common.getFailedTests() # Process each of the folders for f in casesToReplace: replaceGold(f)
import os, sys, subprocess, re, common def runToGold(f): '''Replace the gold folder with one from Oleg's directory''' # Get paths testFolder = os.path.join(common.TEST_FOLDER, f) goldFolder = os.path.join(testFolder, 'gold') runFolder = os.path.join(testFolder, 'run') cmd = 'rm -rf ' + goldFolder print cmd os.system(cmd) cmd = 'cp -r ' + runFolder + ' ' + goldFolder print cmd os.system(cmd) # Get the list of folders to update if len(sys.argv) > 1: casesToReplace = sys.argv[1:] else: # Extract the names of all the processes that failed casesToReplace = common.getFailedTests() # Process each of the folders for f in casesToReplace: runToGold(f)