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

Roadmap/plan for refactoring tests #824

Open
andyscott opened this issue Aug 19, 2019 · 8 comments
Open

Roadmap/plan for refactoring tests #824

andyscott opened this issue Aug 19, 2019 · 8 comments

Comments

@andyscott
Copy link
Contributor

andyscott commented Aug 19, 2019

I'd like to begin work refactoring the tests. This ticket serves as a place to begin discussion on how to go about this work.

At the very least, I'd love to see the tests split up so that we can run them individually. This will ease development on the rules.

Additionally, I'd love to have a way to run the same tests while varying configuration-- mostly this means varying toolchains and/or specific providers passed to targets while running whole suites of tests. Protobuf fails on windows, currently, so imagine being able to skip the protobuf suite for windows.

Possible approaches:

@ittaiz
Copy link
Member

ittaiz commented Aug 19, 2019 via email

@borkaehw
Copy link
Contributor

borkaehw commented Sep 3, 2019

@andyscott Hi Andy, I am also interested in this issue. Have you had a better idea/plan by any chance?

@borkaehw
Copy link
Contributor

I have done some experiments on both methods proposed by @andyscott . Both seem like good candidates, but I am leaning towards the bash script approach. While the caching concerns are valid, we can get around this by wrapping the scripts with sh_test. This is what bazelbuild/bazel does for their integration tests.

I'm concerned that the learning curve for bazel-integration-testing is a bit high. I ran into some issues trying to set up a minimal example. I'm also concerned that the migration effort would likely be larger than splitting out the tests into separate bash scripts and wrapping those with sh_test.

As for varying toolchains and/or specific providers, I am not quite sure which approach is better.

@SrodriguezO
Copy link
Contributor

SrodriguezO commented Sep 17, 2019

I think this is a great idea. A good first step might be to go through test_rules_scala.sh and group tests/logic that belong together and/or depend on each other. Then we can split these groups into their own scripts with a corresponding sh_test rule in the BUILD file.

@andyscott @ittaiz wdyt?
@borkaehw and I can start on this next week if it sounds like a good approach.

@ittaiz
Copy link
Member

ittaiz commented Sep 17, 2019 via email

@SrodriguezO
Copy link
Contributor

Ah. Python's probably not a great idea either, since we'd still have to transcribe all the tests and in the end we'd land in a non-JVM language.. In that case it might be worth revisiting bazel-integration-testing, since we'd be able to keep the tests in a JVM language that way. (Quick aside though, we ran into some early issues: bazelbuild/bazel-integration-testing#153)

As an intermediate step, however, I still think it would be worthwhile to break up test_rules_scala.sh. We'll need to do this regardless, and migrating individual tests will be less daunting than trying to do them all at once. I suggest we break it up into small shell scripts as the first step and then migrate those to whichever framework we decide on.

This will also give us the benefit of being able to run individual tests sooner, while we migrate to something like bazel-integration-testing.

Does this sound reasonable @ittaiz ?

@ittaiz
Copy link
Member

ittaiz commented Sep 18, 2019 via email

@borkaehw borkaehw mentioned this issue Sep 19, 2019
18 tasks
@borkaehw
Copy link
Contributor

I believe a refactoring of splitting up tests into separate file could be a first step toward our goal. I have a draft PR open #849.

gergelyfabian pushed a commit to gergelyfabian/rules_scala that referenced this issue May 31, 2022
Probe 2 is executed when probe 0 or probe 1 is executed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants