Add a contributing guide, mostly about the corpus tests - #350
Merged
Conversation
Nothing told a contributor that a second test suite exists, that it needs several gigabytes of browser profiles this repository does not carry, or that the corpus is published openly and needs no token to fetch. Two recent pull requests moved a baseline without touching it, which is what that gap looks like from the outside. Covers setup, the split between the unit suite and the corpus suite, where the corpus lives and how to point the tests at one or all of its roots, and what to do when a change moves a baseline: regenerate it deliberately and say what moved, or work out why it moved if you cannot explain it. Also says plainly that skipping the corpus is fine as long as the pull request says so. The skipping behaviour is the part worth writing down. A green `pytest tests/` says nothing about the corpus tests, because without HINDSIGHT_TEST_CORPUS they do not run at all.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Nothing in the repo tells a contributor that a second test suite exists, that it needs several gigabytes of browser profiles that are not committed here, or that the corpus is published openly and takes no token to fetch. Two recent pull requests moved the magnet.ctf_2018 baseline without touching it, which is what that gap looks like from the outside.
CONTRIBUTING.md covers setup, the split between the unit suite and the corpus suite, where the corpus lives and how to point the tests at one root or all six, and what to do when a change moves a baseline. It repeats the rule from generate_baselines.py: regenerate deliberately and say what moved, never to turn a build green. It also says that skipping the corpus is fine as long as the pull request says so, since nobody is going to pull 6 GB for a one line fix.
The part worth writing down is the skip. A green
pytest tests/says nothing about the corpus tests, because without HINDSIGHT_TEST_CORPUS they never ran.README gets a link to it under Feature Requests.
I checked the instructions rather than only writing them: the download URL returns 200, the quoted skip message is what the suite actually prints, and
HINDSIGHT_TEST_CORPUS_ROOTS=magnet.ctf_2018selects the one root and finishes in about five seconds.One bullet in the pull request section is a preference rather than existing policy, the one about keeping descriptions in plain prose. Drop it if you would rather not put that in writing.