Commit Graph

19 Commits

Author SHA1 Message Date
Eugene Yokota 9d3b626567 Fix ScalaTest issue with ScalaLibrary classloader
Ref #4689
Ref #4671
2019-05-17 14:24:55 -04:00
Ethan Atkins 4b915ff69e Run more scripted tests on windows
Given that there are io differences between windows and posix systems,
we should aim to run the tests that do a lot of io on windows. There are
a few tests that don't work because of some platform specific issues so
I added a filter that excludes these tests on windows in ScriptedTests.
2019-05-11 22:01:49 -07:00
Ethan Atkins 924c6857d1 Add package/mappings to launcher base scripted tests
I don't understand why this wasn't failing before.
2019-05-02 14:36:08 -07:00
Eugene Yokota 24db77edc5 copy some tests from coursier/sbt-coursier
Copying over sbt-coursier integration tests that do not depend on Coursier-specific things, but excercises sbt integration.
2019-04-26 12:27:38 -04:00
Eugene Yokota 464325ad1d add a simpler version of snapshot-resolution
Ivy is able to check for SNAPSHOT across different resolvers.
Coursier seems to be sticky about the resolver within the TTL (24h).
2019-04-26 12:27:38 -04:00
Eugene Yokota 1e157b991a apply formatting 2019-04-20 03:23:54 -04:00
Dale Wijnand 6fe8df21bb
Merge branch '1.2.x' into merge-in-1.2.x
* 1.2.x: (28 commits)
  More bumping up the 2.12 version to 2.12.8 in 1.2.x
  Bump the 2.12 version to 2.12.8 in 1.2.x
  define whitesourceOnPush
  lm 1.2.4
  1.2.7-SNAPSHOT
  implement TestConsoleLogger
  bump util, lm, and zinc
  Bump scalatest to 3.0.6-SNAP5
  Bump log4j2 to 2.11.1
  drop notification override
  Ignore files in scripted group dirs
  Fix '~' for dependent projects with a broken parent
  util 1.2.3, zinc 1.2.4
  lm 1.2.2
  Adjust the tests
  Set withMetadataDirectory by default
  Fix single repo emulation script
  add onLoadMessage
  check PluginCross.scala consisntency
  Bump modules
  ...
2019-04-18 09:03:16 +01:00
Ethan Atkins fc715cab44 Don't leak the sbt boot scala library into tests
It was reported in https://github.com/sbt/sbt/issues/4608 that there was
a regression that tests run against scala 2.11 would fail. This was
because the interface loader incorrectly contained the scala library. To
fix this, I needed to find the xsbt.boot.BootFilteredLoader in the
classloading hierarchy and put the sbt testing interface library in
between that loader and the scala library loader.
2019-04-07 15:08:52 -07:00
Ethan Atkins 8ef5a67b64 Add better error message if run fails
It is possible with the new layering strategies that tests may fail if a
java package private class is accessed across classloader layers. This
will result in an IllegalAccessError that is hard to debug. With this
commit, I add an error message that will be displayed if run throws an
IllegalAccessError that suggests that the user try the
ScalaInstance layering strategy or the flat layering strategy.
2019-04-02 20:53:37 -07:00
Ethan Atkins 7b8ed4d13f Allow sbt scripted tests to run in parallel
I'm not sure if this is a huge benefit or not, but it's nice to have the
option to run the scripted tests in parallel. The default behavior
should be the same as before.
2019-01-31 17:43:14 -08:00
Ethan Atkins 0a4fbc9f5a Set classLoaderLayeringStrategy in relevant configs
Previously, the ClassLoaderLayeringStrategy was set globally. This
didn't really make sense because the Runtime and Test configs had
different strategies available (Test being a superset of Runtime).
Instead, we now set the layering strategy in the Runtime and Test
configurations directly. In doing this, we can eliminate the Default
ClassLoaderLayeringStrategy. Previously this had existed so that we
could set the layering strategy globally and have it do the right thing
in both test and runtime.

To implement this, I factored out the logic for generating the layered
classloader in the test task and shared it with the runtime task. I did
this because I realized that Test / run is a thing. Previously I had
been operating under the assumption that the runner would never include
the test dependencies. Once I realized this, it made sense to combine
the logic in both tasks.

As a bonus, I only allow the layering strategies that explicitly make
sense to be set in each configuration. If the user sets an invalid
strategy, an error will be thrown that specifies the valid strategies
for the task.

I also added ScalaInstance as an option for the runtime layer. It was an
oversight that this was left out.
2019-01-30 08:55:22 -08:00
Ethan Atkins aca541898d Add scripted tests for classloader-cache
Normally I'd include these with the previous commit, but the diff is so
large that I put them in their own commit. The tests handle 5 scenarios:

1) akka-actor-system -- a project that has Akka as a dependency and a
   simple main method that creates and terminates an ActorSystem. What
   is interesting about this test is that if scriptedBufferLog := false,
   we notice that the first call to run is slow, but subsequent calls to
   run and test are fast. The test does at least ensure that recycling
   the runtime layer in test works ok.

2) jni -- verifies that a project with native libraries will be able to
   load the library with each run. It actually swaps out the underlying
   library so that the it really ensures that the library is reloaded
   between runs.

3) library-mismatch -- verifies that the layered classloaders can work
   when the test dependencies are incompatible with the runtime
   dependencies. In this test, the test dependencies use an api in a
   library called foo-lib that isn't available in the version used by
   the runtime dependencies. Because of this incompatibility, the test
   will not work if Test / layeringStrategy := LayeringStrategy.Full.

4) scalatest -- verifies that a test runs using the scalatest framework
5) utest -- verifies that a test runs using the utest framework

The reason for (4) and (5) is to ensure that both the in sourced test
frameworks and external frameworks work with the new loaders.
2019-01-30 08:55:22 -08:00
Eugene Yokota 76f0e2de6b implement TestConsoleLogger
This avoids the mixup of log4j versions.
2018-11-30 13:06:29 -05:00
Dale Wijnand 248b8b93d1 Ignore files in scripted group dirs
Scripted tests, in src/sbt-test/<group>/<name> blow up if <name> is a
plain file.  Filter them out.
2018-11-27 18:17:38 -05:00
Dale Wijnand 5f562aa7a8
Ignore files in scripted group dirs
Scripted tests, in src/sbt-test/<group>/<name> blow up if <name> is a
plain file.  Filter them out.
2018-11-22 15:48:56 +00:00
Ethan Atkins 51be0856a1 Fix deprecation warning in scripted tests 2018-10-08 13:59:40 -07:00
Eugene Yokota 4ff4f6e45e Update header 2018-09-14 04:53:36 -04:00
Eugene Yokota b3342118f8 Add dependencyOverrides for scripted-plugin
Fixes #4249

This introduces an override rule into the metabuild so scripted-plugin will align with the sbt version.
2018-07-10 03:13:47 -04:00
Eugene Yokota d7dc4b3e29 create scripted-sbt-redux
Fixes #4241
Fixes #4242

This introduces a new subproject named scripted-sbt-redux. The purpose of this new subproject is to workaround the 'sbt.test` package vs `Keys.test` key confusion (#4242) while maintaining the forward compatibility of 0.13.17's sbt cross testing ^^ (#4241).

The new subproject uses `sbt.scriptedtest` package name, and that's the one that will be used by the mothership.

Meanwhile "scripted-sbt" subproject will also be published for compatibility purpose.
2018-07-10 03:13:47 -04:00