Coding 2020-08-09

By Max Woerner Chase

I mentioned yesterday that I wanted to make limit-coverage work with the repository layout that I've used for a few projects now. I put in the effort to update it, and I got it basically working, but I did end up regressing with respect to one of my repository layouts in a somewhat weird way. I decided to just accept the reduction in functionality and slightly reorganize the repository. The only ongoing problem I'm having there is that I'm having the same nox session for that repo pass locally, and fail every time in Travis. I'm going to have to remember to check again in the morning and see if it does any better, because no matter how many times I try, Travis doesn't act like my machine.

While I was in limit-coverage, adding documentation and doing a bunch of manual tests, I kind of had to reflect on my habit of having really poor automation around testing and verifying the tools I write to help test and verify everything else. I think one of the factors there is that these tools tend to work with the implementation or internal format of other tools. This is certainly the case with limit-coverage, and its more horrifyingly-invasive predecessor, divide-and-cover. (limit-coverage programmatically deletes some rows from a sqlite database and supports every version of Coverage.py starting from 5.0a6. divide-and-cover was basically every "here's why subclassing to add functionality is bad" example rolled into one, and needed updates to avoid regressing functionality added in Coverage 4.5, which was just one minor version later than it was originally written against.)

I'm going to have to think about how to address this. I mean, the answer is "write more tests", but I look at the tests that I'd have to write and feel really discouraged. Tests against this functionality basically need fake source code repositories and coverage data to work with. I suppose I could just write a bunch of toy repos that each exercise a little bit of functionality...

Amyway, the other thing I can do to find issues is use this more widely, which now I can do, since it should work on every repo I've done active development against recently. I'll get to work on that tomorrow, unless I decide to focus on something else.

Good night.