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

add support for rule customization scala test color and stack trace o… #268

Merged
merged 2 commits into from
Aug 30, 2017
Merged

add support for rule customization scala test color and stack trace o… #268

merged 2 commits into from
Aug 30, 2017

Conversation

softprops
Copy link
Contributor

…utput

@bazel-io
Copy link
Member

Can one of the admins verify this patch?

@softprops
Copy link
Contributor Author

Looking for some input on what a good test would look like for this

scala/scala.bzl Outdated
@@ -852,6 +860,8 @@ scala_test = rule(
attrs={
"main_class": attr.string(default="io.bazel.rulesscala.scala_test.Runner"),
"suites": attr.string_list(),
"colors": attr.bool(default=False),
"full_stacktraces": attr.bool(default=False),
Copy link
Member

Choose a reason for hiding this comment

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

I'm happy making both of these default to True and let people opt out, personally.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Me too actually. We'd opt to enable these as our internal defaults either way, but I wasn't sure how much pushback I'd get from changing existing behavior if I did. Looks like not much :)

scala/scala.bzl Outdated
@@ -987,11 +997,12 @@ def _sanitize_string_for_usage(s):
# This auto-generates a test suite based on the passed set of targets
# we will add a root test_suite with the name of the passed name
def scala_test_suite(name, srcs = [], deps = [], runtime_deps = [], data = [], resources = [],
scalacopts = [], jvm_flags = [], visibility = None, size = None):
scalacopts = [], jvm_flags = [], visibility = None, size = None,
colors=False, full_stacktraces=False):
Copy link
Member

Choose a reason for hiding this comment

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

again, I'm happy for these to default to true.

Copy link
Member

@ittaiz ittaiz left a comment

Choose a reason for hiding this comment

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

If this is the scope of the change in scala.bzl then I think I'll be able to "take the hit" of the conflicts on myself.
If you and Oscar finish your ping pong before I'm ready I don't object to the merge (with respect to the other change)

scala/scala.bzl Outdated
@@ -682,9 +682,17 @@ def _scala_test_impl(ctx):

transitive_rjars += [ctx.outputs.jar]

# output report test duration
Copy link
Member

Choose a reason for hiding this comment

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

Any chance you can extract this block into a "flags" method? This will decrease the likelihood of us having a collision.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

absolutely. I eta on that is probably within the next day or so

@softprops
Copy link
Contributor Author

Couldn't help noticing travis build was failing. I don't think it's related to these changes though

bazel command not found https://travis-ci.org/bazelbuild/rules_scala/jobs/268985675#L574

@ittaiz
Copy link
Member

ittaiz commented Aug 28, 2017 via email

@softprops
Copy link
Contributor Author

I'd like to follow up on making the more dev friendly settings the default if that's okay. I can also follow up with factoring out a python method for the flags if that makes it less likely to conflict with the other branch

Copy link
Member

@johnynek johnynek left a comment

Choose a reason for hiding this comment

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

+1 when we get the True defaults

@softprops
Copy link
Contributor Author

updated pull with factored out flag func and more useful defaults for test colors and stacktraces

@softprops
Copy link
Contributor Author

Bump

@johnynek johnynek merged commit 3f0b442 into bazelbuild:master Aug 30, 2017
@johnynek
Copy link
Member

Thanks @softprops !

merged side stepping the HEAD issue which is persistent.

@softprops
Copy link
Contributor Author

Thanks @johnynek

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.

5 participants