From 693cfb5440b2d85fbe30e5124332f1faf2e294f7 Mon Sep 17 00:00:00 2001 From: Anderson Chauphan Date: Mon, 12 Feb 2024 19:19:29 -0700 Subject: [PATCH] Added optional usageHelp as argument (#600) Optional usageHelp string that can be passed to `CDashAnalyzeReportRandomFailuresDriver` that is outputted with when the main script is given the `--help` argument. --- .../example_cdash_analyze_and_report_random_failures.py | 9 ++++++++- tribits/ci_support/CDashAnalyzeReportRandomFailures.py | 6 ++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/test/ci_support/example_cdash_analyze_and_report_random_failures.py b/test/ci_support/example_cdash_analyze_and_report_random_failures.py index 1d8b7c398..6c93f5dd0 100755 --- a/test/ci_support/example_cdash_analyze_and_report_random_failures.py +++ b/test/ci_support/example_cdash_analyze_and_report_random_failures.py @@ -8,12 +8,19 @@ import CDashAnalyzeReportRandomFailures as CDARRF +usageHelp = \ +r""" +Example usageHelp string +""" + + def main(): cdashAnalyzeAndReportRandomFailures = \ CDARRF.CDashAnalyzeReportRandomFailuresDriver( ExampleVersionInfoStrategy(), - ExampleExtractBuildNameStrategy()) + ExampleExtractBuildNameStrategy(), + usageHelp=usageHelp) cdashAnalyzeAndReportRandomFailures.runDriver() diff --git a/tribits/ci_support/CDashAnalyzeReportRandomFailures.py b/tribits/ci_support/CDashAnalyzeReportRandomFailures.py index 00b07a0b3..47ed0fdaf 100644 --- a/tribits/ci_support/CDashAnalyzeReportRandomFailures.py +++ b/tribits/ci_support/CDashAnalyzeReportRandomFailures.py @@ -10,10 +10,12 @@ class CDashAnalyzeReportRandomFailuresDriver: - def __init__(self, versionInfoStrategy, extractBuildNameStrategy): + def __init__(self, versionInfoStrategy, extractBuildNameStrategy, + usageHelp=""): self.versionInfoStrategy = versionInfoStrategy self.extractBuildNameStrategy = extractBuildNameStrategy self.args = None + self.usageHelp = usageHelp def runDriver(self): @@ -251,7 +253,7 @@ def runDriver(self): CDQAR.sendMineEmail(msg) def getCmndLineArgs(self): - parser = argparse.ArgumentParser("Arguments for cdash_analyze_and_report_random_failures.py") + parser = argparse.ArgumentParser(description=self.usageHelp) parser.add_argument("--cdash-site-url", default="", required=True) parser.add_argument("--cdash-project-name", default="", required=True)