Skip to content

Commit

Permalink
Show names/sha1 of detected branches on failure
Browse files Browse the repository at this point in the history
When the assertion fails, show the details of the set of branches so
that the test failure has more information about the failure conditions.

Preparation for a future time when a failure like this recurs:

* jenkinsci/bom#4193

Thanks to @darinpope for the question that prompted the improvement
  • Loading branch information
MarkEWaite committed Jan 14, 2025
1 parent 462a456 commit e18f730
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ public void testListRemoteBranches() throws Exception {
workspace.launchCommand("git", "fetch", "origin");
Set<Branch> branches = testGitClient.getRemoteBranches();
assertBranchesExist(branches, "origin/" + defaultBranchName, "origin/test", "origin/another");
assertEquals(3, branches.size());
assertEquals("Wrong branch count, found " + branches.size() + " branches: " + branches, 3, branches.size());
}

@Test
Expand Down

0 comments on commit e18f730

Please sign in to comment.