fixup [build] Fix JUnit 3 test suites warnings during test discovery everywhere (IJI-3451)

GitOrigin-RevId: d891e542c397ed7f18b010682280e58cf79e881e
This commit is contained in:
Ilia Kirianovskii
2026-02-12 08:31:10 +00:00
committed by intellij-monorepo-bot
parent 45a509f335
commit 06c4e8785a
5 changed files with 50 additions and 36 deletions
@@ -234,23 +234,10 @@ public final class JUnit5TeamCityRunner {
}
public static class TCLogRecordListener extends LogRecordListener {
private static final List<String> KNOWN_EXCEPTIONAL_WARNINGS = List.of( // TODO: migrate these tests to JUnit 5
private static final List<String> KNOWN_EXCEPTIONAL_WARNINGS = List.of(
"Discovered 2 'junit-platform.properties' configuration files on the classpath (see below); only the first (*) will be used.", // https://github.com/junit-team/junit-framework/issues/2794
"Discovered 3 'junit-platform.properties' configuration files on the classpath (see below); only the first (*) will be used.",
"Discovered 4 'junit-platform.properties' configuration files on the classpath (see below); only the first (*) will be used.",
"Runner org.jetbrains.plugins.ruby.ruby.runners.GemSuite (used on class ",
"Runner org.jetbrains.plugins.ruby.ruby.runners.IndexingModeSuite (used on ",
"Runner org.junit.internal.runners.SuiteMethod (used on class com.intellij.codeInsight.template.emmet.HtmlEmmetAbbreviationTest) was not able to satisfy all filter requests.",
"Runner org.junit.internal.runners.SuiteMethod (used on class com.intellij.codeInsight.template.emmet.XslEmmetAbbreviationTest) was not able to satisfy all filter requests.",
"Runner org.junit.internal.runners.SuiteMethod (used on class com.intellij.codeInsight.template.emmet.filters.BemEmmetFilterTest) was not able to satisfy all filter requests.",
"Runner org.junit.internal.runners.SuiteMethod (used on class css.emmet.CssPropertiesEmmetAbbreviationTest) was not able to satisfy all filter requests.",
"Runner org.junit.runners.Parameterized (used on class com.intellij.database.grid.DataGridInsertRowWithValueTest) was not able to satisfy all filter requests.",
"Runner org.junit.runners.Parameterized (used on class com.intellij.lang.ruby.rbs.psi.data.RbsTypeSignatureSubtypeCheckerTest) was not able to satisfy all filter requests.",
"Runner org.junit.runners.Parameterized (used on class com.intellij.selenium.shared.pageobject.englishWordDetector.EnglishWordDetectorTest) was not able to satisfy all filter requests.",
"Runner org.junit.runners.Parameterized (used on class com.intellij.sql.SqlLiveTemplatesTest) was not able to satisfy all filter requests.",
"Runner org.junit.runners.Parameterized (used on class com.intellij.sql.completion.AllSqlCompletionTest) was not able to satisfy all filter requests.",
"Runner org.junit.runners.Parameterized (used on class com.intellij.sql.refactoring.SqlExtractNamedQueryTest) was not able to satisfy all filter requests.",
"Runner org.junit.runners.Parameterized (used on class com.jetbrains.rd.platform.codeWithMe.FileManifestUtilTest) was not able to satisfy all filter requests."
"Discovered 4 'junit-platform.properties' configuration files on the classpath (see below); only the first (*) will be used."
);
@Override
@@ -85,7 +85,7 @@ public abstract class EmmetAbbreviationTestSuite extends TestSuite {
protected void addTest(String source, String expected, @Nullable TestInitializer setUp, String... extensions) {
for (String extension : extensions) {
super.addTest(new EmmetAbbreviation(source, expected, extension, false, setUp) {});
super.addTest(new EmmetAbbreviation(source, expected, /* name */ source, extension, false, setUp) {});
}
}
@@ -95,10 +95,18 @@ public abstract class EmmetAbbreviationTestSuite extends TestSuite {
protected void addTestWithPositionCheck(String source, String expected, @Nullable TestInitializer setUp, String... extensions) {
for (String extension : extensions) {
super.addTest(new EmmetAbbreviation(source, expected, extension, true, setUp) {});
super.addTest(new EmmetAbbreviation(source, expected, /* name */ source, extension, true, setUp) {});
}
}
protected void addTestWithName(String source, String name, String expected, @Nullable TestInitializer setUp, String extension) {
super.addTest(new EmmetAbbreviation(source, expected, name, extension, false, setUp) {});
}
protected void addTestWithNameWithPositionCheck(String source, String name, String expected, @Nullable TestInitializer setUp, String extension) {
super.addTest(new EmmetAbbreviation(source, expected, name, extension, true, setUp) {});
}
@Override
public String getName() {
return getClass().getName();
@@ -114,6 +122,7 @@ public abstract class EmmetAbbreviationTestSuite extends TestSuite {
}
private abstract class EmmetAbbreviation extends BasePlatformTestCase {
private final String name;
private final String extension;
private final String sourceData;
private final String expectedData;
@@ -124,9 +133,11 @@ public abstract class EmmetAbbreviationTestSuite extends TestSuite {
EmmetAbbreviation(@NotNull String sourceData,
@NotNull String expectedData,
@NotNull String name,
@NotNull String extension,
boolean checkPosition,
@Nullable TestInitializer initializer) {
this.name = name;
this.extension = extension;
this.sourceData = sourceData;
this.expectedData = expectedData;
@@ -219,7 +230,7 @@ public abstract class EmmetAbbreviationTestSuite extends TestSuite {
@Override
public String toString() {
return (sourceData + " in " + extension).replace('\n', ' ').replaceAll(" ", "");
return (name + " in " + extension).replace('\n', ' ').replaceAll(" ", "");
}
@Override
@@ -175,7 +175,7 @@ public class HtmlEmmetAbbreviationTest extends EmmetAbbreviationTestSuite {
addTest("span#one.two[title data]", "<span id=\"one\" class=\"two\" title=\"\" data=\"\"></span>");
addTest("span[title=Hello]", "<span title=\"Hello\"></span>");
addTest("span[title=\"Hello world\"]", "<span title=\"Hello world\"></span>");
addTest("span[title=\"Hello world\"]", "<span title=\"Hello world\"></span>");
addTestWithName("span[title=\"Hello world\"]", "span[title=\"Hello world\"] #2", "<span title=\"Hello world\"></span>");
addTest("span[title=\"Hello world\" data=other]", "<span title=\"Hello world\" data=\"other\"></span>");
addTest("span[title=\"Hello world\" data=other attr2 attr3]",
"<span title=\"Hello world\" data=\"other\" attr2=\"\" attr3=\"\"></span>");
@@ -192,7 +192,7 @@ public class HtmlEmmetAbbreviationTest extends EmmetAbbreviationTestSuite {
addTest("a[title=Google http://google.com]", "<a href=\"http://google.com\" title=\"Google\"></a>");
addTest("img[image.png]", "<img src=\"image.png\" alt=\"\">");
addTest("link[style.css]", "<link rel=\"stylesheet\" href=\"style.css\">");
addTest("script", "<script></script>");
addTestWithName("script", "script #2", "<script></script>");
addTest("script[src]", "<script src=\"\"></script>");
addTest("script[file.js]", "<script src=\"file.js\"></script>");
addTest("script[/packages/requiejs/require.js]", "<script src=\"/packages/requiejs/require.js\"></script>");
@@ -214,13 +214,13 @@ public class HtmlEmmetAbbreviationTest extends EmmetAbbreviationTestSuite {
addTestWithInit("div.editor[a. title=test]", "<div class=\"editor\" a title=\"test\">|</div>", compactBooleanAllowed(true));
addTestWithInit("b[a.]", "<b a=\"a\"></b>", compactBooleanAllowed(false));
addTestWithInit("track[default]", "<track default=\"default\">", compactBooleanAllowed(false));
addTestWithName("track[default]", "track[default] #2", "<track default=\"default\">", compactBooleanAllowed(false));
addTestWithInit("button:d", "<button disabled></button>", compactBooleanAllowed(true));
addTestWithInit("button:d", "<button disabled=\"disabled\"></button>", compactBooleanAllowed(false));
addTestWithName("button:d", "button:d #2", "<button disabled></button>", compactBooleanAllowed(true));
addTestWithName("button:d", "button:d #3", "<button disabled=\"disabled\"></button>", compactBooleanAllowed(false));
addTestWithInit("input[title]", "<input type=\"text\" title=\"\">", null);
addTestWithInit("input[title]", "<input type=\"text\" title>", (fixture, testRootDisposable) -> {
addTestWithName("input[title]", "input[title] #2", "<input type=\"text\" title>", (fixture, testRootDisposable) -> {
final HtmlUnknownBooleanAttributeInspection inspection = new HtmlUnknownBooleanAttributeInspection();
inspection.updateAdditionalEntries("title", testRootDisposable);
fixture.enableInspections(inspection);
@@ -234,7 +234,7 @@ public class HtmlEmmetAbbreviationTest extends EmmetAbbreviationTestSuite {
<td>|</td>
<td>|</td>
</tr>""", withAddEndEditPoint(false));
addTestWithPositionCheck("tr>td+td+td", """
addTestWithNameWithPositionCheck("tr>td+td+td", "tr>td+td+td #2", """
<tr>
<td>|</td>
<td>|</td>
@@ -252,7 +252,7 @@ public class HtmlEmmetAbbreviationTest extends EmmetAbbreviationTestSuite {
}
private void addExpandosTests() {
addTest("dl+", "<dl><dt></dt><dd></dd></dl>");
addTestWithName("dl+", "dl+ #2", "<dl><dt></dt><dd></dd></dl>");
addTest("div+div>dl+", "<div></div><div><dl><dt></dt><dd></dd></dl></div>");
}
@@ -338,10 +338,10 @@ public class HtmlEmmetAbbreviationTest extends EmmetAbbreviationTestSuite {
}
private void addGroupMultiplicationTests() {
addTest("(span.i$)*3", "<span class=\"i1\"></span><span class=\"i2\"></span><span class=\"i3\"></span>");
addTest("p.p$*2>(i.i$+b.b$)*3",
addTestWithName("(span.i$)*3", "(span.i$)*3 #2", "<span class=\"i1\"></span><span class=\"i2\"></span><span class=\"i3\"></span>");
addTestWithName("p.p$*2>(i.i$+b.b$)*3", "p.p$*2>(i.i$+b.b$)*3 #2",
"<p class=\"p1\"><i class=\"i1\"></i><b class=\"b1\"></b><i class=\"i2\"></i><b class=\"b2\"></b><i class=\"i3\"></i><b class=\"b3\"></b></p><p class=\"p2\"><i class=\"i1\"></i><b class=\"b1\"></b><i class=\"i2\"></i><b class=\"b2\"></b><i class=\"i3\"></i><b class=\"b3\"></b></p>");
addTest("(p.i$+ul>li.i$*2>span.s$)*3",
addTestWithName("(p.i$+ul>li.i$*2>span.s$)*3", "(p.i$+ul>li.i$*2>span.s$)*3 #2",
"<p class=\"i1\"></p><ul><li class=\"i1\"><span class=\"s1\"></span></li><li class=\"i2\"><span class=\"s2\"></span></li></ul><p class=\"i2\"></p><ul><li class=\"i1\"><span class=\"s1\"></span></li><li class=\"i2\"><span class=\"s2\"></span></li></ul><p class=\"i3\"></p><ul><li class=\"i1\"><span class=\"s1\"></span></li><li class=\"i2\"><span class=\"s2\"></span></li></ul>");
}
@@ -403,6 +403,18 @@ public class HtmlEmmetAbbreviationTest extends EmmetAbbreviationTestSuite {
addTestWithPositionCheck(source, expected, setUp, "html");
}
private void addTestWithName(String source, String name, String expected) {
addTestWithName(source, name, expected, null);
}
private void addTestWithName(String source, String name, String expected, @Nullable TestInitializer setUp) {
super.addTestWithName(source, name, expected, setUp, "html");
}
private void addTestWithNameWithPositionCheck(String source, String name, String expected, @Nullable TestInitializer setUp) {
super.addTestWithNameWithPositionCheck(source, name, expected, setUp, "html");
}
@NotNull
private static TestInitializer compactBooleanAllowed(final boolean compactBooleanAllowed) {
return (fixture, testRootDisposable) -> HtmlUtil
@@ -30,11 +30,11 @@ public class XslEmmetAbbreviationTest extends EmmetAbbreviationTestSuite {
* Tests from https://github.com/emmetio/emmet/blob/master/javascript/unittest/tests/expandAbbreviation.js
*/
public void addXslTests() {
addTest("tmatch", "<xsl:template match=\"\" mode=\"\"></xsl:template>", "xsl");
addTest("choose", "<xsl:choose><xsl:when test=\"\"></xsl:when><xsl:otherwise></xsl:otherwise></xsl:choose>", "xsl");
super.addTestWithName("tmatch", "tmatch #2", "<xsl:template match=\"\" mode=\"\"></xsl:template>", null, "xsl");
super.addTestWithName("choose", "choose #2", "<xsl:choose><xsl:when test=\"\"></xsl:when><xsl:otherwise></xsl:otherwise></xsl:choose>", null, "xsl");
addTest("xsl:variable>div+p", "<xsl:variable><div></div><p></p></xsl:variable>", "xsl");
addTest("var>div+p", "<xsl:variable name=\"\"><div></div><p></p></xsl:variable>", "xsl");
addTest("ap", "<xsl:apply-templates select=\"\" mode=\"\" />", "xsl");
super.addTestWithName("ap", "ap #2", "<xsl:apply-templates select=\"\" mode=\"\" />", null, "xsl");
addTest("ap>wp*2",
"<xsl:apply-templates select=\"\" mode=\"\"><xsl:with-param name=\"\" select=\"\" /><xsl:with-param name=\"\" select=\"\" /></xsl:apply-templates>",
"xsl");
@@ -32,7 +32,7 @@ public class BemEmmetFilterTest extends EmmetAbbreviationTestSuite {
addTest(".b1>.b2_m1>.__e1+.____e2_m2|bem",
"<div class=\"b1\">\n\t<div class=\"b2 b2_m1\">\n\t\t<div class=\"b2__e1\"></div>\n\t\t<div class=\"b1__e2 b1__e2_m2\"></div>\n\t</div>\n</div>");
addTest(".b>.__e1>.__e2|bem", "<div class=\"b\">\n\t<div class=\"b__e1\">\n\t\t<div class=\"b__e2\"></div>\n\t</div>\n</div>");
addTest(".b>.__e1>.____e2|bem", "<div class=\"b\">\n\t<div class=\"b__e1\">\n\t\t<div class=\"b__e2\"></div>\n\t</div>\n</div>");
addTestWithName(".b>.__e1>.____e2|bem", ".b>.__e1>.____e2|bem #2", "<div class=\"b\">\n\t<div class=\"b__e1\">\n\t\t<div class=\"b__e2\"></div>\n\t</div>\n</div>");
addTest(".b._mod|bem", "<div class=\"b b_mod\"></div>");
addTest("form.search-form._wide>input.-query-string+input:s.-btn_large|bem",
"<form action=\"\" class=\"search-form search-form_wide\"><input type=\"text\" class=\"search-form__query-string\"><input\n" +
@@ -47,8 +47,8 @@ public class BemEmmetFilterTest extends EmmetAbbreviationTestSuite {
}
private void addBem2Tests() {
addTest(".b_m1._m2|bem", "<div class=\"b b_m1 b_m2\"></div>");
addTest(".b._mod|bem", "<div class=\"b b_mod\"></div>");
addTestWithName(".b_m1._m2|bem", ".b_m1._m2|bem #2", "<div class=\"b b_m1 b_m2\"></div>");
addTestWithName(".b._mod|bem", ".b._mod|bem #2", "<div class=\"b b_mod\"></div>");
}
private void addRegressionTests() {
@@ -64,7 +64,7 @@ public class BemEmmetFilterTest extends EmmetAbbreviationTestSuite {
private void addConfigurableTests() {
addTest(".b9m|bem", "<div class=\"b b9m\"></div>", createBemTestInitializer("__", "9", "-"), "html");
addTest(".b9m|bem", "<div class=\"b9mb9m\"></div>", createBemTestInitializer("", "", ""), "html");
addTestWithName(".b9m|bem", ".b9m|bem #2", "<div class=\"b9mb9m\"></div>", createBemTestInitializer("", "", ""), "html");
addTest(".b>.Ыe|bem", """
<div class="b">
<div class="bЫe"></div>
@@ -94,4 +94,8 @@ public class BemEmmetFilterTest extends EmmetAbbreviationTestSuite {
private void addTest(String sourceData, String expectedData) {
addTest(sourceData, expectedData, "html");
}
private void addTestWithName(String sourceData, String name, String expectedData) {
super.addTestWithName(sourceData, name, expectedData, null, "html");
}
}