bazel-contrib / bazel-contrib/rules_scala

scala_junit_test should use java_test

Open
#236 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Starlark
Stars
384
Forks
292
Avg merge
2d 22h
Merged PRs (30d)
47

Description

I want to refactor `scala_junit_test` to be a macro that calls `scala_library` and `java_test`.
That will enable us to tap into many features `java_test` has and we've either duplicated or are just missing.
The big motivation for me is `java_test`s support for $location expansion in runtime location so to support remote execution.

Once this is in I'll probably follow up with extracting the current test suite to a separate repo since:
1. Many people on the bazel jvm landscape are asking for it and they don't need scala.
2. This isn't scala related but more `auto_test_discovery` related so a separation of concerns would be better.

Cons:
With respect to the main change- we'll be more coupled to `java_test` and changes there are more complicated to perform.
With respect to extracting the suite- we can either break compatibility and have the default behavior a bit more dumbed down (like java_test) or we can depend on the new external repo (which will probably be under Wix org) to get the same functionality.

@johnynek would love your input on both of these even though you're not a specs2/junit user :)

Contributor guide

Open the contributing guide

Research direction

Start by locating the scala_junit_test and java_test rule entry points, then compare how scala_library, runtime location, and $location expansion are handled. Review the existing test suite and the stated compatibility trade-offs; done means scala_junit_test delegates through the proposed macro while retaining the required test behavior and remote-execution support.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
build-system, testing
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.