1.
RE using local package.py. I think it can make sense to source `tests` from here, but I don't think that the package should ever be getting implicitly installed as that PR does. In terms of running tests on the non-built/installed package, this does make sense for some tests (such as linting), but not for others, so we would have to treat these as a separate case. For example, perhaps you would add a "local=True" field for those tests. They would then be runnable in some 'local' rez-test mode (eg `rez-test .`, when in same dir as package.py).
So we have a few different cases:
* rez-test run on an installed package. Currently working, no issues
* rez-test on an installed package, but using local package.py for 'tests' attribute. Ok, but needs to be obvious and explicit
* rez-test on a package that hasn't been built yet. Ok too (eg linting), but again needs to be explicit, and we would need to identify those tests that this is valid for.
So I'm not against these features, but I think we need to be clear about how it works, and we need to ensure that it isn't too confusing to the user, before we implement it.
Off the top of my head, perhaps it would work like this:
* `rez-test .` puts us into "local" testing mode. In this mode, 'tests' from local package.py is always used
* In local testing mode, if a test has "local=True", then it is run on the uninstalled package (ie the source). If not, it's run on the installed package.
* local=True tests are stripped from installed packages.
2.
I like the proposal for 'test_commands', I think that makes sense. It would also make sense to go a little further... since you can run "command" in a rex function also, it stands to reason that you may want to do this in your 'test_commands' instead (perhaps the command differs based on the env). So it would also make sense for "command" in the tests dict entry to be optional.
Thx
A