diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 88c20428d..ab8aa295f 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -23,6 +23,16 @@ jobs: cd yb-voyager go build -v ./... + - name: Verify Build Tags in Test Files + run: | + MISSING_TAGS=$(grep -L '//go:build' $(find . -type f -name '*_test.go' | grep -v vendor) || true) + if [[ -n "$MISSING_TAGS" ]]; then + echo "The following test files are missing a build tag: " + echo "$MISSING_TAGS" + echo "Ensure all test files have a build tag. If a new build tag is introduced, make sure to update the workflow to trigger the tests for that build tag." + exit 1 + fi + - name: Test run: | cd yb-voyager diff --git a/yb-voyager/cmd/importDataFileTaskPicker_test.go b/yb-voyager/cmd/importDataFileTaskPicker_test.go index c24a17ffc..44b9f1ed8 100644 --- a/yb-voyager/cmd/importDataFileTaskPicker_test.go +++ b/yb-voyager/cmd/importDataFileTaskPicker_test.go @@ -1,3 +1,4 @@ +//go:build unit /* Copyright (c) YugabyteDB, Inc. diff --git a/yb-voyager/src/query/sqltransformer/transformer_test.go b/yb-voyager/src/query/sqltransformer/transformer_test.go index c0dc70d6f..02d467643 100644 --- a/yb-voyager/src/query/sqltransformer/transformer_test.go +++ b/yb-voyager/src/query/sqltransformer/transformer_test.go @@ -1,3 +1,5 @@ +//go:build unit + /* Copyright (c) YugabyteDB, Inc.