-
Notifications
You must be signed in to change notification settings - Fork 219
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
Feature: allow buck2 test
to test pure Starlark logic
#796
Comments
I just do:
At the bottom of the file. Means these tests run in every single run, but they are typically millisecond duration, and if they fail, the consequences are often serious. As an example, buck2/prelude/utils/directory_fold.bzl Line 45 in f68a1d2
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I just had to implement this function in Starlark:
What I'd like to do is write a test for this in terms of buck2 test, but I don't really think I can. I don't see why it shouldn't be possible, though?
For example you could imagine a BUILD file that does something like this:
test_starlark_assert
could then just be a rule that returns some provider containing a pass/fail status, and the logic itself can actually be in the rule (this would allow you to have things like expected failures and write them on your own). Because these tests are actually pure you could have a family of providers you return:I understand the TestInfo v2 thing won't be done for a while now, but this seems like a rather independent addition to the API.
The text was updated successfully, but these errors were encountered: