Add testQuickUntilPassed
This commit is contained in:
parent
8d990a631a
commit
23becc4565
3 changed files with 51 additions and 0 deletions
|
|
@ -29,6 +29,7 @@ See https://pekko.apache.org for the documentation including the API docs. The d
|
||||||
- `sbt +compile` will compile for all supported versions of Scala
|
- `sbt +compile` will compile for all supported versions of Scala
|
||||||
- `sbt test` will compile the code and run the unit tests
|
- `sbt test` will compile the code and run the unit tests
|
||||||
- `sbt testQuick` similar to test but when repeated in shell mode will only run failing tests
|
- `sbt testQuick` similar to test but when repeated in shell mode will only run failing tests
|
||||||
|
- `sbt testQuickUntilPassed` similar to testQuick but will loop until tests pass.
|
||||||
- `sbt package` will build the jars
|
- `sbt package` will build the jars
|
||||||
- the jars will built into target dirs of the various modules
|
- the jars will built into target dirs of the various modules
|
||||||
- for the the 'actor' module, the jar will be built to `actor/target/scala-2.13/`
|
- for the the 'actor' module, the jar will be built to `actor/target/scala-2.13/`
|
||||||
|
|
|
||||||
|
|
@ -292,6 +292,7 @@ object PekkoBuild {
|
||||||
UsefulTask("", "testOnly *.AnySpec", "Only run a selected test"),
|
UsefulTask("", "testOnly *.AnySpec", "Only run a selected test"),
|
||||||
UsefulTask("", "testQuick *.AnySpec",
|
UsefulTask("", "testQuick *.AnySpec",
|
||||||
"Only run a selected test. When run multiple times will only run previously failing tests (shell mode only)"),
|
"Only run a selected test. When run multiple times will only run previously failing tests (shell mode only)"),
|
||||||
|
UsefulTask("", "testQuickUntilPassed", "Runs all tests in a continuous loop until all tests pass"),
|
||||||
UsefulTask("", "publishLocal", "Publish current snapshot version to local ~/.ivy2 repo"),
|
UsefulTask("", "publishLocal", "Publish current snapshot version to local ~/.ivy2 repo"),
|
||||||
UsefulTask("", "verifyCodeStyle", "Verify code style"),
|
UsefulTask("", "verifyCodeStyle", "Verify code style"),
|
||||||
UsefulTask("", "applyCodeStyle", "Apply code style"),
|
UsefulTask("", "applyCodeStyle", "Apply code style"),
|
||||||
|
|
|
||||||
49
project/TestQuickUntilPassed.scala
Normal file
49
project/TestQuickUntilPassed.scala
Normal file
|
|
@ -0,0 +1,49 @@
|
||||||
|
/*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
|
* this work for additional information regarding copyright ownership.
|
||||||
|
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||||
|
* (the "License"); you may not use this file except in compliance with
|
||||||
|
* the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import sbt._
|
||||||
|
import sbt.Keys._
|
||||||
|
import sbt.plugins.JvmPlugin
|
||||||
|
|
||||||
|
object TestQuickUntilPassed extends AutoPlugin {
|
||||||
|
override def requires = JvmPlugin
|
||||||
|
|
||||||
|
override def trigger = allRequirements
|
||||||
|
|
||||||
|
object autoImport {
|
||||||
|
val testQuickUntilPassed = inputKey[Unit]("runs testQuick continuously until it passes")
|
||||||
|
}
|
||||||
|
|
||||||
|
import autoImport._
|
||||||
|
|
||||||
|
private def testQuickRecursive(input: String): Def.Initialize[Task[Unit]] = Def.taskDyn {
|
||||||
|
(Test / testQuick).toTask(input).result.value match {
|
||||||
|
case Inc(cause) =>
|
||||||
|
testQuickRecursive(input)
|
||||||
|
case Value(value) =>
|
||||||
|
Def.task(())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override lazy val projectSettings = {
|
||||||
|
testQuickUntilPassed := {
|
||||||
|
// TODO Figure out a way to pass input from testQuickUntilPassed into testQuickRecursive
|
||||||
|
testQuickRecursive("").value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue