Add focused changed-path test wrapper
This commit is contained in:
1 parent
7a0feb39aa
commit
63ff1b6b43
3 files changed
+184
No files matched your search
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env bats
|
||||
# Seam: the changed-test wrapper selects only the tests associated with
|
||||
# staged paths and refuses to silently run the entire suite.
|
||||
|
||||
load helpers
|
||||
|
||||
@test "changed-test wrapper is executable and uses staged diff by default" {
|
||||
[ -x "$REPO_ROOT/scripts/test-changed.sh" ]
|
||||
run grep -F 'git diff --cached' "$REPO_ROOT/scripts/test-changed.sh"
|
||||
[ "$status" -eq 0 ]
|
||||
}
|
||||
|
||||
@test "changed-test wrapper maps a compose change to compose and environment tests" {
|
||||
run bash "$REPO_ROOT/scripts/test-changed.sh" --list --paths dankserver/compose.yaml
|
||||
[ "$status" -eq 0 ]
|
||||
[[ "$output" == *"tests/compose_validity.bats"* ]]
|
||||
[[ "$output" == *"tests/env_consistency.bats"* ]]
|
||||
[[ "$output" != *"tests/homepage_pages.bats"* ]]
|
||||
}
|
||||
|
||||
@test "changed-test wrapper maps a service script to its focused config tests" {
|
||||
run bash "$REPO_ROOT/scripts/test-changed.sh" --list --paths scripts/serve-frank-small.sh
|
||||
[ "$status" -eq 0 ]
|
||||
[[ "$output" == *"tests/scripts_syntax.bats"* ]]
|
||||
[[ "$output" == *"tests/frank_small_config.bats"* ]]
|
||||
[[ "$output" != *"tests/frank_large_config.bats"* ]]
|
||||
}
|
||||
Reference in new issue
Block a user