Coding 2022-12-22
After I thought through those changes yesterday, I decided to prioritize increasing coverage and other improvements for now.
One of the "other improvements" centers around test execution time. I hadn't realized it before, but the test execution is not just taken up by the type tests (which I'll address by splitting the relevant module out into its own set of packages). There are also tests of the customized Build task (which should maybe be called PythonBuild?). These tests take up about half of the execution time, and the type tests take up basically the other half. I can probably speed up the build tests by mocking the cmd module so the Cmd class doesn't actually hit the filesystem. I'll look into that later.
Coverage misses review:
- parametric_command is missing one line. That line looks like it could be factored out, but I don't think it's worth it. The required test is to create two ValueAdaptor objects with the same Label, and put them on the same ParametricCommandMeta object, then have a ParametricCommand attempt to build() given that metadata.
- python_helpers is missing one line. I think this line will be relevant for running coverage.py. Perhaps the thing to do is to make stub implementations for coverage, and have tests that just import those modules.
- input_accumulator is missing one line of coverage, and I'm not comfortable trying to add it until I've audited the relevant names, because the data flow around that line is confusing, and it's more or less my fault.
- flex is missing three lines of coverage. One of them appears to be unnecessary and can probably be deleted. One of them can probably be deleted with some care. The remaining line requires a simple dummy test to cover.
- command_builder is missing one line, that requires a simple dummy test to cover.
- build is missing two lines, which will be much easier to cover if I figure out the mocking I want to use.
- installer is missing two lines, which can be tested relatively easily.
- pip is missing six lines, of which five can be tested trivially, and one needs a little more thought to test properly.
- parametric is missing twelve lines, and probably needs a thorough review to plan tests for them.
- command is missing seven lines. I can reduce or eliminate six of them with some careful rewrites, and the remaining line... I honestly think it's best to just delete it, because it doesn't really look like it would pull its weight if I did use it.
- not_output is missing four lines, and those lines are easy to cover, but I'd like to consider, later, what it would take to hit those lines in an integrated sense.
- validators is missing five lines. Many of the tests above would hit one of them, and I'm interested in writing tests for the other four, just because it'd be a nasty shock if someone were somehow debugging MOTR interactively, and suddenly something's repr was broken.
All right, let's call this here. I'll be on the road tomorrow, so I don't know if I'll be up for writing any of those tests, but hopefully over the next week...
Good night.