Skip to content

Commit

Permalink
Added str() method to RandomFailureSummary (TriBITSPub#600)
Browse files Browse the repository at this point in the history
Removed individual printing of RandomFailureSummary in-line and instead
use a str() function for RandomFailureSummary object
  • Loading branch information
achauphan committed Feb 2, 2024
1 parent 7ebc52c commit c1a765a
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions tribits/ci_support/cdash_analyze_and_report_random_failures.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,23 @@
"""

class RandomFailureSummary:

class RandomFailureSummary(object):

def __init__(self, buildName, testName, testHistoryUrl, sha1Pair):
self.buildName = buildName
self.testName = testName
self.testHistoryUrl = testHistoryUrl
self.sha1Pair = sha1Pair

def __str__(self):
myStr = "Test name: "+self.testName +\
"\nBuild name: "+self.buildName +\
"\nIdentical sha1 pairs: "+str(self.sha1Pair) +\
"\nTest history browser URL: " +\
"\n "+self.testHistoryUrl+"\n"
return myStr


# The main function
def main():
Expand Down Expand Up @@ -210,10 +219,8 @@ def main():

print("Found randomly failing tests: "+str(len(randomFailureSummaries)))
for summary in randomFailureSummaries:
print("Test name: "+summary.testName)
print("Build name: "+summary.buildName)
print("Identical sha1 pairs: "+str(summary.sha1Pair))
print("Test history browser URL: \n "+summary.testHistoryUrl+"\n")
print(str(summary))



def getCmndLineArgs():
Expand Down

0 comments on commit c1a765a

Please sign in to comment.