fix(run): run selected Maven tests even when the build skips tests (#5521)

Running a JUnit test or class from the gutter only compiled when the build skipped tests through skipTests/maven.test.skip in POM properties or .mvn/maven.config: Maven printed 'Tests are skipped' and the Run window showed No tests. Every Maven test selection (gutter, JUnit configurations, package runs, Rerun Failed Tests) goes through withMavenTests, which now also passes -DskipTests=false -Dmaven.test.skip=false; when nothing ran, the console says why it may have been skipped. Fixes #5518.

Co-authored-by: wildcatDownstairs <[email protected]>
Цей коміт міститься в:
LU XIANGRUIтаwildcatDownstairs authored and GitHub committed 2026-11-24 21:10:45 +08:00
1 джерело bee5e2ed1f
коміт bb850b25d6
10 files changed
+102 -12

No files matched your search

+14 -2
Переглянути файл
@@ -264,12 +264,24 @@ describe("application configurations", () => {
const file = cfg({
id: "f",
kind: "maven",
args: ["test", "-Dtest=OrderTest", "-Dsurefire.failIfNoSpecifiedTests=false"],
args: [
"test",
"-Dtest=OrderTest",
"-Dsurefire.failIfNoSpecifiedTests=false",
"-DskipTests=false",
"-Dmaven.test.skip=false",
],
isTest: true,
});
expect(jvmTestConfig(file, "a.OrderTest$Nested", "fails")).toMatchObject({
name: "Nested.fails",
args: ["test", "-Dtest=a.OrderTest$Nested#fails", "-Dsurefire.failIfNoSpecifiedTests=false"],
args: [
"test",
"-Dtest=a.OrderTest$Nested#fails",
"-Dsurefire.failIfNoSpecifiedTests=false",
"-DskipTests=false",
"-Dmaven.test.skip=false",
],
});
const gradle = cfg({ id: "g", kind: "gradle", args: ["test", "--tests", "*OrderTest"], isTest: true });
expect(jvmTestConfig(gradle, "a.OrderTest", undefined)!.args).toEqual(["test", "--tests", "a.OrderTest"]);