This is essential near-term. +many!
Is the longer-term discussed somewhere?
(1) Wording could be clearer to elicit more reviews
to designate a parameterized test or test suite to run sub-tests serially , ensuring sequential execution
?: Sub-tests? I'm not sure how best to talk about member/child tests of a container/parent.
?: I would avoid implying sequential or ordered unless the order really is defined and enforced (even if the implementation is definitive now).
(2) Non-parameterized tests
It would be nice if it were impossible to put a .serialized trait on a non-parameterized test. Would it make sense to use a different term for the two targets? That might also help if suite-level and parameterized-test-level features diverge in the future. (Currently trait protocols are per-Suite-level and per-Test, making this suggestion impossible?)
(3) Future-proofing
Would it make sense to anticipate some future semantics, and consider usage in that light?
E.g., .serialized(with {group}: "name")?
(The proposal didn't refer to related features or discussions, so forgive me if you/others already have ideas in mind.)
Suites are tests organized for their own reasons. Developers might want to preserve parallelism for some tests in the suite over refactoring the suite to only include serialized tests, or might want to designate multiple serial member subsets.
Similarly, parameterized tests might partition on one of the inputs being combined (e.g., a mock persistence context), such that tests with the same element should be run serially, but tests with different instances of the element could run in parallel.
Also, it may help to name these groups, to document and find and understand the members.
The developer's mental model might be something like token/baton-passing concurrency: only one test with the baton can run at a time, for those tests needing the baton.
I realize this might not be in the cards for now, but can we ensure this proposal remain (source-) consistent with that model (or some other more flexible model)?
Could the proposed .serialized be a shorthand for .serialized(with:) where the default argument means "everything in this container"?
When implemented, using a StaticString could permit compile-time errors from mixing batons (e.g., across suites and tests). Developers could have a common static definition, and find all tests in the group as those using that symbol.
Also, ordering behavior could be specified as inter-baton/group orderings: first all the data-loading tests, then the analysis tests, then some mutation tests...