serial_test - 3.0.0, multi-key support

6 Jan 2024

Rust  serial_test 

So, here we are again. Just under a year ago I wrote the 1.0 post for serial_test and to be honest I was kinda expecting I was done right? It's a pretty small library (crates.io says 8.28KiB) and I thought I'd finally finished it all. There was the 2.0.0 release but that was mostly for the Syn 2.x upgrade which required bumping the MSRV, so that wasn't so surprising.

Except nope, there's still more useful features, even within the limited scope I've tried to keep. Somehow in December 2023, two different good feature requests were made and 3.0.0 has just gone out with those.

The first was multiple set tests. Previously all the attributes (#[serial], #[parallel], etc) all supported a single key argument, and optionally for the #[file_serial]/#[file_parallel] ones a second key argument which was an explicit path for the file locking. I now wanted to support the option of multiple keys i.e. instead of being in set "one" or "two", some tests could be in "one" and "two" (or as many as wanted). Annoyingly, this would break the file_* variants, as now you couldn't specify the path, and this is what makes it 3.0.0 not 2.1.0 as it's a breaking change to now instead support the syntax #[file_serial(key, path => "/tmp/foo")].

The second was "apply to this mod". This is enabled for all the attributes, and lets you do things like "all the tests in this mod are in a set" without having to manually set #[serial(my_set)] on all of them. It doesn't currently support nested mod's as that would be fiddlier, but I might do a 3.1.0 with that in if there's demand.

This also gives me the opportunity to go "yay, 16 million downloads!" and more than half of that (9 million) is in the last year, which is not bad!

Previously: apt repository for Discord