-
Notifications
You must be signed in to change notification settings - Fork 202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for running Scala.js tests #706
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- TestSuiteEvent: Remove `logger.trace()` as exceptions and their traces are already printed by the test runner - Tasks: Only link projects and look up tests if test frameworks are defined - ScalaJsToolchain: Make main class optional since test projects do not necessarily have a main class - ScalaJsToolchain: Add function to retrieve test frameworks - DiscoveredTests: Rename to `DiscoveredTestFrameworks` and make it platform-agnostic
- Add missing module initialiser `org.scalajs.testinterface.Bridge.start()` - Port `JSDOMNodeJSEnv` from upstream Scala.js
1. Fixes the test infrastructure to avoid the previous messy API that required to both match on the platform and then the toolchain. 2. Modularize `Tasks` into independent classes that are only meant to be used for testing/linking. Also modularize more the code. 3. Make the change in the bloop configuration not breaking, so that we can release this change in a minor version of Bloop.
jvican
force-pushed
the
topic/scalajs-testing
branch
from
November 8, 2018 16:30
17de67f
to
823978f
Compare
Things that need to be done in the test infrastructure before a stable release (non-blocking, for now):
|
jvican
force-pushed
the
topic/scalajs-testing
branch
8 times, most recently
from
November 9, 2018 13:44
f5da9cb
to
ddf0c73
Compare
1. Adds tests for the whole Scala.js test infrastructure. 2. Implements test cancellation reliably for both Scala.js 0.6.x and 1.x. 3. Refines the Scala.js infrastructure and reorganizes the structure of the code to keep the test infrastructure readable. It also renames some of the test suites to be consistent with the logic in `frontend`. 4. Sets the right module initializers and skips settings the main initializer if the project is going to be tested. A module initializer is always run. 5. Introduces unit test projects in test resources. The unit test projects exist so that in the future we can run tests without requiring `integrationSetUpBloop` to set up the whole community build. It's left for future work adapting the test suite to do this. * The configuration files of the projects are generated per machine. If the files are up-to-date, the generation is skipped. * The generation occurs the first time the user starts the build, to ensure that whenever we do `bloopInstall` the whole project can be tested via bloop too. Other nice improvements: 1. Remove `SourceMap` and reuse the one from Scala.js in the bridge 1.0. 2. Pretty prints exceptions coming from failed tests (and hidden behind Scala.JS specific or invocation target exceptions).
jvican
force-pushed
the
topic/scalajs-testing
branch
2 times, most recently
from
November 11, 2018 20:11
85f75ca
to
94a4334
Compare
Scala.js 1.x's `ComRun` doesn't invoke `close` on the underlying run when its `close()` method is called. This means that the process is effectively not killed and a resource leak happens. This leak can happen fatal consequences in Windows because an open reference to the JS output file is open and, therefore, other processes cannot write to it and fail. To fix this issue, we've had to copy the contents of `BloopComRun`, `JsDomNodeJsEnv` and `NodeJsEnv`. These environments use nuprocess to spawn the JS test servers. When Scala.js fixes the aforementioned issue upstream, we can remove all of this logic and keep the js bridge 1.x logic as simple as that of 0.6.x. The use of Scala sys.process doesn't bother us because cancellation still works successfully.
jvican
force-pushed
the
topic/scalajs-testing
branch
from
November 11, 2018 20:53
94a4334
to
fc07e87
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There's a new big commit stabilizing the test infrastructure and
modifying key things in Bloop to get test support for Scala.js working
reliably.
Follow-up of #572