mirror of
https://github.com/grafana/grafana.git
synced 2026-03-13 15:29:48 +08:00
Fix pkgs-with-tests-named.sh matching tests from subdirectories (#119501)
* Fix pkgs-with-tests-named.sh matching tests from subdirectories The find command was recursive by default, causing packages to be included in the results based on test functions in subdirectory packages. Adding -maxdepth 1 matches Go's package semantics where only files in the same directory belong to a package. * ci: trigger integration tests for backend test script changes
This commit is contained in:
1
.github/actions/change-detection/action.yml
vendored
1
.github/actions/change-detection/action.yml
vendored
@@ -78,6 +78,7 @@ runs:
|
||||
- '.github/actions/change-detection/**'
|
||||
- '**.cue'
|
||||
- 'devenv/docker/blocks/*_tests/**'
|
||||
- 'scripts/ci/backend-tests/**'
|
||||
- 'kindsv2/**'
|
||||
- '${{ inputs.self }}'
|
||||
frontend:
|
||||
|
||||
@@ -60,7 +60,7 @@ fi
|
||||
readarray -t PACKAGES <<< "$(go list -f '{{.Dir}}' -e "${dirs[@]}")"
|
||||
|
||||
for i in "${!PACKAGES[@]}"; do
|
||||
readarray -t PKG_FILES <<< "$(find "${PACKAGES[$i]}" -type f -name '*_test.go')"
|
||||
readarray -t PKG_FILES <<< "$(find "${PACKAGES[$i]}" -maxdepth 1 -type f -name '*_test.go')"
|
||||
if [ ${#PKG_FILES[@]} -eq 0 ] || [ ${#PKG_FILES[@]} -eq 1 ] && [ -z "${PKG_FILES[0]}" ]; then
|
||||
unset "PACKAGES[$i]"
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user