Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #127
This is a fairly simple implementation of
solo_test
andsolo_group
, restricted to the "backend" code (lib/src/backend/declarer.dart
andlib/src/backend/metadata.dart
).WIP
This PR is functional, but I'm throwing it out there as a "request for comments." What do the authors think?
TODO:
solo_test
andsolo_group
. These should be lengthy, with explanations of inheritance, and what to expect in output.Notes
The real API change is to add a
solo:
named arg totest
andgroup
, but the backward compatibility, and real beauty, comes in implementing thepackage:unittest
methods:solo_test
andsolo_group
. Those five characters,solo_
are what people love so much about unittest's feature.The feature works by declaring all non-solo tests or groups as "skipped". So there is no new status in the reporting. For example:
We see that it looks like one test ran, and two were skipped. This is the analogy of "solo".
I don't think this feature needs a new status (something like "00:00 !1 ~2: All tests passed!"), but we could if we wanted.
We could change the "All tests passed!" text to be different if any tests were skipped, but that would be a separate feature, unrelated to this PR.
I did not change the return code if a solo test/group is found. We could if we wanted to, but again, this could be a separate feature (different return code if any tests are skipped), unrelated to this PR.
We could add one line of text to the output, like "Solo test/group found! Skipping everything not solo." But I don't think it's required.
I didn't do anything fancy to
solo
as a metadata attribute, which means it behaves like others (specifically,skip
. This means it has the same "inheritance" rules asskip
(tests and groups inherit value from containing group). For example:test A
andtest B
are skipped; simple enough.test D
is run; no surprise there.test C
is the only interesting case: it is run, even though it is a non solo test, sitting next to a solo test, because it inheritsgroup2
's solo status.Other cases are considered in the tests, in this PR.