Commit Graph

10242 Commits

Author SHA1 Message Date
jvican f4c38c8355 Test `getScalaInstance` & `getCompiledBridge`
* Remove unused code in `BridgeProviderSpecification` and test the real
  code in the default provider.
* Don't use temporary directory to download the Scala jars, retrive them
  in a directory specified by the user.
* Use `java.net.ClassLoader` instead of `ScalaClassLoader`.
* Use the `ScalaInstance` interface, not the implementation. Remove any
  reference to the implementation.
2017-05-21 20:21:57 +02:00
jvican ae40c096e3 Remove custom `getScalaInstance` and use default 2017-05-21 20:21:57 +02:00
jvican 62a5037d23 Add `getScalaInstance` to `CompilerBridgeProvider` 2017-05-21 20:21:57 +02:00
jvican d48f65a8a7 Fix oversight in InvalidComponent message 2017-05-21 20:21:57 +02:00
jvican 8d9d007d3c Rename `getCompilerSources` to `getCompiledBridge`
Previous name was incorrect, we actually return the compiled bridge.
2017-05-21 20:21:57 +02:00
jvican e756f07aed Add headers to files that don't have them 2017-05-21 20:21:56 +02:00
jvican 3f1cce379f Add `CompilerBridgeProvider` interface and misc.
* Add interface for the provider.
* Rename `IvyComponentCompiler` to `ZincComponentCompiler`.
* Split `ZincComponentCompiler` and `ZincComponentManager`.
* Define `IfMissing` and `InvalidComponent` into independent files.
* Rename variables and internal API to be clearer.
2017-05-21 20:21:56 +02:00
Dale Wijnand 5e585e50da Merge pull request #3200 from eed3si9n/wip/testlog2
Fixes content log not showing up on test task
2017-05-19 07:55:24 +01:00
Eugene Yokota 2b5637270a update TestFramework
- update reset.sh for debugging
- use Vector around TestFramework
- unbind existing appdenders from newLog
- register string codec for TestStringEvent
2017-05-19 00:16:19 -04:00
Eugene Yokota b013c30c30 Fix content log not showing up on `test`
Fixes #3198

Bump util to 1.0.0-M24. This fixes content log not showing up on `test`
2017-05-19 00:15:19 -04:00
Dale Wijnand 471ee7fdc4 Merge pull request #80 from eed3si9n/wip/logging2
Fixes buffered log appender
2017-05-18 06:48:55 +01:00
Eugene Yokota f2cc5ee775 convert log4j async LogEvent to an immutable one
This fixes the buffered log not showing up for tests.

Ref sbt/sbt#3198
2017-05-18 00:36:24 -04:00
Eugene Yokota feeb6291cd Add toString for ObjectEvent 2017-05-18 00:34:41 -04:00
Eugene Yokota 122c738913 bump version 2017-05-17 00:18:24 -04:00
eugene yokota b5cc77ef75 Merge pull request #3193 from dwijnand/better-toError-migration-notes
Better toError migration notes [ci skip]
2017-05-16 16:42:54 -04:00
Dale Wijnand 859b334a51
Better toError migration notes [ci skip] 2017-05-16 10:21:14 +01: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 50cc045a70 Merge pull request #3189 from eed3si9n/wip/more-case-class
[sbt 1.0] migrate ForkOptions to Contraband
2017-05-12 11:12:48 +01:00
Eugene Yokota 3724277704 migrate ForkOptions to Contraband 2017-05-12 05:22:08 -04:00
Dale Wijnand 0b2081bc3c Merge pull request #3184 from dwijnand/sbt-1-on-1
Upgrade the build to use sbt 1.0.0-M5
2017-05-11 10:31:21 +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
eugene yokota b1a1d03009 Merge pull request #3180 from eed3si9n/wip/zero2
[sbt 1.0] Rename scope component Global to Zero (`in Global` stays the same)
2017-05-10 16:48:40 -04:00
eugene yokota a265600154 Merge pull request #3151 from scalacenter/parallel-scripted-tests
Add parallel batch mode to scripted tests
2017-05-10 16:46:01 -04:00
jvican f967f6c1d7
Split project and aggregate project-load 2017-05-10 21:40:23 +02: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 6813eb47af
Up memory for every scripted instance 2017-05-10 21:40:23 +02:00
jvican 3d6e0f9327
Handle empty case in `labelsAndDirs` 2017-05-10 21:40:22 +02:00
jvican 5e44ec7c53
Fix string-to-command to ignore existing commands
The scripted batch executor injects a command and the operation
performed in this test checks all the commands, assuming only `noop` is
declared.
2017-05-10 21:40:22 +02:00
jvican e01f5f5ef1
Fix auto-plugins temporarily until #3163 is fixed
Unfortunately, I think this uncovers a bug in duplicated computation of
settings in the `ThisBuild` and `Global` axis.
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 80c8883219
Reboot to ditch state produced by scripted reload 2017-05-10 21:40:22 +02:00
jvican 628517e60c
Try travis with 3 cores and 725M per instance 2017-05-10 21:40:21 +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 9b3a2e6f0f
Fix project/binary-plugin: Reload was implied
The first `>` that appears kickstarts the execution of sbt, so it
implies a reload. This is no longer true for the batch test execution.
2017-05-10 21:40:21 +02:00
jvican 8aee628297
Fix #3610: project/old-ops
`compile` does nothing in this test, what we need to do is `reload`.
2017-05-10 21:40:21 +02:00
jvican 0ebf2d14a3
Fix more tests using compiler iterations 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 5a23fa0e9a
Fix #3160: Newline after comment line 2017-05-10 21:40:03 +02:00
jvican dc048926c7
Fix fancy uses of analysis
Clean up first analysis to make sure that test utilities using
information from analysis have correct information that does not collide
with the compilation analysis of the previous runs (batch tests).
2017-05-10 21:40:03 +02:00
jvican 927910aa72
Fix compile tests using `checkIterations`
Those tests using `checkIterations` were not working because an
invariant was working: the first iterations number is 0. As we reuse
sbt for running several tests, this is no longer true, so this commit
makes sure that they are updated with the pertinent infrastructure to
compute the performed iterations from the latest known number of
iterations.
2017-05-10 21:40:02 +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 70cf417525
Fix #3161: Don't fail if group is not present
This covers the case described in #1361 plus an esoteric case too.
Parsers are initialized when sbt starts and text completions use the
knowledge at that time. If we happen to move a new file that should
influence the behaviour of the tab completion, that file will not be
picked up. Before, since we were throwing an error, the previous case
that would no produce any tab completion would also fail, though the
files are legitimately in the correct place.
2017-05-10 21:40:02 +02:00
jvican e69436adde
Remove `MaxPermSize` since sbt depends on JDK8
FTR:

```
[error] OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=256M; support was removed in 8.0
```
2017-05-10 21:40:01 +02:00
jvican c6610b9395
Fix #3160: Don't use val extractor in build
See comment in https://github.com/sbt/sbt/issues/3160.
2017-05-10 21:40:01 +02:00
jvican 9d8f18a4a4
Fix #3160: Disable sha-conflict
This test was always failing but was marked as passed by the previous
scripted framework because the test files were only checking the failure
of tests.

The test case depends on bintray, which could never have been resolved
for sbt 1.0.0-SNAPSHOT. This resolution error was the one "hidden".
2017-05-10 21:40:01 +02:00
jvican 293ae706f5
Fix #3160: Make actions/task-cancel compile 2017-05-10 21:40:01 +02:00
jvican 9d260f68c7
Use `ConsoleReporter` if no reporter is found
This change is necessary in the cases where we have global
initialization issues that have no position, like:

```
[info] [error] scala.reflect.internal.MissingRequirementError: object scala in compiler mirror not found.
```

Before, it was failing with a `sys.error` exception. Now we will report
these issues with a console reporter that is not meant to be
thread-safe.
2017-05-10 21:40:01 +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