Skip to content

Commit bdcc960

Browse files
committed
Fix CI workflow - set DOCKER_IMAGE and TIDB_VERSION as env vars
Set DOCKER_IMAGE and TIDB_VERSION as environment variables in the step, then unset the one that's not needed for each test type. This ensures environment variables are properly available to TestMain.
1 parent 2396bb2 commit bdcc960

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

.github/workflows/main.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,22 +186,29 @@ jobs:
186186
GOFLAGS: -mod=vendor
187187
TF_ACC: 1
188188
GOTOOLCHAIN: auto
189+
DOCKER_IMAGE: ${{ matrix.docker_image }}
190+
TIDB_VERSION: ${{ matrix.db_version }}
189191
run: |
190192
export PATH="${{ github.workspace }}/bin:$PATH"
191193
if [ "${{ matrix.db_type }}" == "tidb" ]; then
192-
export TIDB_VERSION=${{ matrix.db_version }}
194+
# TiDB tests - validate TIDB_VERSION is set
193195
if [ -z "$TIDB_VERSION" ]; then
194196
echo "ERROR: TIDB_VERSION is not set for TiDB test"
195197
exit 1
196198
fi
199+
# Ensure DOCKER_IMAGE is not set for TiDB tests
200+
unset DOCKER_IMAGE
201+
echo "Running TiDB tests with version: $TIDB_VERSION"
197202
go test -tags=testcontainers -v ./mysql/... -run WithTestcontainers -timeout=30m
198203
else
199-
export DOCKER_IMAGE=${{ matrix.docker_image }}
204+
# MySQL/Percona/MariaDB tests - validate DOCKER_IMAGE is set
200205
if [ -z "$DOCKER_IMAGE" ]; then
201206
echo "ERROR: DOCKER_IMAGE is not set for ${{ matrix.db_type }} test"
202207
exit 1
203208
fi
204-
echo "Using Docker image: $DOCKER_IMAGE"
209+
# Ensure TIDB_VERSION is not set for MySQL tests
210+
unset TIDB_VERSION
211+
echo "Running ${{ matrix.db_type }} tests with Docker image: $DOCKER_IMAGE"
205212
go test -tags=testcontainers -v ./mysql/... -run WithTestcontainers -timeout=30m
206213
fi
207214
release:

0 commit comments

Comments
 (0)