mirror of https://github.com/sbt/sbt.git
Try another travis structure + build tweaks
I've tried to put together some scripted tests to remove the overhead of compiling the whole sbt, which is around 3 minutes every time. This new structure *should* make the scripted tests run faster. Aside from this, we do some more tweaks: * Increase memory. * Fork processes to compile and run (to see if it makes a difference). * Pass in the server flag to sbt.
This commit is contained in:
parent
6813eb47af
commit
272afa9d73
25
.travis.yml
25
.travis.yml
|
|
@ -16,29 +16,17 @@ matrix:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
matrix:
|
matrix:
|
||||||
- SBT_CMD=";test:compile;scalafmtCheck"
|
- SBT_CMD=";mimaReportBinaryIssues;test:compile;scalafmtCheck;safeUnitTests;otherUnitTests"
|
||||||
- SBT_CMD="mimaReportBinaryIssues"
|
|
||||||
- SBT_CMD="safeUnitTests"
|
|
||||||
- SBT_CMD="otherUnitTests"
|
|
||||||
- SBT_CMD="scripted actions/*"
|
- SBT_CMD="scripted actions/*"
|
||||||
- SBT_CMD="scripted apiinfo/*"
|
- SBT_CMD="scripted apiinfo/* compiler-project/* ivy-deps-management/*"
|
||||||
- SBT_CMD="scripted compiler-project/*"
|
|
||||||
- SBT_CMD="scripted dependency-management/*1of4"
|
- SBT_CMD="scripted dependency-management/*1of4"
|
||||||
- SBT_CMD="scripted dependency-management/*2of4"
|
- SBT_CMD="scripted dependency-management/*2of4"
|
||||||
- SBT_CMD="scripted dependency-management/*3of4"
|
- SBT_CMD="scripted dependency-management/*3of4"
|
||||||
- SBT_CMD="scripted dependency-management/*4of4"
|
- SBT_CMD="scripted dependency-management/*4of4"
|
||||||
- SBT_CMD="scripted ivy-deps-management/*"
|
- SBT_CMD="scripted java/* package/* reporter/* run/*"
|
||||||
- SBT_CMD="scripted java/*"
|
- SBT_CMD="scripted project/* project-load/*"
|
||||||
- SBT_CMD="scripted package/*"
|
- SBT_CMD="scripted source-dependencies/*"
|
||||||
- SBT_CMD="scripted project/*1of2"
|
|
||||||
- SBT_CMD="scripted project/*2of2"
|
|
||||||
- SBT_CMD="scripted reporter/*"
|
|
||||||
- SBT_CMD="scripted run/*"
|
|
||||||
- SBT_CMD="scripted source-dependencies/*1of3"
|
|
||||||
- SBT_CMD="scripted source-dependencies/*2of3"
|
|
||||||
- SBT_CMD="scripted source-dependencies/*3of3"
|
|
||||||
- SBT_CMD="scripted tests/*"
|
- SBT_CMD="scripted tests/*"
|
||||||
- SBT_CMD="scripted project-load/*"
|
|
||||||
- SBT_CMD="repoOverrideTest:scripted dependency-management/*"
|
- SBT_CMD="repoOverrideTest:scripted dependency-management/*"
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
|
|
@ -46,7 +34,8 @@ notifications:
|
||||||
- sbt-dev-bot@googlegroups.com
|
- sbt-dev-bot@googlegroups.com
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- sbt -J-XX:ReservedCodeCacheSize=128m -J-Xmx1g -J-Xms1g "$SBT_CMD"
|
# It doesn't need that much memory because compile and run are forked
|
||||||
|
- sbt -J-XX:ReservedCodeCacheSize=128m -J-Xmx800M -J-Xms800M -J-server "$SBT_CMD"
|
||||||
|
|
||||||
before_cache:
|
before_cache:
|
||||||
- find $HOME/.ivy2 -name "ivydata-*.properties" -print -delete
|
- find $HOME/.ivy2 -name "ivydata-*.properties" -print -delete
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,9 @@ def commonSettings: Seq[Setting[_]] =
|
||||||
mimaBinaryIssueFilters ++= {
|
mimaBinaryIssueFilters ++= {
|
||||||
import com.typesafe.tools.mima.core._, ProblemFilters._
|
import com.typesafe.tools.mima.core._, ProblemFilters._
|
||||||
Seq()
|
Seq()
|
||||||
}
|
},
|
||||||
|
fork in compile := true,
|
||||||
|
fork in run := true
|
||||||
) flatMap (_.settings)
|
) flatMap (_.settings)
|
||||||
|
|
||||||
def minimalSettings: Seq[Setting[_]] =
|
def minimalSettings: Seq[Setting[_]] =
|
||||||
|
|
@ -352,7 +354,7 @@ def otherRootSettings =
|
||||||
scriptedUnpublished := scriptedUnpublishedTask.evaluated,
|
scriptedUnpublished := scriptedUnpublishedTask.evaluated,
|
||||||
scriptedSource := (sourceDirectory in sbtProj).value / "sbt-test",
|
scriptedSource := (sourceDirectory in sbtProj).value / "sbt-test",
|
||||||
// scriptedPrescripted := { addSbtAlternateResolver _ },
|
// scriptedPrescripted := { addSbtAlternateResolver _ },
|
||||||
scriptedLaunchOpts := List("-Xmx1024M", "-Xms512M"),
|
scriptedLaunchOpts := List("-Xmx1500M", "-Xms512M", "-server"),
|
||||||
publishAll := { val _ = (publishLocal).all(ScopeFilter(inAnyProject)).value },
|
publishAll := { val _ = (publishLocal).all(ScopeFilter(inAnyProject)).value },
|
||||||
publishLocalBinAll := { val _ = (publishLocalBin).all(ScopeFilter(inAnyProject)).value },
|
publishLocalBinAll := { val _ = (publishLocalBin).all(ScopeFilter(inAnyProject)).value },
|
||||||
aggregate in bintrayRelease := false
|
aggregate in bintrayRelease := false
|
||||||
|
|
@ -362,8 +364,9 @@ def otherRootSettings =
|
||||||
()
|
()
|
||||||
},
|
},
|
||||||
scriptedLaunchOpts := {
|
scriptedLaunchOpts := {
|
||||||
List("-Xmx1024M",
|
List("-Xmx1500M",
|
||||||
"-Xms512M",
|
"-Xms512M",
|
||||||
|
"-server",
|
||||||
"-Dsbt.override.build.repos=true",
|
"-Dsbt.override.build.repos=true",
|
||||||
s"""-Dsbt.repository.config=${scriptedSource.value / "repo.config"}""")
|
s"""-Dsbt.repository.config=${scriptedSource.value / "repo.config"}""")
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,7 @@ final class ScriptedTests(resourceBaseDirectory: File,
|
||||||
*
|
*
|
||||||
* It sets the name of the local root project for those tests run in batch mode.
|
* It sets the name of the local root project for those tests run in batch mode.
|
||||||
*
|
*
|
||||||
* This is necessary because the current design to run tests in batch mode force
|
* This is necessary because the current design to run tests in batch mode forces
|
||||||
* scripted tests to share one common sbt dir instead of each one having its own.
|
* scripted tests to share one common sbt dir instead of each one having its own.
|
||||||
*
|
*
|
||||||
* Sbt extracts the local root project name from the directory name. So those
|
* Sbt extracts the local root project name from the directory name. So those
|
||||||
|
|
@ -184,14 +184,22 @@ final class ScriptedTests(resourceBaseDirectory: File,
|
||||||
// Reload and initialize (to reload contents of .sbtrc files)
|
// Reload and initialize (to reload contents of .sbtrc files)
|
||||||
val pluginImplementation = createAutoPlugin(name)
|
val pluginImplementation = createAutoPlugin(name)
|
||||||
IO.write(tempTestDir / "project" / "InstrumentScripted.scala", pluginImplementation)
|
IO.write(tempTestDir / "project" / "InstrumentScripted.scala", pluginImplementation)
|
||||||
val sbtHandler = handlers.getOrElse('>', sys.error("Missing sbt handler."))
|
val sbtHandlerError = "Missing sbt handler. Scripted is misconfigured."
|
||||||
|
val sbtHandler = handlers.getOrElse('>', sbtHandlerError).asInstanceOf[SbtHandler]
|
||||||
val commandsToRun = ";reload;setUpScripted"
|
val commandsToRun = ";reload;setUpScripted"
|
||||||
val statement = Statement(commandsToRun, Nil, successExpected = true, line = -1)
|
val statement = Statement(commandsToRun, Nil, successExpected = true, line = -1)
|
||||||
|
|
||||||
// Run reload inside the hook to reuse error handling for pending tests
|
// Run reload inside the hook to reuse error handling for pending tests
|
||||||
val wrapHook = (file: File) => {
|
val wrapHook = (file: File) => {
|
||||||
preHook(file)
|
preHook(file)
|
||||||
runner.processStatement(sbtHandler.asInstanceOf[SbtHandler], statement, states)
|
try runner.processStatement(sbtHandler, statement, states)
|
||||||
|
catch {
|
||||||
|
case t: Throwable =>
|
||||||
|
val newMsg = "Reload for scripted batch execution failed."
|
||||||
|
throw new TestException(statement, newMsg, t)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
commonRunTest(label, tempTestDir, wrapHook, handlers, runner, states, buffer)
|
commonRunTest(label, tempTestDir, wrapHook, handlers, runner, states, buffer)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue