Skip to content

Commit 709e9dc

Browse files
committed
TEMP: filter flaky test from mockito test sources
1 parent e17144d commit 709e9dc

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

example/thirdparty/mockito/build.mill

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,20 @@ trait MockitoModule extends MavenModule{
4242
def testRuntimeIvyDeps: T[Agg[Dep]] = Agg.empty[Dep]
4343
def testFramework = "com.novocode.junit.JUnitFramework"
4444
def testForkArgs: T[Seq[String]] = Seq.empty[String]
45+
46+
def testFilteredSources: T[Seq[PathRef]] = Task { Seq.empty }
47+
4548
object test extends MavenTests{
4649
def moduleDeps = super.moduleDeps ++ MockitoModule.this.testModuleDeps
4750
def testFramework = MockitoModule.this.testFramework
4851
def runIvyDeps = testRuntimeIvyDeps()
4952
def forkArgs = testForkArgs()
53+
def allSourceFiles = Task {
54+
val base = super.allSourceFiles()
55+
val filtered = testFilteredSources().toSet
56+
if (filtered.isEmpty) base
57+
else base.filterNot(filtered.contains)
58+
}
5059
def ivyDeps =
5160
testIvyDeps() ++
5261
Agg(
@@ -85,6 +94,11 @@ object `package` extends RootModule with MockitoModule{
8594
super.resources() ++ Seq(PathRef(Task.dest))
8695
}
8796

97+
def testFilteredSources: T[Seq[PathRef]] = Task {
98+
// test `add_listeners_concurrently_sanity_check` is flaky
99+
Seq(PathRef(millSourcePath / "src/test/java/org/mockitousage/debugging/StubbingLookupListenerCallbackTest.java"))
100+
}
101+
88102
object subprojects extends Module {
89103
object android extends MockitoModule {
90104
def moduleDeps = Seq(build)

0 commit comments

Comments
 (0)