Skip to content

Commit

Permalink
Correct testing for new dashboard name logic
Browse files Browse the repository at this point in the history
Signed-off-by: Samuel E. Browne <[email protected]>
  • Loading branch information
sebrowne committed Nov 25, 2024
1 parent 8e52533 commit 7eccbbc
Showing 1 changed file with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def dummy_args(self):
target_branch_name="develop",
pullrequest_build_name="Trilinos-pullrequest-gcc",
genconfig_build_name="rhel8_sems-gnu-openmpi_release_static_no-kokkos-arch_no-asan_no-complex_no-fpic_mpi_no-pt_no-rdc_no-package-enables",
dashboard_build_name="gnu-openmpi_release_static",
dashboard_build_name=None,
jenkins_job_number=99,
pullrequest_number='0000',
pullrequest_cdash_track="Pull Request",
Expand Down Expand Up @@ -331,21 +331,11 @@ def test_TrilinosPRConfigurationCDashTrack(self):
self.assertEqual(cdash_track, "Pull Request")


def test_TrilinosPRConfigurationBuildNamePython2(self):
args = self.dummy_args_python3()
pr_config = trilinosprhelpers.TrilinosPRConfigurationBase(args)
build_name = pr_config.pullrequest_build_name
print("--- build_name = {}".format(build_name))
expected_build_name = "PR-{}-test-{}-{}".format(args.pullrequest_number, args.genconfig_build_name, args.jenkins_job_number)
self.assertEqual(build_name, expected_build_name)


def test_TrilinosPRConfigurationBaseBuildNameGCC720(self):
args = self.dummy_args_gcc_720()
pr_config = trilinosprhelpers.TrilinosPRConfigurationBase(args)
build_name = pr_config.pullrequest_build_name
print("--- build_name = {}".format(build_name))
expected_build_name = "PR-{}-test-{}-{}".format(args.pullrequest_number, args.genconfig_build_name, args.jenkins_job_number)
expected_build_name = f"PR-{args.pullrequest_number}-test-{args.genconfig_build_name}-{args.jenkins_job_number}"
self.assertEqual(build_name, expected_build_name)


Expand All @@ -355,7 +345,7 @@ def test_TrilinosPRConfigurationBaseBuildGroupContainsPullRequest(self):
args.pullrequest_cdash_track = "Pull Request (Non-blocking)"
pr_config = trilinosprhelpers.TrilinosPRConfigurationBase(args)
build_name = pr_config.pullrequest_build_name
expected_build_name = "PR-{}-test-{}-{}".format(args.pullrequest_number, args.genconfig_build_name, args.jenkins_job_number)
expected_build_name = f"PR-{args.pullrequest_number}-test-{args.genconfig_build_name}-{args.jenkins_job_number}"
self.assertEqual(build_name, expected_build_name)


Expand All @@ -368,6 +358,16 @@ def test_TrilinosPRConfigurationBaseBuildNameNonPRTrack(self):
self.assertEqual(build_name, expected_build_name)


def test_TrilinosPRConfigurationBaseBuildNamePassed(self):
"""Test that a passed build name is used."""
args = self.dummy_args()
args.dashboard_build_name = "some-dashboard-build-name"
pr_config = trilinosprhelpers.TrilinosPRConfigurationBase(args)
build_name = pr_config.pullrequest_build_name
expected_build_name = args.dashboard_build_name
self.assertEqual(build_name, expected_build_name)


def test_TrilinosPRConfigurationBaseDashboardModelPRTrack(self):
args = self.dummy_args()
pr_config = trilinosprhelpers.TrilinosPRConfigurationBase(args)
Expand Down

0 comments on commit 7eccbbc

Please sign in to comment.