Skip to content
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

ScalaTest deps to toolchain #1110

Merged
merged 5 commits into from
Oct 2, 2020
Merged

Conversation

liucijus
Copy link
Collaborator

ScalaTest deps on toolchain, part of #940

@@ -38,8 +38,51 @@ declare_deps_provider(
`junit_classpath_provider` (deps_id `junit_classpath`) is where classpath required for junit tests
is defined.

Toolchain must be registerd in your `WORKSPACE` file:
ScalaTest support can be enabled by configuring a provider with an id `scalatest_classpath`:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unrelated to this change but this doc seems to suggest that in order to use scalatest I need to configure it. Why doesn't it show the easy defaults way?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I understood your comment, there are no defaults when setting up custom toolchain

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is docs/testing.md only about custom testing toolchains?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not, but I think it requires a lot more effort to rethink/rewrite whole setting up rules scala docs. I think it should be done outside this PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My point- configuring custom deps became more complicated (but more powerful and we're ok with it).
If the readme before caused people to think they need to do X to use it now it seems like one needs to do 5X.
Can you please add a note here clarifying that this is needed only for the custom case?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have reorganized doc and added a note about custom deps

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I appreciate it

@ittaiz ittaiz merged commit 773c992 into bazelbuild:master Oct 2, 2020
pass

def scalatest_toolchain():
native.register_toolchain("//testing:scalatest_toolchain")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@liucijus Is this supposed to be register_toolchains?
Added the following in my WORKSPACE file:

load("@io_bazel_rules_scala//testing:scalatest.bzl", "scalatest_toolchain")

scalatest_toolchain()

and it errored out with:

Error: no native function or rule 'register_toolchain'

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for reporting, here's the fix: #1130

blorente pushed a commit to twitter-forks/rules_scala that referenced this pull request Nov 26, 2020
* Add scalatest deps to testing toolchain

* Update testing docs, toolchain and repository loading

* Fix aspect test

* Add testing toolchain to version tests WORKSPACE

* Update testing toolchain docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants