Skip to content

Conversation

@viclovsky
Copy link
Contributor

@viclovsky viclovsky requested a review from ittaiz as a code owner September 22, 2020 15:52
@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@viclovsky
Copy link
Contributor Author

@googlebot I signed it!

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

Copy link
Contributor

@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.

Thanks!
This change looks good in general.
I think there's value in adding a test that demonstrates this ability and more importantly covers regressions.
I'd hate for someone to change this in 3 months only to find out that twitter is broken when you try to update internally.
I know this makes this PR more complicated but I think the value of always covering features with tests is huge.

@viclovsky viclovsky requested a review from ittaiz September 27, 2020 22:26
@ittaiz
Copy link
Contributor

ittaiz commented Sep 28, 2020

@viclovsky I don't think the test will break if I stop using the attribute and use the default value. Maybe have the custom reporter write to a custom file and then add an e2e test (bash) that checks this file with something like "hi from custom"?

@viclovsky
Copy link
Contributor Author

@viclovsky I don't think the test will break if I stop using the attribute and use the default value. Maybe have the custom reporter write to a custom file and then add an e2e test (bash) that checks this file with something like "hi from custom"?

@ittaiz thanks a lot for the comment.
I faced with problem that e2e test (Bash script) can't get the created custom file from sandbox. Do you have any idea how to do it?

I can write e2e test which checks output that Custom Reporter generates into stdout. But it would be great to find a way to do with file.

@ittaiz
Copy link
Contributor

ittaiz commented Sep 29, 2020 via email

Copy link
Contributor

@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.

Looks good.
Q- did you see the test fail and for the right reason? (for example by still using a hardcoded value)? We've had many times where bash tests didn't fail or worse, failed for the wrong reasons.

@viclovsky
Copy link
Contributor Author

Looks good.
Q- did you see the test fail and for the right reason? (for example by still using a hardcoded value)? We've had many times where bash tests didn't fail or worse, failed for the wrong reasons.

Yes, I've checked -- e2e test (bash script) fails on changing output file or even on removing reporter_class parameter from scala_test. The error looks like
File /private/var/tmp/_bazel_vicdev/1f71015f51ed51b69665f449a86c83b2/execroot/io_bazel_rules_scala/bazel-out/darwin-fastbuild/testlogs/test/scala_test/custom_reporter/test.outputs/custom_reporter_check does not exist.

@ittaiz
Copy link
Contributor

ittaiz commented Sep 29, 2020 via email

@ittaiz
Copy link
Contributor

ittaiz commented Sep 30, 2020

restarting travis

@ittaiz ittaiz closed this Sep 30, 2020
@ittaiz ittaiz reopened this Sep 30, 2020
@ittaiz ittaiz merged commit 725b004 into bazel-contrib:master Sep 30, 2020
"colors": attr.bool(default = True),
"full_stacktraces": attr.bool(default = True),
"jvm_flags": attr.string_list(),
"reporter_class": attr.string(
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks amazing!

Sorry for post merge CR but I have a small comment!

I'd use Bazel's doc attribute to document this new attribute.
I'm guessing one day we would want to auto-generate full manual and I think reverse engineering and by git blame is not the best way to go.

blorente pushed a commit to twitter-forks/rules_scala that referenced this pull request Nov 26, 2020
* Added ability to configure reporter class

* Added test for "reporter_class" option

* Added e2e test (bash script) which checks output file from Custom report

* Added test_custom_reporter_class.sh to test_rules_scala.sh

* Fix lint
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