Commit Graph

55 Commits

Author SHA1 Message Date
jvican d33985d219
Fix #3245: Add deprecated scripted `run` back 2017-06-14 00:10:44 +02:00
eugene yokota d3ff3fb63a migrate PluginTrigger and ProjectOrigin to Contraband (#3191)
and move TestFramework to a non case class.
2017-05-13 13:01:51 +01:00
Dale Wijnand 0b33c195ef
Upgrade the build to sbt 1.0.0-M5
Some plugins remain commented out, for now.

sbt-doge is no longer needed because a variant of it has been folded
into sbt 1.

For some reason scripted requires src/doc jars of sbt, so switch back to
using `publishAll` rather than `publishLocalBinAll`. :(

Also, the sys.prop change in scripted is to force log4j2 to not use a
thread context classloader, and avoid the following:

    ERROR StatusLogger Unable to create custom ContextSelector. Falling back to default.
     java.lang.ClassCastException: Cannot cast org.apache.logging.log4j.core.async.AsyncLoggerContextSelector to org.apache.logging.log4j.core.selector.ContextSelector
    	at java.lang.Class.cast(Class.java:3369)
    	at org.apache.logging.log4j.util.LoaderUtil.newCheckedInstanceOf(LoaderUtil.java:201)
    	at org.apache.logging.log4j.util.LoaderUtil.newCheckedInstanceOfProperty(LoaderUtil.java:226)
    	at org.apache.logging.log4j.core.impl.Log4jContextFactory.createContextSelector(Log4jContextFactory.java:97)
    	at org.apache.logging.log4j.core.impl.Log4jContextFactory.<init>(Log4jContextFactory.java:58)
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    	at java.lang.Class.newInstance(Class.java:442)
    	at org.apache.logging.log4j.LogManager.<clinit>(LogManager.java:94)
    	at org.apache.logging.log4j.spi.ThreadContextMapFactory.createThreadContextMap(ThreadContextMapFactory.java:73)
    	at org.apache.logging.log4j.ThreadContext.init(ThreadContext.java:223)
    	at org.apache.logging.log4j.ThreadContext.<clinit>(ThreadContext.java:202)
    	at org.apache.logging.log4j.core.impl.ContextDataInjectorFactory.createDefaultInjector(ContextDataInjectorFactory.java:83)
    	at org.apache.logging.log4j.core.impl.ContextDataInjectorFactory.createInjector(ContextDataInjectorFactory.java:67)
    	at org.apache.logging.log4j.core.lookup.ContextMapLookup.<init>(ContextMapLookup.java:34)
    	at org.apache.logging.log4j.core.lookup.Interpolator.<init>(Interpolator.java:117)
    	at org.apache.logging.log4j.core.config.AbstractConfiguration.<init>(AbstractConfiguration.java:125)
    	at org.apache.logging.log4j.core.config.DefaultConfiguration.<init>(DefaultConfiguration.java:46)
    	at org.apache.logging.log4j.core.layout.PatternLayout$Builder.build(PatternLayout.java:650)
    	at org.apache.logging.log4j.core.layout.PatternLayout.createDefaultLayout(PatternLayout.java:487)
    	at sbt.internal.util.ConsoleAppender.<init>(ConsoleAppender.scala:245)
    	at sbt.internal.util.ConsoleAppender$.apply(ConsoleAppender.scala:196)
    	at sbt.internal.util.ConsoleLogger.<init>(ConsoleAppender.scala:42)
    	at sbt.internal.util.ConsoleLogger$.apply(ConsoleAppender.scala:34)
    	at sbt.test.ScriptedRunner.run(ScriptedTests.scala:221)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:498)
    	at Scripted$.doScripted(Scripted.scala:125)
    	at $0483e89d182e9d240274$.$anonfun$scriptedTask$5(build.sbt:301)
2017-05-11 09:44:42 +01:00
jvican 272afa9d73
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.
2017-05-10 21:40:23 +02:00
jvican 3d6e0f9327
Handle empty case in `labelsAndDirs` 2017-05-10 21:40:22 +02:00
jvican 388ed641fb
Create a compiler plugin for scripted
The compiler plugin is more appropriate than running a series of
commands because of the effects of `set`.
2017-05-10 21:40:22 +02:00
jvican 7519e63f50
Set name of root project if no name is known
This commit makes sure that between every run in batch mode the local
root project name is updated if no name is set.

This fixes project/generated-root-no-project that was assuming that the
root directory name was `generated-root-no-project`. This invariant does
not hold anymore with the batch-mode. Now one sbt dir is shared for lots
of scripted tests.
2017-05-10 21:40:21 +02:00
jvican 6191f35f1c
Fix java options for scripted
* Remove MaxPermSize from another scripted opts
* Reduce memory of sbt host to 1g instead of 2g
* Add Xms java options to scripted
* Enable parallelism with 512M for sbt tests
* Parallelism + batch mode
2017-05-10 21:40:03 +02:00
jvican c94a445737
Use scripted hook to run reload
This saves us from duplicating error handling logic to correctly manage
`pending` tests whose projects don't even load (and make our reload)
fail.
2017-05-10 21:40:02 +02:00
jvican 210dcde822
Run pre hook only after checking disabled tests 2017-05-10 21:40:02 +02:00
jvican 0ee3585b6d
Add batch mode execution to scripted
For that, we:

* Change the existing infrastructure to recycle as much code as
  possible.
* Use `BatchScriptRunner` since `ScriptRunner` is too restrictive to
  programmatically control the underlying sbt servers.
* Unify `TestRunner` to the more general way for both batch and
  non-batch modes.
2017-05-10 21:40:02 +02:00
jvican 5ca2e3c87e
Reduce memory of scripted tests + extra
* Remove oversight in error message
* Up the memory limit per scripted instance
2017-05-10 21:39:45 +02:00
jvican b923f12cc8
Deduplicate `scriptedTest` and remove exceptions
The following commit minimises the amount of exceptions that leak
through our internal signatures. It thus changes the return type
signature of `scriptedTest` to return an `Option` instead of `Unit`.

At the call-site of `scriptedTest`, we also remove the code to handle
the exceptions thrown by it.
2017-05-10 21:32:36 +02:00
jvican e80ec0a670
Abstract over `runAll` and `runInParallel`
This is the best we can do without using structural types.
2017-05-10 21:32:36 +02:00
jvican f497e15cd8
Run scripted tests in parallel
Add binary-compatible methods to run scripted tests in parallel using
parallel collections. Parallel collections are not tuned and a default
of 4 cores is used for the `ForkJoinPool`. This can be a matter of
experimentation in the future but for now I prefer to stay with it.

The non-parallel methods are not affected by this change.

The changes to the scripted plugin have not been used, only the sbt
scripted plugin is using `runInParallel`. In the future, this change can
also happen so that plugin authors can benefit from parallel sbt
testing. This is not a priority for me now :)
2017-05-10 21:32:36 +02:00
jvican 23762a3ac5
Delete scripted deprecations & CompatibilityLevel
We don't have to care about migrations in these removals because no one
should be depending on these methods directly. People consume scripted
via the sbt plugin.

This commit also removes the unused `CompatibilityLevel` which is
completely outdated, making reference to Scala 2.9 et al.
2017-05-10 21:32:31 +02:00
Eugene Yokota da046791e0 Apply Scalafmt formatting 2017-04-21 04:48:31 -04:00
Dale Wijnand be3fa7e66d
Just whitespace & comment changes 2017-04-11 11:48:24 +01:00
Dale Wijnand 84c611af36 Remove unused vals/defs 2016-07-12 14:31:35 +01:00
Dale Wijnand deea82542c Remove unused imports 2016-07-12 11:55:10 +01:00
Dale Wijnand 32760bed55 Remove some fatal exception catching 2016-07-07 18:21:25 +01:00
Dale Wijnand 222a970080 Kill some vars 2016-07-07 01:39:52 +01:00
Dale Wijnand d949a74925 Cleanup scriptedSbtProj 2016-06-21 13:15:10 +01:00
Eugene Yokota fd7c162ea8 Bumping up dependencies 2016-05-05 14:38:24 -04:00
Martin Duhem 8ef2bb2180 Address Codacy's complaints 2016-02-23 15:54:31 +01:00
Martin Duhem 9bc50e558e Use scripted engine from sbt/util 2016-01-26 14:51:14 +01:00
Martin Duhem c981abd295 Fix all imports 2015-09-14 14:28:09 +02:00
Martin Duhem bce77a1ecc Continue to run tests after passing pending test 2015-08-19 08:26:21 +02:00
Martin Duhem 1b2750be7a Mark passing pending scripted tests as failures 2015-08-18 15:38:36 +02:00
Pierre DAL-PRA 54d54b9f4f Replace procedure syntax by explicit Unit annotation 2015-08-04 10:07:38 +02:00
Eugene Yokota 6fc13d0308 Try to keep bincompat 2015-06-19 23:05:01 -04:00
Eugene Yokota 618ac5236a Bumping up Scala version to 2.10.5/2.11.6. Fixes #1980
To pass File => Unit callback across the classloader boundary
I am encoding it as a java.util.List[File] by overriding
 method.
This was needed since Java didn't allow me to cast
from one classloader to the other.
2015-06-19 16:51:39 -04:00
eugene yokota be78b7fc4c Merge pull request #1759 from jedesah/topic/minor_cleanup
Minor code cleanup
2015-01-14 16:13:06 -05:00
Eugene Yokota 75e7b47718 Run scripted with sbt-maven-resolver 2015-01-12 22:01:16 -05:00
Jean-Rémi Desjardins ca736e55d3 Minor code cleanup 2014-12-03 09:56:34 -08:00
Eugene Yokota adb41611cf added scalariform 2014-05-01 12:50:07 -04:00
Mark Harrah 6755f2595b Recover from failed 'reload' command in the scripted sbt handler. 2013-09-18 10:27:19 -04:00
Mark Harrah 644a2c9d13 scripted support for disabled tests 2013-06-28 00:01:19 -04:00
Mark Harrah fd713e0c96 Update reflection signature for scripted plugin, add test for the plugin. 2013-05-25 14:22:35 -04:00
Mark Harrah f6d73128fc deprecations 2013-02-25 09:24:04 -05:00
Mark Harrah 076480b50a Reduce InputTask to the ideal wrapper around 'State => Parser[Initialize[Task[T]]]'
Ref #407.
2013-01-28 17:14:53 -05:00
Mark Harrah 1f110c26e1 Run all scripted tests provided on the command line even if one group fails
Previously, all tests selected by a command line argument would be run,
but if a test failed, the tests for the next argument would not be run.
2013-01-24 13:00:41 -05:00
Grzegorz Kossakowski ae211ee33e Cleanup parameter list of `ScriptedTests`.
All of `sbtVersion`, `defScalaVersion` and `buildScalaVersions` were
not used anymore. According to @harrah they are coming from really
old days of sbt and are not needed because of changes to how sbt
interacts with different Scala versions.
2012-12-14 12:57:47 -05:00
Grzegorz Kossakowski ef39aeb9c1 Follow source layout convention supported by Eclipse.
Moved source files so directory structure follow package
structure. That makes it possible to use Scala Eclipse plugin
with sbt's source code.
2012-12-07 10:27:08 -08:00
Mark Harrah 4816991b18 basic support for pending scripted tests 2012-05-19 18:20:20 -04:00
Mark Harrah 30cca3a6d0 fix launcher options addition to use array for cross-version compatibility 2012-01-22 22:06:53 -05:00
mmcbride 28674af0d2 add setting to pass command line opts to scripted launcher 2012-01-20 17:44:06 -05:00
Indrajit Raychaudhuri bb75b74eb6 Remove some deprecations and redundant code 2011-08-05 13:30:04 +05:30
Mark Harrah 960d0bc2e3 clean up scripted error handling 2011-07-23 23:07:54 -04:00
Mark Harrah 54b6d5db30 drop extra, potentially problematic loadp in scripted handler 2011-07-15 15:48:36 -04:00