mirror of
https://github.com/sbt/sbt.git
synced 2026-08-29 17:38:02 +02:00
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:
@@ -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.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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)
|
||||
val pluginImplementation = createAutoPlugin(name)
|
||||
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 statement = Statement(commandsToRun, Nil, successExpected = true, line = -1)
|
||||
|
||||
// Run reload inside the hook to reuse error handling for pending tests
|
||||
val wrapHook = (file: 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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user