-
Notifications
You must be signed in to change notification settings - Fork 27
Open
Description
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
- failing tests could be retried
- consistently-failing tests can be marked as disabled (can be stored in a text file in the repo)
- test parallelism can be controlled (eg 1 process per test case, up to
$(nproc)at a time)
Implementation details
- The buck config docs linked above describe the input that
buckitself provides. - The test runner would need to parse the buck-provided JSON file, and then have a switch based on the
typeto determine how to execute the test. - The test runner should support pretty html output like we have today (e8bf770)
- this can be done by either implementing an output format understood by the workflow we use now https://github.com/dorny/test-reporter#supported-formats (
jest-junitis probably the best documented) - alternatively, you can just re-implement the functionality of that test reporter to create a status check with the github api and render some html however you want
- this can be done by either implementing an output format understood by the workflow we use now https://github.com/dorny/test-reporter#supported-formats (
- Automatic disabler (the test state machine) can be implemented as a periodically scheduled GitHub Action that looks at the past N days of test workflow runs and marks tests that have failed 3 times in a row (or some other threshold) as disabled (it can either submit a PR to a text file in the repo, or use a DB in AWS to track state)
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.
- Parse buck test json, run each target and produce an output entry for the entire test target based on the returncode
- Parse the individual test target output to produce output entries for each individual test case
- List tests out of the test target binaries before running and run them in parallel
- cli flag to retry failed tests (this can be passed to the runner through
buck testas described in the docs) - Runner should not execute disabled test cases unless given a special
--run-disabledflag - GitHub Actions workflow to read old test result artifacts and submit a PR / write to an AWS DB to mark consistently failing tests as disabled
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels