Running arbitrary scripts as part of hatch test
Is hatch test limited to running the four documented scripts (run, run-cov, cov-combine, cov-report) or can we run arbitrary scripts? Currently looking to replace our use of tox that calls pytest and some other tests. Thanks
You can override the scripts and also define anything else there that you want. You can also define extra scripts if you don't want to modify the default ones.
Thanks, skimming over
https://github.com/pypa/hatch/blob/master/src/hatch/cli/test/init.py
hatch test seems mostly syntactic sugar for running some combination of the run/run-cov/cov-combine/cov-report scripts within the hatch-test environment? So I can override the scripts (as long as I call them those names), but I can't use arbitrary names?
Our tox config has a few different environments defined which run tests using pytest, run linters etc similar to https://tox.wiki/en/4.15.1/user_guide.html. All these are run across the environment matrices when I run the single "tox" command. My understanding is that for the same behaviour with hatch test, I'd need to use one of the four names to override scripts in the hatch-test environment. Alternatively, I could use arbitrary script names but would have to invoke them individually with hatch run.
The docs should also show, as examples, how exactly one can use these commands after defining them in the manifest file.