use of jetbrains.buildServer.serverSide.impl.BuildTypeImpl in project teamcity-rest by JetBrains.
the class TestOccurrenceFinderTest method testByTest.
@Test
public void testByTest() throws Exception {
final BuildTypeImpl buildType = registerBuildType("buildConf1", "project");
final SFinishedBuild build10 = build().in(buildType).withTest("aaa", false).withTest("bbb", true).withTest("ccc", false).finish();
check("build:(id:" + build10.getBuildId() + ")", TEST_MATCHER, t("aaa", Status.FAILURE, 1), t("bbb", Status.NORMAL, 2), t("ccc", Status.FAILURE, 3));
check("build:(id:" + build10.getBuildId() + "),test:(name:missingTest)", TEST_MATCHER);
check("build:(id:" + build10.getBuildId() + "),test:(name:bbb)", TEST_MATCHER, t("bbb", Status.NORMAL, 2));
check("build:(id:" + build10.getBuildId() + "),test:(currentlyFailing:true)", TEST_MATCHER, t("aaa", Status.FAILURE, 1), t("ccc", Status.FAILURE, 3));
}
use of jetbrains.buildServer.serverSide.impl.BuildTypeImpl in project teamcity-rest by JetBrains.
the class TestOccurrenceFinderTest method testScopeFilter.
@Test
public void testScopeFilter() {
final BuildTypeImpl buildType = registerBuildType("buildConf1", "project");
final SFinishedBuild build10 = build().in(buildType).withTest("package1.class1.aaa", true).withTest("package1.class2.bbb", true).withTest("package2.class1.ccc", true).withTest("package2.class2.ddd", true).finish();
check("build:(id:" + build10.getBuildId() + "),scope:(package:(value:(package1),matchType:equals))", TEST_MATCHER, t("package1.class1.aaa", Status.NORMAL, 1), t("package1.class2.bbb", Status.NORMAL, 2));
check("build:(id:" + build10.getBuildId() + "),scope:(class:(value:(class2),matchType:equals))", TEST_MATCHER, t("package1.class2.bbb", Status.NORMAL, 2), t("package2.class2.ddd", Status.NORMAL, 4));
}
use of jetbrains.buildServer.serverSide.impl.BuildTypeImpl in project teamcity-rest by JetBrains.
the class TestOccurrenceFinderTest method testByTestNameCondition.
@Test
public void testByTestNameCondition() throws Exception {
final BuildTypeImpl buildType = registerBuildType("buildConf1", "project");
final SFinishedBuild build10 = build().in(buildType).withTest("aaabbb", true).withTest("aaa", true).withTest("AAA", true).withTest("bbb", true).withTest("(aaabbb)", true).finish();
int idx = 1;
check("build:(id:" + build10.getBuildId() + "),expandInvocations:true", TEST_MATCHER, t("aaabbb", Status.NORMAL, idx++), t("aaa", Status.NORMAL, idx++), t("AAA", Status.NORMAL, idx++), t("bbb", Status.NORMAL, idx++), t("(aaabbb)", Status.NORMAL, idx++));
Checker test = new Checker<TestRunData, String>(nameDimension -> "build:(id:" + build10.getBuildId() + "),test:(build:(id:" + build10.getBuildId() + "),name:" + nameDimension + ")", testName -> t(testName, Status.NORMAL, null), TEST_MATCHER);
test.check("aaa", "aaa");
test.check("aa");
test.check("(value:aaa)", "aaa");
test.check("(value:aaa,ignoreCase:true)", "aaa", "AAA");
test.check("(value:aaa,matchType:starts-with)", "aaabbb", "aaa");
test.check("(value:ab,matchType:contains)", "aaabbb", "(aaabbb)");
}
use of jetbrains.buildServer.serverSide.impl.BuildTypeImpl in project teamcity-rest by JetBrains.
the class TestOccurrenceFinderTest method testShortStatisticsIsEnoughWhenTestCountersRequested.
@Test
public void testShortStatisticsIsEnoughWhenTestCountersRequested() {
final BuildTypeImpl buildType = registerBuildType("buildConf1", "project");
final SFinishedBuild build = createBuildWithSuccessFailedIgnoredTests(buildType);
assertNotNull("Retrieving counters should be done via short statistics.", myTestOccurrenceFinder.tryGetCachedInfo("build:" + build.getBuildId(), "testCounters(all,success,failed,newFailed,ignored,muted,duration)").getShortStatistics());
}
use of jetbrains.buildServer.serverSide.impl.BuildTypeImpl in project teamcity-rest by JetBrains.
the class TestOccurrenceFinderTest method testBasic.
@Test
public void testBasic() throws Exception {
final BuildTypeImpl buildType = registerBuildType("buildConf1", "project");
final SFinishedBuild build10 = build().in(buildType).withTest("aaa", true).finish();
checkExceptionOnItemSearch(BadRequestException.class, "No_match");
checkExceptionOnItemsSearch(BadRequestException.class, "No_match");
check("build:(id:" + build10.getBuildId() + ")", build10.getFullStatistics().getAllTests().get(0));
check("build:(id:" + build10.getBuildId() + ")", TEST_MATCHER, t("aaa", Status.NORMAL, 1));
int testRunId = build10.getFullStatistics().getAllTests().get(0).getTestRunId();
check("build:(id:" + build10.getBuildId() + "),id:" + testRunId, TEST_MATCHER, t("aaa", Status.NORMAL, 1));
checkExceptionOnItemSearch(BadRequestException.class, "id:" + testRunId);
checkExceptionOnItemsSearch(BadRequestException.class, "id:" + testRunId);
check("build:(id:" + build10.getBuildId() + "),id:" + testRunId + 1);
check("build:(id:" + build10.getBuildId() + "),test:(name:aaa)", TEST_MATCHER, t("aaa", Status.NORMAL, 1));
check("build:(id:" + build10.getBuildId() + "),test:(name:bbb)");
}
Aggregations