-
Notifications
You must be signed in to change notification settings - Fork 37
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
Support for Bazel #1261
Comments
The Bazel plugin I use to run Scala is https://github.com/bazelbuild/rules_scala. In case changes are necessary I could try contributing it over there too. |
Moved the conversation to Slack. |
Tried with such a stryker4s.conf:
Unfortunately this fails with a timeout exception. The issue is, that Bazel has to rebuild a significant part of the code if a new workspace is created (this is done when the code is copied), so it times out. For using Bazel we'd need to enable in-place mutation, because then Bazel caches could be reused. StrykerJs already has such an option: |
Another option is to enable overriding the tmpDir in src/main/scala/stryker4s/run/MutantRunner.scala.prepareEnv(), so that we can force the tmpDir to be created in a predefined place, that would enable prebuilding the code with Bazel and be able to use the cache when running mutation tests. |
I've managed to put together a version where Stryker4s can work with Bazel. Sent some PRs as improvements (merged now):
Other details:
Here is the config I used:
|
Adding some follow up from Bazel Slack channel. Instead of passing env_inherit = [
"ACTIVE_MUTATION",
], And Stryker4s still works. |
Link to related rules_scala feature: bazelbuild/rules_scala#1401 |
Thanks for the extensive research and documentation here! I've been wanting to add a FAQ to the Stryker4s docs for a while, and I think this would be a great fit for it when I get around to it :) |
Of course. I would be happy to also contribute to (at least review) any
documentation changes.
I guess I found also some bugs related to our usecase (index out of bounds
exceptions and such), so maybe will also try to research those.
Hugo van Rijswijk ***@***.***> ezt írta (időpont: 2022. dec.
6., K 20:15):
… Thanks for the extensive research and documentation here! I've been
wanting to add a FAQ to the Stryker4s docs for a while, and I think this
would be a great fit for it when I get around to it :)
|
Updated example in #1261 (comment) after latest PR changes. |
Updated example in #1261 (comment) after PRs got merged. |
will be easier after #1522 |
How could I start using Stryker4s with Scala, when using Bazel as a build system?
I see there is already support for sbt and Maven.
What could be the easiest path to add support for Bazel? What steps would be needed? (I could try contributing a solution)
Is there e.g. a way to use Stryker4s from the command line?
Thank you!
Here is an example Scala project with Bazel: https://github.com/gergelyfabian/bazel-scala-example
The text was updated successfully, but these errors were encountered: