Files
threshold/.github/scripts/set-test-package-matrix.sh
Johan Brandhorst-Satzkorn c503fca894 .github: fix test matrix script
The test matrix script was excluding directories that
only contained external package tests (i.e. tests packages
with _test suffix). The following tests were not being run:

    ./internal/daemon/controller/common/scopeids
    ./internal/daemon/controller/handlers/authtokens
    ./internal/daemon/controller/handlers/groups
    ./internal/daemon/controller/handlers/host_catalogs
    ./internal/daemon/controller/handlers/host_sets
    ./internal/daemon/controller/handlers/hosts
    ./internal/daemon/controller/handlers/roles
    ./internal/daemon/controller/handlers/scopes
    ./internal/daemon/controller/handlers/sessions
    ./internal/daemon/controller/handlers/targets/tcp
    ./internal/daemon/controller/handlers/users
    ./internal/db/schema/internal/edition
    ./internal/db/schema/internal/provider
    ./internal/db/schema/migrations/oss
    ./internal/scheduler/cleaner
    ./internal/tests/api/accounts
    ./internal/tests/api/authmethods
    ./internal/tests/api/authtokens
    ./internal/tests/api/credentiallibraries
    ./internal/tests/api/credentials
    ./internal/tests/api/credentialstores
    ./internal/tests/api/groups
    ./internal/tests/api/hostcatalogs
    ./internal/tests/api/hosts
    ./internal/tests/api/hostsets
    ./internal/tests/api/managedgroups
    ./internal/tests/api/roles
    ./internal/tests/api/scopes
    ./internal/tests/api/sessions
    ./internal/tests/api/targets
    ./internal/tests/api/users
    ./internal/tests/api/workers
    ./internal/util
    ./testing/dbtest
    ./testing/internal/e2e/tests/aws
    ./testing/internal/e2e/tests/database
    ./testing/internal/e2e/tests/static
    ./testing/internal/e2e/tests/static_with_vault
2023-05-02 17:34:39 -07:00

8 lines
353 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
# set matrix var to list of unique packages containing tests
matrix="$(go list -json="ImportPath,TestGoFiles,XTestGoFiles" ./... | jq --compact-output '. | select(.TestGoFiles != null or .XTestGoFiles != null) | .ImportPath' | jq --slurp --compact-output '.')"
echo "matrix=${matrix}" | tee -a "${GITHUB_OUTPUT}"