You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by dp...@apache.org on 2019/08/06 11:44:07 UTC
[ignite-teamcity-bot] branch master updated: New tracked branch
test selection option: Show muted/show ignored tests (#146)
This is an automated email from the ASF dual-hosted git repository.
dpavlov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite-teamcity-bot.git
The following commit(s) were added to refs/heads/master by this push:
new 228526e New tracked branch test selection option: Show muted/show ignored tests (#146)
228526e is described below
commit 228526eeedd00419dfb10ea704747e07c85a33f6
Author: Dmitriy Pavlov <dp...@apache.org>
AuthorDate: Tue Aug 6 14:44:02 2019 +0300
New tracked branch test selection option: Show muted/show ignored tests (#146)
Show muted and ignored tests mode implementation started, added muted &ignored tests to report
---
.../ignite/ci/tcbot/issue/IssueDetector.java | 4 +-
.../ignite/ci/web/rest/GetChainResultsAsHtml.java | 2 +-
.../ci/web/rest/build/GetBuildTestFailures.java | 2 +-
.../rest/tracked/GetTrackedBranchTestResults.java | 45 ++++++++++-----
ignite-tc-helper-web/src/main/webapp/current.html | 65 ++++++++++++++++------
.../src/main/webapp/js/testfails-2.2.js | 23 +++++---
.../ci/tcbot/chain/TrackedBranchProcessorTest.java | 2 +-
.../ignite/ci/tcbot/issue/IssueDetectorTest.java | 2 +-
.../ignite/tcbot/engine/chain/MultBuildRunCtx.java | 5 +-
.../tcbot/engine/chain/TestCompactedMult.java | 30 ++++++----
.../ignite/tcbot/engine/pr/PrChainsProcessor.java | 6 +-
.../tracked/IDetailedStatusForTrackedBranch.java | 6 +-
.../tracked/TrackedBranchChainsProcessor.java | 53 +++++++++++-------
.../apache/ignite/tcbot/engine/ui/DsChainUi.java | 11 ++--
.../apache/ignite/tcbot/engine/ui/DsSuiteUi.java | 13 +++--
.../ci/teamcity/ignited/runhist/Invocation.java | 4 --
.../teamcity/ignited/runhist/InvocationData.java | 26 +++++++--
.../ignite/tcignited/build/TestCompactedV2.java | 19 ++++---
.../apache/ignite/tcignited/history/RunStatus.java | 9 ++-
.../ignite/tcignited/history/SuiteInvocation.java | 2 +-
20 files changed, 219 insertions(+), 110 deletions(-)
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/issue/IssueDetector.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/issue/IssueDetector.java
index 2feb8c9..f6027c5 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/issue/IssueDetector.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/issue/IssueDetector.java
@@ -581,7 +581,7 @@ public class IssueDetector {
null,
DisplayMode.None,
null,
- -1);
+ -1, false, false);
DsSummaryUi failures =
tbProc.getTrackedBranchTestFailures(brachName,
@@ -594,7 +594,7 @@ public class IssueDetector {
null,
DisplayMode.OnlyFailures,
null,
- -1);
+ -1, false, false);
String issRes = registerIssuesAndNotifyLater(failures, backgroundOpsCreds);
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/GetChainResultsAsHtml.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/GetChainResultsAsHtml.java
index 04c493d..db6360f 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/GetChainResultsAsHtml.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/GetChainResultsAsHtml.java
@@ -92,7 +92,7 @@ public class GetChainResultsAsHtml {
status.chainName = ctx.suiteName();
IStringCompactor c = injector.getInstance(IStringCompactor.class);
- status.initFromContext(tcIgn, ctx, failRateBranch, c, false, null, null, -1, null);
+ status.initFromContext(tcIgn, ctx, failRateBranch, c, false, null, null, -1, null, false, false);
res.append(showChainAtServerData(status));
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/build/GetBuildTestFailures.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/build/GetBuildTestFailures.java
index 6de270d..316b447 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/build/GetBuildTestFailures.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/build/GetBuildTestFailures.java
@@ -141,7 +141,7 @@ public class GetBuildTestFailures {
if (cnt > 0)
runningUpdates.addAndGet(cnt);
- chainStatus.initFromContext(tcIgnited, ctx, failRateBranch, injector.getInstance(IStringCompactor.class), false, null, null, -1, null);
+ chainStatus.initFromContext(tcIgnited, ctx, failRateBranch, injector.getInstance(IStringCompactor.class), false, null, null, -1, null, false, false);
res.addChainOnServer(chainStatus);
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/tracked/GetTrackedBranchTestResults.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/tracked/GetTrackedBranchTestResults.java
index 3b87184..2b0c2ed 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/tracked/GetTrackedBranchTestResults.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/tracked/GetTrackedBranchTestResults.java
@@ -75,10 +75,12 @@ public class GetTrackedBranchTestResults {
@Nullable @QueryParam("displayMode") String displayMode,
@Nullable @QueryParam("sortOption") String sortOption,
@Nullable @QueryParam("count") Integer mergeCnt,
- @Nullable @QueryParam("showTestLongerThan") Integer showTestLongerThan) {
+ @Nullable @QueryParam("showTestLongerThan") Integer showTestLongerThan,
+ @Nullable @QueryParam("muted") Boolean showMuted,
+ @Nullable @QueryParam("ignored") Boolean showIgnored) {
return new UpdateInfo().copyFrom(
getTestFailsResultsNoSync(branchOrNull, checkAllLogs, trustedTests, tagSelected, tagForHistSelected,
- displayMode, sortOption, mergeCnt, showTestLongerThan));
+ displayMode, sortOption, mergeCnt, showTestLongerThan, showMuted, showIgnored));
}
@GET
@@ -92,9 +94,11 @@ public class GetTrackedBranchTestResults {
@Nullable @QueryParam("displayMode") String displayMode,
@Nullable @QueryParam("sortOption") String sortOption,
@Nullable @QueryParam("count") Integer mergeCnt,
- @Nullable @QueryParam("showTestLongerThan") Integer showTestLongerThan) {
+ @Nullable @QueryParam("showTestLongerThan") Integer showTestLongerThan,
+ @Nullable @QueryParam("muted") Boolean showMuted,
+ @Nullable @QueryParam("ignored") Boolean showIgnored) {
return getTestFailsResultsNoSync(branchOrNull, checkAllLogs, trustedTests, tagSelected, tagForHistSelected,
- displayMode, sortOption, mergeCnt, showTestLongerThan).toString();
+ displayMode, sortOption, mergeCnt, showTestLongerThan, showMuted, showIgnored).toString();
}
@GET
@@ -108,9 +112,11 @@ public class GetTrackedBranchTestResults {
@Nullable @QueryParam("displayMode") String displayMode,
@Nullable @QueryParam("sortOption") String sortOption,
@Nullable @QueryParam("count") Integer mergeCnt,
- @Nullable @QueryParam("showTestLongerThan") Integer showTestLongerThan) {
+ @Nullable @QueryParam("showTestLongerThan") Integer showTestLongerThan,
+ @Nullable @QueryParam("muted") Boolean showMuted,
+ @Nullable @QueryParam("ignored") Boolean showIgnored) {
return latestBuildResults(branch, checkAllLogs, trustedTests, tagSelected, tagForHistSelected,
- SyncMode.NONE, displayMode, sortOption, mergeCnt, showTestLongerThan);
+ SyncMode.NONE, displayMode, sortOption, mergeCnt, showTestLongerThan, showMuted, showIgnored);
}
@GET
@@ -125,9 +131,11 @@ public class GetTrackedBranchTestResults {
@Nullable @QueryParam("displayMode") String displayMode,
@Nullable @QueryParam("sortOption") String sortOption,
@Nullable @QueryParam("count") Integer mergeCnt,
- @Nullable @QueryParam("showTestLongerThan") Integer showTestLongerThan) {
+ @Nullable @QueryParam("showTestLongerThan") Integer showTestLongerThan,
+ @Nullable @QueryParam("muted") Boolean showMuted,
+ @Nullable @QueryParam("ignored") Boolean showIgnored) {
return latestBuildResults(branch, checkAllLogs, trustedTests, tagSelected, tagForHistSelected,
- SyncMode.RELOAD_QUEUED, displayMode, sortOption, mergeCnt, showTestLongerThan);
+ SyncMode.RELOAD_QUEUED, displayMode, sortOption, mergeCnt, showTestLongerThan, showMuted, showIgnored);
}
@NotNull private DsSummaryUi latestBuildResults(
@@ -140,7 +148,9 @@ public class GetTrackedBranchTestResults {
@Nullable String displayMode,
@Nullable String sortOption,
@Nullable Integer mergeCnt,
- @Nullable Integer showTestLongerThan) {
+ @Nullable Integer showTestLongerThan,
+ @Nullable Boolean showMuted,
+ @Nullable Boolean showIgnored) {
ITcBotUserCreds creds = ITcBotUserCreds.get(req);
Injector injector = CtxListener.getInjector(ctx);
@@ -150,11 +160,19 @@ public class GetTrackedBranchTestResults {
int maxDurationSec = (showTestLongerThan == null || showTestLongerThan < 1) ? 0 : showTestLongerThan;
return injector.getInstance(IDetailedStatusForTrackedBranch.class)
- .getTrackedBranchTestFailures(branch, checkAllLogs, actualMergeBuilds, creds, mode,
- Boolean.TRUE.equals(trustedTests), tagSelected, tagForHistSelected,
+ .getTrackedBranchTestFailures(branch,
+ checkAllLogs,
+ actualMergeBuilds,
+ creds,
+ mode,
+ Boolean.TRUE.equals(trustedTests),
+ tagSelected,
+ tagForHistSelected,
DisplayMode.parseStringValue(displayMode),
SortOption.parseStringValue(sortOption),
- maxDurationSec);
+ maxDurationSec,
+ Boolean.TRUE.equals(showMuted),
+ Boolean.TRUE.equals(showIgnored));
}
@GET
@@ -193,7 +211,8 @@ public class GetTrackedBranchTestResults {
return injector.getInstance(TrackedBranchChainsProcessor.class)
.getTrackedBranchTestFailures(branchOpt, checkAllLogs, cntLimit, creds, mode,
- false, null, null, DisplayMode.OnlyFailures, null, -1);
+ false, null, null, DisplayMode.OnlyFailures, null,
+ -1, false, false);
}
/**
diff --git a/ignite-tc-helper-web/src/main/webapp/current.html b/ignite-tc-helper-web/src/main/webapp/current.html
index 115f358..5045910 100644
--- a/ignite-tc-helper-web/src/main/webapp/current.html
+++ b/ignite-tc-helper-web/src/main/webapp/current.html
@@ -68,6 +68,8 @@ function showQueryForm() {
sortOption: 'FailureRate',
//count of builds to merge
count: 1,
+ muted: false,
+ ignored: false,
trustedTests: true,
checkAllLogs: false,
hideFlakyFailures: false,
@@ -115,6 +117,10 @@ function showQueryForm() {
gVue.$data.trustedTests = parm === "true";
}
+
+ gVue.$data.muted = findGetParameter("muted") === "true";
+ gVue.$data.ignored = findGetParameter("ignored") === "true";
+
gVue.$data.checkAllLogs = findGetParameter("checkAllLogs") === "true";
gVue.$data.hideFlakyFailures = findGetParameter("hideFlakyFailures") === "true";
@@ -147,45 +153,60 @@ function parmsForRest() {
var branch = findGetParameter("branch");
curReqParms += "?branch=" + (branch != null ? branch : "master");
- if (gVue.$data.checkAllLogs != null) {
+ if (gVue.$data.checkAllLogs === true) {
curReqParms += "&checkAllLogs=" + gVue.$data.checkAllLogs;
}
- if (gVue.$data.trustedTests != null) {
+ if (gVue.$data.trustedTests === false) {
curReqParms += "&trustedTests=" + gVue.$data.trustedTests;
}
+ if (gVue.$data.muted === true) {
+ curReqParms += "&muted=" + gVue.$data.muted;
+ }
+
+ if (gVue.$data.ignored === true) {
+ curReqParms += "&ignored=" + gVue.$data.ignored;
+ }
+
var tagSelected = gVue.$data.tagSelected;
- if (tagSelected != null) {
+ if (tagSelected != null && tagSelected !== "") {
curReqParms += "&tagSelected=" + tagSelected;
}
var displayMode = gVue.$data.displayMode;
- if (displayMode != null) {
+ if (displayMode != null && displayMode !== "" && displayMode !== "Failures") {
curReqParms += "&displayMode=" + displayMode;
}
var sortOption = gVue.$data.sortOption;
- if (sortOption != null) {
+ if (sortOption != null && sortOption !== "" && sortOption !== "FailureRate") {
curReqParms += "&sortOption=" + sortOption;
}
- if (gVue.$data.count != null)
- curReqParms += "&count=" + gVue.$data.count;
+ let count = gVue.$data.count;
+ if (count != null && count > 1)
+ curReqParms += "&count=" + count;
- if (gVue.$data.failRateRange[0] != null)
- curReqParms += "&minFailRate=" + gVue.$data.failRateRange[0];
+ let minFailRate = gVue.$data.failRateRange[0];
+ if (minFailRate != null && minFailRate > 0)
+ curReqParms += "&minFailRate=" + minFailRate;
- if (gVue.$data.failRateRange[1] != null)
- curReqParms += "&maxFailRate=" + gVue.$data.failRateRange[1];
+ let maxFailRate = gVue.$data.failRateRange[1];
+ if (maxFailRate != null && maxFailRate < 100)
+ curReqParms += "&maxFailRate=" + maxFailRate;
- curReqParms += "&hideFlakyFailures=" + gVue.$data.hideFlakyFailures;
+ let hideFlakyFailures = gVue.$data.hideFlakyFailures;
+ if (hideFlakyFailures != null && hideFlakyFailures === true)
+ curReqParms += "&hideFlakyFailures=" + hideFlakyFailures;
- if (gVue.$data.tagForHistSelected != null)
- curReqParms += "&tagForHistSelected=" + gVue.$data.tagForHistSelected;
+ let tagForHistSelected = gVue.$data.tagForHistSelected;
+ if (tagForHistSelected != null && tagForHistSelected !== "")
+ curReqParms += "&tagForHistSelected=" + tagForHistSelected;
- if (gVue.$data.showTestLongerThan != null)
- curReqParms += "&showTestLongerThan=" + gVue.$data.showTestLongerThan;
+ let runTime = gVue.$data.showTestLongerThan;
+ if (runTime != null && runTime > 0)
+ curReqParms += "&showTestLongerThan=" + runTime;
return curReqParms;
}
@@ -346,12 +367,20 @@ function showData(result) {
<span>Merge Builds: </span>
<input v-model.number="count" type="number" @change="formChanged">
- <br><span title="Show trusted tests count">Trusted tests: </span>
+ <br>
+ <span title="Show muted tests">Muted: </span>
+ <input type="checkbox" v-model="muted" @change="formChanged">
+
+ <span title="Show ignored tests">Ignored: </span>
+ <input type="checkbox" v-model="ignored" @change="formChanged">
+
+
+ <span title="Show trusted tests count">Trusted tests: </span>
<input type="checkbox" v-model="trustedTests" @change="formChanged">
<span title="Download and parse all logs">Check logs: </span>
<input type="checkbox" v-model="checkAllLogs" @change="formChanged">
- <span>Show test longer than, seconds: </span>
+ <span>Tests longer than, seconds: </span>
<input v-model.number="showTestLongerThan" type="number" @change="formChanged">
</td>
diff --git a/ignite-tc-helper-web/src/main/webapp/js/testfails-2.2.js b/ignite-tc-helper-web/src/main/webapp/js/testfails-2.2.js
index e744146..c73068b 100644
--- a/ignite-tc-helper-web/src/main/webapp/js/testfails-2.2.js
+++ b/ignite-tc-helper-web/src/main/webapp/js/testfails-2.2.js
@@ -1024,16 +1024,23 @@ function drawLatestRuns(latestRuns) {
function drawLatestRunsBlock(state, len) {
var runColor = "white";
- if (state === 0)
+ const resOk = 0;
+ if (state === resOk)
runColor = "green";
else if (state === 1)
runColor = "red";
- else if (state === 2)
+ else if (state === 2) // deprected MUTED
runColor = "grey";
- else if (state === 3)
- runColor = "black";
- else if (state === 4)
- runColor = "lightgrey";
-
- return "<span style='background-color: " + runColor + "; width:" + (len * 1) + "px; height:10px; display: inline-block;'></span>";
+ else if (state === 3) // CRITICAL failure - incomplete suite
+ runColor = "#000000";
+ else if (state === 4) // RES_MISSING(4), missing in run
+ runColor = "#AAAAAA";
+ else if (state === 5) // RES_OK_MUTED(5),
+ runColor = "#44AA44";
+ else if (state === 6) // RES_FAILURE_MUTED(6),
+ runColor = "#b76a6a";
+ else if (state === 7) // RES_IGNORED(7);
+ runColor = "#F09F00";
+
+ return "<span style='background-color: " + runColor + "; width:" + (len * 1) + "px; height:10px; display: inline-block;'></span>";
}
\ No newline at end of file
diff --git a/ignite-tc-helper-web/src/test/java/org/apache/ignite/ci/tcbot/chain/TrackedBranchProcessorTest.java b/ignite-tc-helper-web/src/test/java/org/apache/ignite/ci/tcbot/chain/TrackedBranchProcessorTest.java
index d0d74cb..492654f 100644
--- a/ignite-tc-helper-web/src/test/java/org/apache/ignite/ci/tcbot/chain/TrackedBranchProcessorTest.java
+++ b/ignite-tc-helper-web/src/test/java/org/apache/ignite/ci/tcbot/chain/TrackedBranchProcessorTest.java
@@ -122,7 +122,7 @@ public class TrackedBranchProcessorTest {
1,
mock, SyncMode.RELOAD_QUEUED,
false, null, null, DisplayMode.OnlyFailures, null,
- -1);
+ -1, false, false);
Gson gson = new GsonBuilder().setPrettyPrinting().create();
System.out.println(gson.toJson(failures));
diff --git a/ignite-tc-helper-web/src/test/java/org/apache/ignite/ci/tcbot/issue/IssueDetectorTest.java b/ignite-tc-helper-web/src/test/java/org/apache/ignite/ci/tcbot/issue/IssueDetectorTest.java
index a8cdde3..55b9113 100644
--- a/ignite-tc-helper-web/src/test/java/org/apache/ignite/ci/tcbot/issue/IssueDetectorTest.java
+++ b/ignite-tc-helper-web/src/test/java/org/apache/ignite/ci/tcbot/issue/IssueDetectorTest.java
@@ -86,7 +86,7 @@ public class IssueDetectorTest {
}
@Test
- public void testDetector() throws IOException {
+ public void testDetector() {
String brachName = "masterTest";
String chainId = TeamcityIgnitedImpl.DEFAULT_PROJECT_ID;
BranchTracked branch = new BranchTracked();
diff --git a/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/chain/MultBuildRunCtx.java b/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/chain/MultBuildRunCtx.java
index 106daf2..7fb1a87 100644
--- a/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/chain/MultBuildRunCtx.java
+++ b/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/chain/MultBuildRunCtx.java
@@ -711,8 +711,9 @@ public class MultBuildRunCtx implements ISuiteResults {
}
}
- public boolean hasTestToReport(ITeamcityIgnited tcIgnited, Integer baseBranchId) {
- return !getFilteredTests(test -> test.includeIntoReport(tcIgnited, baseBranchId)).isEmpty();
+ public boolean hasTestToReport(ITeamcityIgnited tcIgnited, Integer baseBranchId, boolean showMuted,
+ boolean showIgnored) {
+ return !getFilteredTests(test -> test.includeIntoReport(tcIgnited, baseBranchId, showMuted, showIgnored)).isEmpty();
}
public boolean hasLongRunningTest(int maxSec) {
diff --git a/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/chain/TestCompactedMult.java b/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/chain/TestCompactedMult.java
index 8462bb8..8e6b007 100644
--- a/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/chain/TestCompactedMult.java
+++ b/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/chain/TestCompactedMult.java
@@ -17,6 +17,13 @@
package org.apache.ignite.tcbot.engine.chain;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.concurrent.TimeUnit;
+import java.util.stream.Stream;
+import javax.annotation.Nullable;
import org.apache.ignite.tcbot.common.TcBotConst;
import org.apache.ignite.tcbot.persistence.IStringCompactor;
import org.apache.ignite.tcignited.ITeamcityIgnited;
@@ -27,14 +34,6 @@ import org.apache.ignite.tcignited.history.IRunStat;
import org.apache.ignite.tcignited.history.ISuiteRunHistory;
import org.apache.ignite.tcservice.model.result.tests.TestOccurrence;
-import javax.annotation.Nullable;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.concurrent.TimeUnit;
-import java.util.stream.Stream;
-
/**
* Test occurrence merged from several runs.
*/
@@ -173,14 +172,23 @@ public class TestCompactedMult {
/**
* Filter to determine if this test execution should be shown in the report of failures.
- *
- * @param tcIgnited Tc ignited.
+ * @param tcIgnited Tc ignited.
* @param baseBranchId Base branch id.
+ * @param showMuted
+ * @param showIgnored
*/
- public boolean includeIntoReport(ITeamcityIgnited tcIgnited, Integer baseBranchId) {
+ public boolean includeIntoReport(ITeamcityIgnited tcIgnited, Integer baseBranchId,
+ boolean showMuted,
+ boolean showIgnored) {
if (isFailedButNotMuted())
return true;
+ if (showMuted && occurrences.stream().anyMatch(ITest::isMutedTest))
+ return true;
+
+ if (showIgnored && occurrences.stream().anyMatch(ITest::isIgnoredTest))
+ return true;
+
boolean longRun = getAvgDurationMs() > TcBotConst.MAX_NEW_TEST_DURATION_FOR_RUNALL_MS;
if (longRun)
diff --git a/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/pr/PrChainsProcessor.java b/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/pr/PrChainsProcessor.java
index 3781a27..e05285c 100644
--- a/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/pr/PrChainsProcessor.java
+++ b/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/pr/PrChainsProcessor.java
@@ -166,7 +166,7 @@ public class PrChainsProcessor {
//fail rate reference is always default (master)
chainStatus.initFromContext(tcIgnited, ctx, baseBranchForTc, compactor, false,
- null, null, -1, null); // don't need for PR
+ null, null, -1, null, false, false); // don't need for PR
initJiraAndGitInfo(chainStatus, jiraIntegration, gitHubConnIgnited);
}
@@ -298,7 +298,7 @@ public class PrChainsProcessor {
Integer baseBranchId = compactor.getStringIdIfPresent(normalizedBaseBranch);
Predicate<MultBuildRunCtx> filter = suite ->
- suite.isFailed() || suite.hasTestToReport(tcIgnited, baseBranchId);
+ suite.isFailed() || suite.hasTestToReport(tcIgnited, baseBranchId, false, false);
return fullChainRunCtx
.filteredChildSuites(filter)
@@ -307,7 +307,7 @@ public class PrChainsProcessor {
String suiteComment = ctx.getPossibleBlockerComment(compactor, statInBaseBranch, tcIgnited.config());
- List<ShortTestFailureUi> failures = ctx.getFilteredTests(test -> test.includeIntoReport(tcIgnited, baseBranchId))
+ List<ShortTestFailureUi> failures = ctx.getFilteredTests(test -> test.includeIntoReport(tcIgnited, baseBranchId, false, false))
.stream()
.map(occurrence -> {
ShortTestFailureUi tst = new ShortTestFailureUi().initFrom(occurrence, tcIgnited, baseBranchId);
diff --git a/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/tracked/IDetailedStatusForTrackedBranch.java b/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/tracked/IDetailedStatusForTrackedBranch.java
index 1ba1e7c..684aa23 100644
--- a/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/tracked/IDetailedStatusForTrackedBranch.java
+++ b/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/tracked/IDetailedStatusForTrackedBranch.java
@@ -39,6 +39,8 @@ public interface IDetailedStatusForTrackedBranch {
* @param displayMode Suites and tests display mode. Default - failures only.
* @param sortOption Sort mode
* @param maxDurationSec Show test as failed if duration is greater than provided seconds count.
+ * @param showMuted Show muted tests.
+ * @param showIgnored Show ignored tests.
*/
public DsSummaryUi getTrackedBranchTestFailures(
@Nullable String branch,
@@ -51,7 +53,9 @@ public interface IDetailedStatusForTrackedBranch {
@Nullable String tagForHistSelected,
@Nullable DisplayMode displayMode,
@Nullable SortOption sortOption,
- int maxDurationSec);
+ int maxDurationSec,
+ boolean showMuted,
+ boolean showIgnored);
/**
* @param name Name.
diff --git a/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/tracked/TrackedBranchChainsProcessor.java b/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/tracked/TrackedBranchChainsProcessor.java
index d74daf0..6decee6 100644
--- a/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/tracked/TrackedBranchChainsProcessor.java
+++ b/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/tracked/TrackedBranchChainsProcessor.java
@@ -22,6 +22,7 @@ import java.util.Collection;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
import javax.annotation.Nonnull;
@@ -82,7 +83,9 @@ public class TrackedBranchChainsProcessor implements IDetailedStatusForTrackedBr
@Nullable String tagForHistSelected,
@Nullable DisplayMode displayMode,
@Nullable SortOption sortOption,
- int maxDurationSec) {
+ int maxDurationSec,
+ boolean showMuted,
+ boolean showIgnored) {
final DsSummaryUi res = new DsSummaryUi();
final AtomicInteger runningUpdates = new AtomicInteger();
@@ -103,23 +106,11 @@ public class TrackedBranchChainsProcessor implements IDetailedStatusForTrackedBr
ITeamcityIgnited tcIgnited = tcIgnitedProv.server(srvCodeOrAlias, creds);
- java.util.Map<Integer, Integer> requireParamVal = new HashMap<>();
-
- if(!Strings.isNullOrEmpty(tagForHistSelected)) {
- ITcServerConfig cfg = tcBotCfg.getTeamcityConfig(srvCodeOrAlias);
- Collection<? extends IBuildParameterSpec> specs = cfg.filteringParameters();
- for (IBuildParameterSpec buildParameterSpec : specs) {
- Collection<? extends IParameterValueSpec> selection = buildParameterSpec.selection();
- for (IParameterValueSpec valueSpec : selection) {
- if(tagForHistSelected.equals(valueSpec.label())
- && !Strings.isNullOrEmpty(valueSpec.value())) {
-
- requireParamVal.put(
- compactor.getStringId(buildParameterSpec.name()),
- compactor.getStringId(valueSpec.value()));
- }
- }
- }
+ Map<Integer, Integer> requireParamVal = new HashMap<>();
+
+ if (!Strings.isNullOrEmpty(tagForHistSelected)) {
+ requireParamVal.putAll(
+ reverseTagToParametersRequired(tagForHistSelected, srvCodeOrAlias));
}
DsChainUi chainStatus = new DsChainUi(srvCodeOrAlias,
@@ -159,7 +150,8 @@ public class TrackedBranchChainsProcessor implements IDetailedStatusForTrackedBr
runningUpdates.addAndGet(cnt);
chainStatus.initFromContext(tcIgnited, ctx, baseBranchTc, compactor, calcTrustedTests, tagSelected,
- displayMode, maxDurationSec, requireParamVal);
+ displayMode, maxDurationSec, requireParamVal,
+ showMuted, showIgnored);
return chainStatus;
})
@@ -172,6 +164,29 @@ public class TrackedBranchChainsProcessor implements IDetailedStatusForTrackedBr
return res;
}
+ public Map<Integer, Integer> reverseTagToParametersRequired(@Nullable String tagForHistSelected,
+ String srvCodeOrAlias) {
+
+ Map<Integer, Integer> requireParamVal = new HashMap<>();
+
+ ITcServerConfig cfg = tcBotCfg.getTeamcityConfig(srvCodeOrAlias);
+ Collection<? extends IBuildParameterSpec> specs = cfg.filteringParameters();
+ for (IBuildParameterSpec buildParameterSpec : specs) {
+ Collection<? extends IParameterValueSpec> selection = buildParameterSpec.selection();
+ for (IParameterValueSpec valueSpec : selection) {
+ if(tagForHistSelected.equals(valueSpec.label())
+ && !Strings.isNullOrEmpty(valueSpec.value())) {
+
+ requireParamVal.put(
+ compactor.getStringId(buildParameterSpec.name()),
+ compactor.getStringId(valueSpec.value()));
+ }
+ }
+ }
+
+ return requireParamVal;
+ }
+
@Override public GuardBranchStatusUi getBranchSummary(String name, ICredentialsProv prov) {
ITrackedBranch tb = tcBotCfg.getTrackedBranches().getBranchMandatory(name);
List<ITrackedChain> accessibleChains =
diff --git a/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/ui/DsChainUi.java b/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/ui/DsChainUi.java
index 49fe56f..5034abc 100644
--- a/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/ui/DsChainUi.java
+++ b/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/ui/DsChainUi.java
@@ -166,7 +166,9 @@ public class DsChainUi {
@Nullable String tagSelected,
@Nullable DisplayMode displayMode,
int maxDurationSec,
- @Nullable Map<Integer, Integer> requireParamVal) {
+ @Nullable Map<Integer, Integer> requireParamVal,
+ boolean showMuted,
+ boolean showIgnored) {
failedTests = 0;
failedToFinish = 0;
totalTests = 0;
@@ -201,17 +203,18 @@ public class DsChainUi {
if (suite.isFailed()
|| dModeToUse == DisplayMode.ShowAllSuites
- || suite.hasTestToReport(tcIgnited, baseBranchId)
+ || suite.hasTestToReport(tcIgnited, baseBranchId, showMuted, showIgnored)
|| suite.hasLongRunningTest(maxDurationSec)) {
DsSuiteUi suiteCurStatus = new DsSuiteUi()
.initFromContext(tcIgnited,
suite,
baseBranchTc,
compactor,
- true,
calcTrustedTests,
maxDurationSec,
- requireParamVal);
+ requireParamVal,
+ showMuted,
+ showIgnored);
failedTests += suiteCurStatus.failedTests != null ? suiteCurStatus.failedTests : 0;
diff --git a/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/ui/DsSuiteUi.java b/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/ui/DsSuiteUi.java
index cc4f617..c3f49bb 100644
--- a/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/ui/DsSuiteUi.java
+++ b/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/ui/DsSuiteUi.java
@@ -136,19 +136,22 @@ public class DsSuiteUi extends ShortSuiteUi {
* @param suite Suite.
* @param baseBranch Base branch.
* @param compactor String Compactor.
- * @param includeTests Include tests - usually {@code true}, but it may be disabled for speeding up VISA collection.
* @param calcTrustedTests
* @param maxDurationSec 0 or negative means don't indclude. has no effect if tests not included
* @param requireParamVal filtering for runs history based on parameter value selected.
+ * @param showMuted
+ * @param showIgnored
*/
public DsSuiteUi initFromContext(ITeamcityIgnited tcIgnited,
@Nonnull final MultBuildRunCtx suite,
@Nullable final String baseBranch,
@Nonnull IStringCompactor compactor,
- boolean includeTests,
boolean calcTrustedTests,
int maxDurationSec,
- @Nullable Map<Integer, Integer> requireParamVal) {
+ @Nullable Map<Integer, Integer> requireParamVal,
+ boolean showMuted,
+ boolean showIgnored) {
+
String failRateNormalizedBranch = normalizeBranch(baseBranch);
Integer baseBranchId = compactor.getStringIdIfPresent(failRateNormalizedBranch);
IRunHistory baseBranchHist = suite.history(tcIgnited, baseBranchId, requireParamVal);
@@ -175,10 +178,10 @@ public class DsSuiteUi extends ShortSuiteUi {
webToHist = buildWebLinkToHist(tcIgnited, suite);
webToHistBaseBranch = buildWebLinkToHist(tcIgnited, suite, baseBranch);
- if (includeTests) {
+ if (true) {
List<TestCompactedMult> tests = suite.getFilteredTests(test ->
test.hasLongRunningTest(maxDurationSec)
- || test.includeIntoReport(tcIgnited, baseBranchId) );
+ || test.includeIntoReport(tcIgnited, baseBranchId, showMuted, showIgnored));
Function<TestCompactedMult, Float> function = testCompactedMult -> {
IRunHistory res = testCompactedMult.history(tcIgnited, baseBranchId);
diff --git a/tcbot-teamcity-ignited/src/main/java/org/apache/ignite/ci/teamcity/ignited/runhist/Invocation.java b/tcbot-teamcity-ignited/src/main/java/org/apache/ignite/ci/teamcity/ignited/runhist/Invocation.java
index e46aba4..bc8a89d 100644
--- a/tcbot-teamcity-ignited/src/main/java/org/apache/ignite/ci/teamcity/ignited/runhist/Invocation.java
+++ b/tcbot-teamcity-ignited/src/main/java/org/apache/ignite/ci/teamcity/ignited/runhist/Invocation.java
@@ -102,10 +102,6 @@ public class Invocation {
return ChangesState.UNKNOWN;
}
- public boolean isFailure() {
- return status == InvocationData.FAILURE || status == InvocationData.MUTED;
- }
-
public int buildId() {
return buildId;
}
diff --git a/tcbot-teamcity-ignited/src/main/java/org/apache/ignite/ci/teamcity/ignited/runhist/InvocationData.java b/tcbot-teamcity-ignited/src/main/java/org/apache/ignite/ci/teamcity/ignited/runhist/InvocationData.java
index 0e18020..68bc7af 100644
--- a/tcbot-teamcity-ignited/src/main/java/org/apache/ignite/ci/teamcity/ignited/runhist/InvocationData.java
+++ b/tcbot-teamcity-ignited/src/main/java/org/apache/ignite/ci/teamcity/ignited/runhist/InvocationData.java
@@ -18,12 +18,16 @@
package org.apache.ignite.ci.teamcity.ignited.runhist;
import com.google.common.base.MoreObjects;
-import org.apache.ignite.tcignited.history.RunStatus;
-
-import javax.annotation.Nonnull;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Objects;
+import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
+import javax.annotation.Nonnull;
+import org.apache.ignite.tcignited.history.RunStatus;
/**
*
@@ -40,6 +44,15 @@ public class InvocationData {
/** Test is missing in suite run. */
public static final int MISSING = RunStatus.RES_MISSING.getCode();
+ /** Failure muted. */
+ public static final int FAILURE_MUTED = RunStatus.RES_FAILURE_MUTED.getCode();
+
+ /** Ok muted. */
+ public static final int OK_MUTED = RunStatus.RES_OK_MUTED.getCode();
+
+ /** Test Ignored. */
+ public static final int IGNORED = RunStatus.RES_IGNORED.getCode();
+
/** Invocations map from build ID to invocation data. */
private final List<Invocation> invocationList = new ArrayList<>();
@@ -53,7 +66,10 @@ public class InvocationData {
public int notMutedAndNonMissingRunsCount() {
return (int)
invocations(true)
- .filter(invocation -> invocation.status() != MUTED)
+ .filter(invocation -> {
+ byte s = invocation.status();
+ return s != MUTED && s != FAILURE_MUTED && s != OK_MUTED && s != IGNORED;
+ })
.count();
}
diff --git a/tcbot-teamcity-ignited/src/main/java/org/apache/ignite/tcignited/build/TestCompactedV2.java b/tcbot-teamcity-ignited/src/main/java/org/apache/ignite/tcignited/build/TestCompactedV2.java
index 8241b3f..4531efc 100644
--- a/tcbot-teamcity-ignited/src/main/java/org/apache/ignite/tcignited/build/TestCompactedV2.java
+++ b/tcbot-teamcity-ignited/src/main/java/org/apache/ignite/tcignited/build/TestCompactedV2.java
@@ -381,17 +381,18 @@ public class TestCompactedV2 implements ITest {
* @return
*/
public static Invocation toInvocation(
- ITest test,
- FatBuildCompacted build,
- int successStatusStrId) {
+ ITest test,
+ FatBuildCompacted build,
+ int successStatusStrId) {
final boolean failedTest = successStatusStrId != test.status();
- //todo implement IGNORED, MUTED_FAILURE, MUTED_SUCCESS
- final int failCode = failedTest
- ? (test.isIgnoredTest() || test.isMutedTest())
- ? InvocationData.MUTED
- : InvocationData.FAILURE
- : InvocationData.OK;
+ final int failCode;
+ if (test.isIgnoredTest())
+ failCode = InvocationData.IGNORED;
+ else if (test.isMutedTest())
+ failCode = failedTest ? InvocationData.FAILURE_MUTED : InvocationData.OK_MUTED;
+ else
+ failCode = failedTest ? InvocationData.FAILURE : InvocationData.OK;
return new Invocation(build.getId())
.withStatus(failCode)
diff --git a/tcbot-teamcity-ignited/src/main/java/org/apache/ignite/tcignited/history/RunStatus.java b/tcbot-teamcity-ignited/src/main/java/org/apache/ignite/tcignited/history/RunStatus.java
index 7f8171b..e1dba95 100644
--- a/tcbot-teamcity-ignited/src/main/java/org/apache/ignite/tcignited/history/RunStatus.java
+++ b/tcbot-teamcity-ignited/src/main/java/org/apache/ignite/tcignited/history/RunStatus.java
@@ -36,7 +36,14 @@ public enum RunStatus {
/** Result of suite: Critical failure, no results. */
RES_CRITICAL_FAILURE(3),
/** Test is not present in current run */
- RES_MISSING(4);
+ RES_MISSING(4),
+ /** Muted, but test passed. */
+ RES_OK_MUTED(5),
+ /** Muted, and test failed. */
+ RES_FAILURE_MUTED(6),
+ /** Test ignored. */
+ RES_IGNORED(7);
+
/** Mapping of status int -> object. */
private static Map<Integer, RunStatus> holder = Stream.of(values()).collect(Collectors.toMap(RunStatus::getCode, i -> i));
diff --git a/tcbot-teamcity-ignited/src/main/java/org/apache/ignite/tcignited/history/SuiteInvocation.java b/tcbot-teamcity-ignited/src/main/java/org/apache/ignite/tcignited/history/SuiteInvocation.java
index e904bae..274bed7 100644
--- a/tcbot-teamcity-ignited/src/main/java/org/apache/ignite/tcignited/history/SuiteInvocation.java
+++ b/tcbot-teamcity-ignited/src/main/java/org/apache/ignite/tcignited/history/SuiteInvocation.java
@@ -35,7 +35,7 @@ import org.apache.ignite.tcbot.persistence.Persisted;
@Persisted
public class SuiteInvocation implements IVersionedEntity {
/** Latest version. */
- private static final int LATEST_VERSION = 1;
+ private static final int LATEST_VERSION = 2;
/** Entity fields version. */
@SuppressWarnings("FieldCanBeLocal")