-
Notifications
You must be signed in to change notification settings - Fork 369
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
feat(testing): testing utility for running the gazelle binary. #1183
feat(testing): testing utility for running the gazelle binary. #1183
Conversation
This is great! It looks like it is based off of the one I wrote for I think this is a great contribution to the core of Gazelle and can be used to trivially produce more test cases. One enhancement I've long wanted was a quick and easy build rule that you could give a
WDYT? |
I might be able to take a crack at that here, or might make sense as a follow-on PR? I definitely like the idea: makes it much easier to create these tests. |
If you'd like to do it in a follow on, works for me, just tell me and I'll review this one properly |
This is done, but looks like I have some checks to fix. |
- Run gazelle on a test workspace and check the results.
f4c370c
to
eb60fe7
Compare
eb60fe7
to
74d4995
Compare
74d4995
to
e55e9e5
Compare
e55e9e5
to
d418f5c
Compare
- No need to continue iteration in that case.
@achew22 I think this is ready for review now |
- Simplify construction of test args. - Use command line flags to simplify passing test data (no need for awkward manifest file). - Use TEST_TARGET env variable to improve error messages on failure. - Don't pass files to the helper function; just walk the directory. - Don't default BUILD_WORKSPACE_DIRECTORY to ~/workspace. - Collapse gazelle binary dir and gazelle binary name into a single arg.
bfde115
to
c146ac4
Compare
- Update these files with UPDATE_SNAPSHOTS. - Looks for expectedExitCode.txt, expectedStdout.txt, and expectedStderr.txt.
- Reran gazelle_local.
- Keep docs in sync with generated extend.md. - Update doc string for the macro to be a bit more thorough.
- No need to add these expected stdout/stderr/errorcode files to the expected files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aptenodytes-forsteri this has to be one of my favorite PRs into Gazelle in a while. Thank you for putting the time and energy into making this so easy to reuse and to document it so well!
Hooray! Thanks again for all the helpful feedback! |
What type of PR is this?
What package or component does this PR mostly affect?
What does this PR do? Why is it needed?
rules_python
has a nice framework for running full integration tests against an example workspace. This PR pulls that behavior into inte the main gazelle repo. It also adds the ability to update snapshots, so tests can be fixed by re-running with an environment variable set.https://github.com/bazelbuild/rules_python/blob/c6357a68ef2588f4248d8a76d44bc984445bf358/gazelle/python_test.go#L78
Which issues(s) does this PR fix?
Fixes #75 (Possibly)
Other notes for review