From 05539ad7e95b22c79ebd8e60fbcf9fd74b600b9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Petrovick=C3=BD?= Date: Wed, 4 Dec 2024 10:15:52 +0100 Subject: [PATCH] test: run OpenRewrite recipe tests in parallel --- .../timefold/solver/migration/v8/AsConstraintRecipeTest.java | 3 +++ .../timefold/solver/migration/v8/ConstraintRefRecipeTest.java | 3 +++ .../ai/timefold/solver/migration/v8/NullableRecipeTest.java | 3 +++ .../migration/v8/RemoveConstraintPackageRecipeTest.java | 3 +++ .../timefold/solver/migration/v8/ScoreGettersRecipeTest.java | 3 +++ .../solver/migration/v8/ScoreManagerMethodsRecipeTest.java | 3 +++ .../migration/v8/SingleConstraintAssertionRecipeTest.java | 3 +++ .../v8/SolutionManagerRecommendAssignmentRecipeTest.java | 3 +++ .../solver/migration/v8/SolverManagerBuilderRecipeTest.java | 3 +++ migration/src/test/resources/junit-platform.properties | 4 ++++ 10 files changed, 31 insertions(+) create mode 100644 migration/src/test/resources/junit-platform.properties diff --git a/migration/src/test/java/ai/timefold/solver/migration/v8/AsConstraintRecipeTest.java b/migration/src/test/java/ai/timefold/solver/migration/v8/AsConstraintRecipeTest.java index 00c49947ba..d762de0303 100644 --- a/migration/src/test/java/ai/timefold/solver/migration/v8/AsConstraintRecipeTest.java +++ b/migration/src/test/java/ai/timefold/solver/migration/v8/AsConstraintRecipeTest.java @@ -5,9 +5,12 @@ import ai.timefold.solver.migration.AbstractRecipe; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.parallel.Execution; +import org.junit.jupiter.api.parallel.ExecutionMode; import org.openrewrite.test.RecipeSpec; import org.openrewrite.test.RewriteTest; +@Execution(ExecutionMode.CONCURRENT) class AsConstraintRecipeTest implements RewriteTest { @Override diff --git a/migration/src/test/java/ai/timefold/solver/migration/v8/ConstraintRefRecipeTest.java b/migration/src/test/java/ai/timefold/solver/migration/v8/ConstraintRefRecipeTest.java index 62eb0a5f82..0fc6ca9a3e 100644 --- a/migration/src/test/java/ai/timefold/solver/migration/v8/ConstraintRefRecipeTest.java +++ b/migration/src/test/java/ai/timefold/solver/migration/v8/ConstraintRefRecipeTest.java @@ -5,9 +5,12 @@ import ai.timefold.solver.migration.AbstractRecipe; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.parallel.Execution; +import org.junit.jupiter.api.parallel.ExecutionMode; import org.openrewrite.test.RecipeSpec; import org.openrewrite.test.RewriteTest; +@Execution(ExecutionMode.CONCURRENT) class ConstraintRefRecipeTest implements RewriteTest { @Override diff --git a/migration/src/test/java/ai/timefold/solver/migration/v8/NullableRecipeTest.java b/migration/src/test/java/ai/timefold/solver/migration/v8/NullableRecipeTest.java index 58bd920b52..3180856139 100644 --- a/migration/src/test/java/ai/timefold/solver/migration/v8/NullableRecipeTest.java +++ b/migration/src/test/java/ai/timefold/solver/migration/v8/NullableRecipeTest.java @@ -5,9 +5,12 @@ import ai.timefold.solver.migration.AbstractRecipe; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.parallel.Execution; +import org.junit.jupiter.api.parallel.ExecutionMode; import org.openrewrite.test.RecipeSpec; import org.openrewrite.test.RewriteTest; +@Execution(ExecutionMode.CONCURRENT) class NullableRecipeTest implements RewriteTest { @Override diff --git a/migration/src/test/java/ai/timefold/solver/migration/v8/RemoveConstraintPackageRecipeTest.java b/migration/src/test/java/ai/timefold/solver/migration/v8/RemoveConstraintPackageRecipeTest.java index de7c843ea5..0a691f6bc2 100644 --- a/migration/src/test/java/ai/timefold/solver/migration/v8/RemoveConstraintPackageRecipeTest.java +++ b/migration/src/test/java/ai/timefold/solver/migration/v8/RemoveConstraintPackageRecipeTest.java @@ -5,9 +5,12 @@ import ai.timefold.solver.migration.AbstractRecipe; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.parallel.Execution; +import org.junit.jupiter.api.parallel.ExecutionMode; import org.openrewrite.test.RecipeSpec; import org.openrewrite.test.RewriteTest; +@Execution(ExecutionMode.CONCURRENT) class RemoveConstraintPackageRecipeTest implements RewriteTest { @Override diff --git a/migration/src/test/java/ai/timefold/solver/migration/v8/ScoreGettersRecipeTest.java b/migration/src/test/java/ai/timefold/solver/migration/v8/ScoreGettersRecipeTest.java index c886d41a2a..45de77b124 100644 --- a/migration/src/test/java/ai/timefold/solver/migration/v8/ScoreGettersRecipeTest.java +++ b/migration/src/test/java/ai/timefold/solver/migration/v8/ScoreGettersRecipeTest.java @@ -5,9 +5,12 @@ import ai.timefold.solver.migration.AbstractRecipe; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.parallel.Execution; +import org.junit.jupiter.api.parallel.ExecutionMode; import org.openrewrite.test.RecipeSpec; import org.openrewrite.test.RewriteTest; +@Execution(ExecutionMode.CONCURRENT) class ScoreGettersRecipeTest implements RewriteTest { @Override diff --git a/migration/src/test/java/ai/timefold/solver/migration/v8/ScoreManagerMethodsRecipeTest.java b/migration/src/test/java/ai/timefold/solver/migration/v8/ScoreManagerMethodsRecipeTest.java index 4ad4fcfe71..a12b6f5840 100644 --- a/migration/src/test/java/ai/timefold/solver/migration/v8/ScoreManagerMethodsRecipeTest.java +++ b/migration/src/test/java/ai/timefold/solver/migration/v8/ScoreManagerMethodsRecipeTest.java @@ -5,9 +5,12 @@ import ai.timefold.solver.migration.AbstractRecipe; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.parallel.Execution; +import org.junit.jupiter.api.parallel.ExecutionMode; import org.openrewrite.test.RecipeSpec; import org.openrewrite.test.RewriteTest; +@Execution(ExecutionMode.CONCURRENT) class ScoreManagerMethodsRecipeTest implements RewriteTest { @Override diff --git a/migration/src/test/java/ai/timefold/solver/migration/v8/SingleConstraintAssertionRecipeTest.java b/migration/src/test/java/ai/timefold/solver/migration/v8/SingleConstraintAssertionRecipeTest.java index 432ae4da9b..a28f23856b 100644 --- a/migration/src/test/java/ai/timefold/solver/migration/v8/SingleConstraintAssertionRecipeTest.java +++ b/migration/src/test/java/ai/timefold/solver/migration/v8/SingleConstraintAssertionRecipeTest.java @@ -5,9 +5,12 @@ import ai.timefold.solver.migration.AbstractRecipe; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.parallel.Execution; +import org.junit.jupiter.api.parallel.ExecutionMode; import org.openrewrite.test.RecipeSpec; import org.openrewrite.test.RewriteTest; +@Execution(ExecutionMode.CONCURRENT) class SingleConstraintAssertionRecipeTest implements RewriteTest { @Override diff --git a/migration/src/test/java/ai/timefold/solver/migration/v8/SolutionManagerRecommendAssignmentRecipeTest.java b/migration/src/test/java/ai/timefold/solver/migration/v8/SolutionManagerRecommendAssignmentRecipeTest.java index 2a1c3bc0d0..07aefba6df 100644 --- a/migration/src/test/java/ai/timefold/solver/migration/v8/SolutionManagerRecommendAssignmentRecipeTest.java +++ b/migration/src/test/java/ai/timefold/solver/migration/v8/SolutionManagerRecommendAssignmentRecipeTest.java @@ -5,9 +5,12 @@ import ai.timefold.solver.migration.AbstractRecipe; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.parallel.Execution; +import org.junit.jupiter.api.parallel.ExecutionMode; import org.openrewrite.test.RecipeSpec; import org.openrewrite.test.RewriteTest; +@Execution(ExecutionMode.CONCURRENT) class SolutionManagerRecommendAssignmentRecipeTest implements RewriteTest { @Override diff --git a/migration/src/test/java/ai/timefold/solver/migration/v8/SolverManagerBuilderRecipeTest.java b/migration/src/test/java/ai/timefold/solver/migration/v8/SolverManagerBuilderRecipeTest.java index 5e151367e7..47ef3111dc 100644 --- a/migration/src/test/java/ai/timefold/solver/migration/v8/SolverManagerBuilderRecipeTest.java +++ b/migration/src/test/java/ai/timefold/solver/migration/v8/SolverManagerBuilderRecipeTest.java @@ -5,9 +5,12 @@ import ai.timefold.solver.migration.AbstractRecipe; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.parallel.Execution; +import org.junit.jupiter.api.parallel.ExecutionMode; import org.openrewrite.test.RecipeSpec; import org.openrewrite.test.RewriteTest; +@Execution(ExecutionMode.CONCURRENT) class SolverManagerBuilderRecipeTest implements RewriteTest { @Override diff --git a/migration/src/test/resources/junit-platform.properties b/migration/src/test/resources/junit-platform.properties new file mode 100644 index 0000000000..3ce7bcac01 --- /dev/null +++ b/migration/src/test/resources/junit-platform.properties @@ -0,0 +1,4 @@ +junit.jupiter.execution.parallel.enabled = true +junit.jupiter.execution.parallel.config.strategy = dynamic +junit.jupiter.execution.parallel.config.dynamic.factor = 0.75 +