-
-
Notifications
You must be signed in to change notification settings - Fork 390
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use process pool for test runner (0.12.x) (#4679)
ported for 0.12.x from #4614 --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
95f1fe3
commit 3bc4294
Showing
122 changed files
with
1,705 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,4 +18,6 @@ dist/ | |
build/ | ||
*.bak | ||
mill-assembly.jar | ||
mill-native | ||
mill-native | ||
*.mill.orig | ||
*.mill.rej |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
//// SNIPPET:BUILD1 | ||
package build | ||
import mill._, javalib._ | ||
|
||
object foo extends JavaModule { | ||
object test extends JavaTests { | ||
def testFramework = "com.novocode.junit.JUnitFramework" | ||
def ivyDeps = Agg( | ||
ivy"com.novocode:junit-interface:0.11", | ||
ivy"org.mockito:mockito-core:4.6.1" | ||
) | ||
def testEnableWorkStealing = true | ||
} | ||
} | ||
//// SNIPPET:END |
11 changes: 11 additions & 0 deletions
11
example/javalib/testing/5-test-stealing/foo/src/foo/Foo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package foo; | ||
|
||
public class Foo { | ||
public static void main(String[] args) { | ||
System.out.println(greet("World")); | ||
} | ||
|
||
public static String greet(String name) { | ||
return "Hello " + name; | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
example/javalib/testing/5-test-stealing/foo/test/src/foo/RandomTestsA.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package foo; | ||
|
||
import org.junit.Test; | ||
|
||
public class RandomTestsA extends RandomTestsUtils { | ||
@Test | ||
public void test1() throws Exception { | ||
testGreeting("Storm", 38); | ||
} | ||
// Removed other tests to simplify | ||
} |
10 changes: 10 additions & 0 deletions
10
example/javalib/testing/5-test-stealing/foo/test/src/foo/RandomTestsB.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package foo; | ||
|
||
import org.junit.Test; | ||
|
||
public class RandomTestsB extends RandomTestsUtils { | ||
@Test | ||
public void test1() throws Exception { | ||
testGreeting("Dakota", 18); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
example/javalib/testing/5-test-stealing/foo/test/src/foo/RandomTestsC.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package foo; | ||
|
||
import org.junit.Test; | ||
|
||
public class RandomTestsC extends RandomTestsUtils { | ||
@Test | ||
public void test1() throws Exception { | ||
testGreeting("Jordan", 95); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
example/javalib/testing/5-test-stealing/foo/test/src/foo/RandomTestsD.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package foo; | ||
|
||
import org.junit.Test; | ||
|
||
public class RandomTestsD extends RandomTestsUtils { | ||
@Test | ||
public void test1() throws Exception { | ||
testGreeting("Kai", 14); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
example/javalib/testing/5-test-stealing/foo/test/src/foo/RandomTestsE.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package foo; | ||
|
||
import org.junit.Test; | ||
|
||
public class RandomTestsE extends RandomTestsUtils { | ||
@Test | ||
public void test1() throws Exception { | ||
testGreeting("Sage", 28); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
example/javalib/testing/5-test-stealing/foo/test/src/foo/RandomTestsF.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package foo; | ||
|
||
import org.junit.Test; | ||
|
||
public class RandomTestsF extends RandomTestsUtils { | ||
@Test | ||
public void test1() throws Exception { | ||
testGreeting("Winter", 12); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
example/javalib/testing/5-test-stealing/foo/test/src/foo/RandomTestsG.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package foo; | ||
|
||
import org.junit.Test; | ||
|
||
public class RandomTestsG extends RandomTestsUtils { | ||
@Test | ||
public void test1() throws Exception { | ||
testGreeting("Finn", 45); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
example/javalib/testing/5-test-stealing/foo/test/src/foo/RandomTestsH.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package foo; | ||
|
||
import org.junit.Test; | ||
|
||
public class RandomTestsH extends RandomTestsUtils { | ||
@Test | ||
public void test1() throws Exception { | ||
testGreeting("Haven", 22); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
example/javalib/testing/5-test-stealing/foo/test/src/foo/RandomTestsI.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package foo; | ||
|
||
import org.junit.Test; | ||
|
||
public class RandomTestsI extends RandomTestsUtils { | ||
@Test | ||
public void test1() throws Exception { | ||
testGreeting("Mars", 16); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
example/javalib/testing/5-test-stealing/foo/test/src/foo/RandomTestsJ.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package foo; | ||
|
||
import org.junit.Test; | ||
|
||
public class RandomTestsJ extends RandomTestsUtils { | ||
@Test | ||
public void test1() throws Exception { | ||
testGreeting("Storm", 38); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
example/javalib/testing/5-test-stealing/foo/test/src/foo/RandomTestsUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package foo; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
public class RandomTestsUtils { | ||
protected void testGreeting(String name, int sleepTime) throws Exception { | ||
String greeted = Foo.greet(name); | ||
Thread.sleep(sleepTime); | ||
assertEquals("Hello " + name, greeted); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
//// SNIPPET:BUILD1 | ||
package build | ||
import mill._, javalib._ | ||
|
||
object foo extends JavaModule { | ||
object test extends JavaTests { | ||
def testFramework = "com.novocode.junit.JUnitFramework" | ||
def ivyDeps = Agg( | ||
ivy"com.novocode:junit-interface:0.11", | ||
ivy"org.mockito:mockito-core:4.6.1" | ||
) | ||
def testForkGrouping = | ||
discoveredTestClasses().groupMapReduce(_.contains("GroupX"))(Seq(_))(_ ++ _).toSeq.sortBy( | ||
data => !data._1 | ||
).map(_._2) | ||
def testEnableWorkStealing = true | ||
} | ||
} | ||
//// SNIPPET:END |
11 changes: 11 additions & 0 deletions
11
example/javalib/testing/6-test-group-stealing/foo/src/foo/Foo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package foo; | ||
|
||
public class Foo { | ||
public static void main(String[] args) { | ||
System.out.println(greet("World")); | ||
} | ||
|
||
public static String greet(String name) { | ||
return "Hello " + name; | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
example/javalib/testing/6-test-group-stealing/foo/test/src/foo/GroupX1.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package foo; | ||
|
||
import org.junit.Test; | ||
|
||
public class GroupX1 extends RandomTestsUtils { | ||
@Test | ||
public void test1() throws Exception { | ||
testGreeting("Aether", 55); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
example/javalib/testing/6-test-group-stealing/foo/test/src/foo/GroupX10.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package foo; | ||
|
||
import org.junit.Test; | ||
|
||
public class GroupX10 extends RandomTestsUtils { | ||
@Test | ||
public void test1() throws Exception { | ||
testGreeting("Echo", 52); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
example/javalib/testing/6-test-group-stealing/foo/test/src/foo/GroupX2.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package foo; | ||
|
||
import org.junit.Test; | ||
|
||
public class GroupX2 extends RandomTestsUtils { | ||
@Test | ||
public void test1() throws Exception { | ||
testGreeting("Chronos", 35); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
example/javalib/testing/6-test-group-stealing/foo/test/src/foo/GroupX3.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package foo; | ||
|
||
import org.junit.Test; | ||
|
||
public class GroupX3 extends RandomTestsUtils { | ||
@Test | ||
public void test1() throws Exception { | ||
testGreeting("Fortuna", 25); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
example/javalib/testing/6-test-group-stealing/foo/test/src/foo/GroupX4.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package foo; | ||
|
||
import org.junit.Test; | ||
|
||
public class GroupX4 extends RandomTestsUtils { | ||
@Test | ||
public void test1() throws Exception { | ||
testGreeting("Janus", 21); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
example/javalib/testing/6-test-group-stealing/foo/test/src/foo/GroupX5.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package foo; | ||
|
||
import org.junit.Test; | ||
|
||
public class GroupX5 extends RandomTestsUtils { | ||
@Test | ||
public void test1() throws Exception { | ||
testGreeting("Orion", 95); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
example/javalib/testing/6-test-group-stealing/foo/test/src/foo/GroupX6.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package foo; | ||
|
||
import org.junit.Test; | ||
|
||
public class GroupX6 extends RandomTestsUtils { | ||
@Test | ||
public void test1() throws Exception { | ||
testGreeting("Perseus", 34); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
example/javalib/testing/6-test-group-stealing/foo/test/src/foo/GroupX7.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package foo; | ||
|
||
import org.junit.Test; | ||
|
||
public class GroupX7 extends RandomTestsUtils { | ||
@Test | ||
public void test1() throws Exception { | ||
testGreeting("Selene", 52); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
example/javalib/testing/6-test-group-stealing/foo/test/src/foo/GroupX8.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package foo; | ||
|
||
import org.junit.Test; | ||
|
||
public class GroupX8 extends RandomTestsUtils { | ||
@Test | ||
public void test1() throws Exception { | ||
testGreeting("Uranus", 25); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
example/javalib/testing/6-test-group-stealing/foo/test/src/foo/GroupX9.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package foo; | ||
|
||
import org.junit.Test; | ||
|
||
public class GroupX9 extends RandomTestsUtils { | ||
@Test | ||
public void test1() throws Exception { | ||
testGreeting("Ymir", 17); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
example/javalib/testing/6-test-group-stealing/foo/test/src/foo/GroupY1.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package foo; | ||
|
||
import org.junit.Test; | ||
|
||
public class GroupY1 extends RandomTestsUtils { | ||
@Test | ||
public void test1() throws Exception { | ||
testGreeting("Hades", 15); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
example/javalib/testing/6-test-group-stealing/foo/test/src/foo/GroupY10.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package foo; | ||
|
||
import org.junit.Test; | ||
|
||
public class GroupY10 extends RandomTestsUtils { | ||
@Test | ||
public void test1() throws Exception { | ||
testGreeting("Rama", 25); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
example/javalib/testing/6-test-group-stealing/foo/test/src/foo/GroupY2.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package foo; | ||
|
||
import org.junit.Test; | ||
|
||
public class GroupY2 extends RandomTestsUtils { | ||
@Test | ||
public void test1() throws Exception { | ||
testGreeting("Odin", 34); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
example/javalib/testing/6-test-group-stealing/foo/test/src/foo/GroupY3.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package foo; | ||
|
||
import org.junit.Test; | ||
|
||
public class GroupY3 extends RandomTestsUtils { | ||
@Test | ||
public void test1() throws Exception { | ||
testGreeting("Ra", 21); | ||
} | ||
} |
Oops, something went wrong.