Skip to content

Commit

Permalink
Added unit test for getBuildIdFromTest (TriBITSPub#600)
Browse files Browse the repository at this point in the history
Add a set of unit tests for getBuildIdFromTest helper function from
cdash_analyze_and_report_random_failure.py
  • Loading branch information
achauphan committed Jan 25, 2024
1 parent 6b0582b commit 0930d75
Showing 1 changed file with 33 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@

from FindCISupportDir import *
import CDashQueryAnalyzeReport as CDQAR
from cdash_analyze_and_report_random_failures import *
from CDashQueryAnalyzeReportUnitTestHelpers import *

# Base test directory in the build tree
Expand Down Expand Up @@ -101,8 +102,39 @@ def __enter__(self):
def __exit__(self, exc_type, exc_val, exc_tb):
self.remove()

#############################################################################
#
# Unit tests for cdash_analyze_and_report_random_failures.py
#
#############################################################################


class test_getBuildIdFromTest(unittest.TestCase):

def test_single_slash(self):
test_dict = { 'buildSummaryLink':'build/somenumber' }
self.assertEqual(
getBuildIdFromTest(test_dict), 'somenumber')

def test_multiple_slash(self):
test_dict = { 'buildSummaryLink':'build/path/temp/somenumber' }
self.assertEqual(
getBuildIdFromTest(test_dict), 'somenumber')

def test_no_slash(self):
test_dict = { 'buildSummaryLink':'buildid' }
self.assertEqual(
getBuildIdFromTest(test_dict), 'buildid')


#############################################################################
#
# System-level tests for cdash_analyze_and_report_random_failures.py
#
#############################################################################


class test_cdash_analyze_and_report(unittest.TestCase):
class test_cdash_analyze_and_report_random_failures(unittest.TestCase):
def cdash_analyze_and_report_run_case(
self,
expectedRtnCode,
Expand Down

0 comments on commit 0930d75

Please sign in to comment.