-
Notifications
You must be signed in to change notification settings - Fork 17
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
Implement a custom test runner for buck test #145
Comments
Like I said in the Zoom, just write your code with Some rust crates that are likely to be useful:
|
I created a draft PR at #147 with this first stage (just not yet with the pretty html output).
When dealing with python tests I can imagine parsing source code looking for test-annotated functions, but I'm not sure how I would start in the case of binaries. Any ideas on how we could do this?
Does something like a
The order of these last two is probably switched ;) |
Ah, I'm sorry I totally thought that this was a standard part of Python and not Facebook specific. Rust test binaries have a
Perfect
Hmm, it could go either way right :) depending on how you implement the disabling. I would argue that implementing |
Just to keep you updated, the draft at #147 is now only missing the auto-disabler and items 5 and 6, which I'll implement as discussed last week |
Summary: Custom buck test runner for #145 This PR provides an external test runner which is currently able to list out individual unit tests from Python and Rust binaries coming from buck tests, execute them in parallel and report results in JUnit's XML format, which should be CI-compatible (although integration with the [test reporter](https://github.com/dorny/test-reporter) is yet to be tested). It can also retry tests and will silently ignore those manually marked for exclusion (for instance, those with a `"disabled"` label). The next step after this is implementing the rest of #145, namely a way to keep track of state between test runs on the CI so as to automatically disable some tests. NOTE by vmagro: I am (temporarily) duplicating the `ci.yml` workflow to use this external runner, until it's at feature parity with the internal test runner that is already being used Pull Request resolved: #147 Test Plan: Was able to run this with `--config test.external_runner` on my desktop and got nice looking output from each test case Reviewed By: zeroxoneb Differential Revision: D30372373 Pulled By: vmagro fbshipit-source-id: 33a3aea346375a0a60b4cbc687e642f381f33d1f
buck test
has provisions for running with a custom test runner (see https://buck.build/files-and-dirs/buckconfig.html#test.external_runner)Benefits
A custom test runner would give us a lot of control over how tests are run
$(nproc)
at a time)Implementation details
buck
itself provides.type
to determine how to execute the test.jest-junit
is probably the best documented)Desired features
Features can be added in stages, the bare minimum for the first revision is a test runner that implements Python unit tests, and outputs a single pass/fail for the test target based on the return code obtained from just running the pex.
buck test
as described in the docs)--run-disabled
flagThe text was updated successfully, but these errors were encountered: