Skip to content
Permalink
Browse files
IGNITE-16074: Fix referenced to tests history (#188)
  • Loading branch information
dspavlov committed Dec 7, 2021
1 parent 6e2c2ce commit 47d952786e4fc87da522764b1ce80c8f833dcac5
Showing 4 changed files with 14 additions and 15 deletions.
@@ -28,7 +28,7 @@
public static final String GITHUB_REF = "https://github.com/apache/ignite-teamcity-bot";

/** TC Bot Version. */
public static final String VERSION = "20210929";
public static final String VERSION = "20211207";

/** Java version, where Web App is running. */
public String javaVer;
@@ -461,10 +461,10 @@
let testId = results[key][suite][testName][0];

let href = g_tcHost
+ "project.html"
+ "?projectId=" + g_projectId
+ "&testNameId=" + testId
+ "&tab=testDetails" ;
+ "test/" + testId
+ "?currentProjectId=" + g_projectId
+ "&branch=<default>"; // supposing it is always default

res += '<tr>' +
'<td class="innerTestName"><p title="' + testName + '">' + testClass + '.' + testMethodName + '</p></td>' +
'<td class="innerFailRate"><p title="Test\'s fail-rate for corresponding date period">' +
@@ -256,7 +256,7 @@ else if (IssueType.newTestWithHighFlakyRate.code().equals(issueType)) {
String RebuildProjectId = fatBuildCompacted.projectId(compactor);
String branchName = fatBuildCompacted.branchName(compactor);

webUrl = DsTestFailureUi.buildWebLink(tcIgn, testNameId, RebuildProjectId, branchName);
webUrl = DsTestFailureUi.buildTestWebLink(tcIgn, testNameId, RebuildProjectId, branchName);
}
else {
//exception for new test. removal of test means test is fixed
@@ -127,10 +127,10 @@ public DsTestFailureUi initFromOccurrence(@Nonnull final TestCompactedMult failu
.filter(Objects::nonNull)
.forEach(testNameId -> {
if (webUrl == null)
webUrl = buildWebLink(tcIgn, testNameId, projectId, branchName);
webUrl = buildTestWebLink(tcIgn, testNameId, projectId, branchName);

if (webUrlBaseBranch == null)
webUrlBaseBranch = buildWebLink(tcIgn, testNameId, projectId, baseBranchName);
webUrlBaseBranch = buildTestWebLink(tcIgn, testNameId, projectId, baseBranchName);
});


@@ -168,18 +168,17 @@ public void checkAndFillByPrefix(String details, String issueLinkPrefix) {
}
}

public static String buildWebLink(ITeamcityIgnited tcIgn, Long testNameId,
@Nullable String projectId, @Nullable String branchName) {
public static String buildTestWebLink(ITeamcityIgnited tcIgn, Long testNameId,
@Nullable String projectId, @Nullable String branchName) {
if (projectId == null || testNameId == null)
return null;

final String branch = normalizeBranch(branchName);

return tcIgn.host() + "project.html"
+ "?projectId=" + projectId
+ "&testNameId=" + testNameId
+ "&branch=" + UrlUtil.escape(branch)
+ "&tab=testDetails";
return tcIgn.host()
+ "test/" + testNameId
+ "?currentProjectId=" + projectId
+ "&branch=" + UrlUtil.escape(branch);
}

/**

0 comments on commit 47d9527

Please sign in to comment.