Skip to content

Commit

Permalink
Added optional usageHelp as argument (#600)
Browse files Browse the repository at this point in the history
Optional usageHelp string that can be passed to `CDashAnalyzeReportRandomFailuresDriver`
that is outputted with when the main script is given the `--help` argument.
  • Loading branch information
achauphan committed Feb 13, 2024
1 parent 0afbc1d commit 693cfb5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
6 changes: 4 additions & 2 deletions tribits/ci_support/CDashAnalyzeReportRandomFailures.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 693cfb5

Please sign in to comment.