Open TLINDEN opened 3 months ago
PS: I can work around the problem by using
# bats test_tags=simple,a
@test "simple a" {
run ls
[ "$status" -eq 0 ]
}
# bats test_tags=simple,b
@test "simple b" {
run ls
[ "$status" -eq 0 ]
}
That way I can now execute all tests tagged simple
. However, it's not a hierarchy anymore. If any other test also has a b
tag, then I am unable to address the specific test:
# bats test_tags=complex,a
@test "complex a" {
run ls
[ "$status" -eq 0 ]
}
# bats test_tags=complex,a
@test "complex a" {
run ls
[ "$status" -eq 0 ]
}
Now specifying --filter-tags a
matches the "simple a" and "complex a" test:
bats/bin/bats --filter-tags a --verbose-run tom.bats
tom.bats
✓ simple a
✓ complex a
2 tests, 0 failures
However, I can use the filter simple,a
to just execute one test:
bats/bin/bats --filter-tags simple,a --verbose-run tom.bats
tom.bats
✓ simple a
1 test, 0 failures
Maybe this is the intended behavior, but then the documentation is not clear enough about it.
I will mark this as a feature request. The separators were mostly intended as reading aid.
Describe the bug According to the documentation:
I added a couple of tags like
simple:a
,simple:b
etc. Then I want to run all tests under thesimple
"tag namespace" by:bats/bin/bats --filter-tags simple --verbose-run tom.bats
Which does not execute any test under
simple:
tags.To Reproduce Steps to reproduce the behavior:
Test file:
Execute:
However, specifying the whole "namespace" works:
Expected behavior
Bats should execute all tests tagged
simple
Environment (please complete the following information):
190c7c9
kubuntu 24.4 LTS
bash --version
:5.2.21(1)-release