-
Notifications
You must be signed in to change notification settings - Fork 180
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
Proposal for golden output testing rule #90
Comments
Golden file verification does indeed does seem like useful functionality we may want to put into bazel-skylib. For one, Stardoc tests re-implement golden file verification from scratch, and I assume there are a number of places similar is done. Would you mind writing a brief proposal and circulating to bazel-dev@googlegroups.com ? I'd like some user feedback before we commit to an API :) We should try to motivate the exact API with some desired usage. We should also try to ensure the rule is platform-agnostic (and thus works for no-Bash Windows, much like the work done in #86) |
@c-parsons, thanks for your response.
I know that
What would you think of a PR as the proposal. It's nice to have a design doc but this shouldn't be extremely complex to implement and we could have a specific discussion about the exact API.
I would be very happy to do that. Do you have any tips/suggestions/pitfalls that I need to look out for? I assume that Windows compatibility is the hard one to come by, but don't have a box that runs it. Any suggestions for that? |
That's fine -- just send a brief introduction email and link to the PR to bazel-dev to give that forum some notice there's something to look at!
Unfortunately not my area of expertise :\ cc @laszlocsomor |
FYI there's already such a rule in This rule doesn't work on Windows at the moment -- I tried fixing it but had to roll back: bazelbuild/bazel#6122 IMO this rule should live in skylib, not in bazel_tools. Moving it out might break existing users though. We can discuss possible approaches. In any case I'm happy to answer question about rule development pifalls on Windows. (Which I'll hopefully get around to document once, see bazelbuild/bazel#3889.) @achew22 if you work for Google, talk to @philwo about requesting access to Bazel team's testing Windows VM on GCP (which isn't fancy in any way, just a vanilla Windows image with Bazel and some compilers + tools already installed). |
+1 for moving |
Is it okay for the core Bazel to depend on starlib? Should I move it over and add a dependency on starlib? How should I handle places where that rule is used in the core repo? |
We check in a copy of everything Bazel depends on, for better or worse. |
I think this was fixed by #136 |
Ping @tetromino ☝🏻 |
In #86 it appears the first rule is being added to skylib. Would there be any interest in adding a new rule that does golden comparison? To pick a name let's call it
golden_test
. I propose it is usable in 3 ways:Literal:
Regexp
Golden file
Would there be any interest in adding a rule like this? I believe that almost every rules_x has implemented something like this and consolidating on a single implementation seems like a not terrible idea.
CC: @c-parsons
The text was updated successfully, but these errors were encountered: