Add general mechanism for excluding tests

This commit is contained in:
Peter Vlugter 2011-03-31 11:36:49 +13:00
parent 511263c838
commit 804812b635
2 changed files with 15 additions and 24 deletions

View file

@ -465,8 +465,6 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) {
}
def akkaArtifacts = descendents(info.projectPath / "dist", "*-" + version + ".jar")
lazy val integrationTestsEnabled = systemOptional[Boolean]("integration.tests",false)
lazy val stressTestsEnabled = systemOptional[Boolean]("stress.tests",false)
// ------------------------------------------------------------
class AkkaDefaultProject(info: ProjectInfo, val deployPath: Path) extends DefaultProject(info)
@ -485,21 +483,15 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) {
override def packageToPublishActions = super.packageToPublishActions ++ Seq(this.packageDocs, this.packageSrc)
override def pomPostProcess(node: scala.xml.Node): scala.xml.Node = mcPom(AkkaParentProject.this.moduleConfigurations)(super.pomPostProcess(node))
/**
* Used for testOptions, possibility to enable the running of integration and or stresstests
*
* To enable set true and disable set false
* set integration.tests true
* set stress.tests true
*/
def createTestFilter(defaultTests: (String) => Boolean) = { TestFilter({
case s: String if defaultTests(s) => true
case s: String if integrationTestsEnabled.value => s.endsWith("TestIntegration")
case s: String if stressTestsEnabled.value => s.endsWith("TestStress")
case _ => false
}) :: Nil
lazy val excludeTestsProperty = systemOptional[String]("akka.test.exclude", "")
def excludeTests = {
val exclude = excludeTestsProperty.value
if (exclude.isEmpty) Seq.empty else exclude.split(",").toSeq
}
override def testOptions = super.testOptions ++ excludeTests.map(exclude => TestFilter(test => !test.contains(exclude)))
lazy val publishRelease = {
val releaseConfiguration = new DefaultPublishConfiguration(localReleaseRepository, "release", false)
publishTask(publishIvyModule, releaseConfiguration) dependsOn (deliver, publishLocal, makePom)