-
Notifications
You must be signed in to change notification settings - Fork 440
Description
I just found out that dynamically registered tests have now been implemented (#349), and they are awesome! Thank you so much for implementing this!
I have one question though: could the dynamically registered tests be executed after the statically defined tests from the file? Right now they are executed first:
$ cat test.bats
@test 'First test' {
true
}
second_test() {
true
}
bats_test_function --description 'Second test' -- second_test
$ ./bats-core/bin/bats test.bats
test.bats
✓ Second test
✓ First test
2 tests, 0 failures
It is of course possible to force the order by dynamically registering all the tests in a file, but that feels a bit clumsy.
Maybe it is a lack of my imagination, but I don't see when I would ever want to run the static tests last. If I have a mix of static and dynamic tests, then the static tests may provide some initial setup that is being utilized by the dynamic test matrix later.
I know there is setup_file
, but I may want to run the setup in @test
functions because it is part of the functionality being tested, and may fail at various points too.