Skip to content

Commit 0cfb952

Browse files
committed
Add preferred Makefile target names while keeping backwards compatibility
Add new preferred target names: - test-mysql-VERSION (e.g., test-mysql-5.6) - test-percona-VERSION (e.g., test-percona-8.0) - test-mariadb-VERSION (e.g., test-mariadb-10.10) - test-tidb-VERSION (e.g., test-tidb-8.5.3) These new targets call the existing backwards-compatible targets. Update CI workflow to use the new preferred names.
1 parent 7351ee9 commit 0cfb952

File tree

2 files changed

+34
-18
lines changed

2 files changed

+34
-18
lines changed

.github/workflows/main.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -103,49 +103,49 @@ jobs:
103103
# MySQL versions
104104
- db_type: mysql
105105
db_version: "5.6"
106-
make_target: "testversion5.6"
106+
make_target: "test-mysql-5.6"
107107
- db_type: mysql
108108
db_version: "5.7"
109-
make_target: "testversion5.7"
109+
make_target: "test-mysql-5.7"
110110
- db_type: mysql
111111
db_version: "8.0"
112-
make_target: "testversion8.0"
112+
make_target: "test-mysql-8.0"
113113
# Percona versions
114114
- db_type: percona
115115
db_version: "5.7"
116-
make_target: "testpercona5.7"
116+
make_target: "test-percona-5.7"
117117
- db_type: percona
118118
db_version: "8.0"
119-
make_target: "testpercona8.0"
119+
make_target: "test-percona-8.0"
120120
# MariaDB versions
121121
- db_type: mariadb
122122
db_version: "10.3"
123-
make_target: "testmariadb10.3"
123+
make_target: "test-mariadb-10.3"
124124
- db_type: mariadb
125125
db_version: "10.8"
126-
make_target: "testmariadb10.8"
126+
make_target: "test-mariadb-10.8"
127127
- db_type: mariadb
128128
db_version: "10.10"
129-
make_target: "testmariadb10.10"
129+
make_target: "test-mariadb-10.10"
130130
# TiDB versions - must match env.TIDB_VERSIONS: 6.1.7 6.5.12 7.1.6 7.5.7 8.1.2 8.5.3
131131
- db_type: tidb
132132
db_version: "6.1.7"
133-
make_target: "testtidb6.1.7"
133+
make_target: "test-tidb-6.1.7"
134134
- db_type: tidb
135135
db_version: "6.5.12"
136-
make_target: "testtidb6.5.12"
136+
make_target: "test-tidb-6.5.12"
137137
- db_type: tidb
138138
db_version: "7.1.6"
139-
make_target: "testtidb7.1.6"
139+
make_target: "test-tidb-7.1.6"
140140
- db_type: tidb
141141
db_version: "7.5.7"
142-
make_target: "testtidb7.5.7"
142+
make_target: "test-tidb-7.5.7"
143143
- db_type: tidb
144144
db_version: "8.1.2"
145-
make_target: "testtidb8.1.2"
145+
make_target: "test-tidb-8.1.2"
146146
- db_type: tidb
147147
db_version: "8.5.3"
148-
make_target: "testtidb8.5.3"
148+
make_target: "test-tidb-8.5.3"
149149
steps:
150150
- name: Checkout Git repo
151151
uses: actions/checkout@v4

Makefile

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,22 @@ testacc: fmtcheck bin/terraform ## Run acceptance tests (requires MYSQL_ENDPOINT
7979
acceptance: testversion5.6 testversion5.7 testversion8.0 testpercona5.7 testpercona8.0 testmariadb10.3 testmariadb10.8 testmariadb10.10 testtidb6.1.7 testtidb6.5.12 testtidb7.1.6 testtidb7.5.7 testtidb8.1.2 testtidb8.5.3 ## Run all acceptance tests across all database versions
8080

8181
# MySQL test targets - use testcontainers
82-
testversion%: ## Run tests against MySQL version (e.g., testversion8.0)
82+
# Preferred format: test-mysql-VERSION (e.g., test-mysql-5.6)
83+
test-mysql-%: ## Run tests against MySQL version (e.g., test-mysql-8.0)
84+
@$(MAKE) testversion$*
85+
86+
testversion%: ## Run tests against MySQL version (e.g., testversion8.0) [backwards compatible]
8387
@DOCKER_IMAGE=mysql:$* PATH="$(CURDIR)/bin:${PATH}" TF_ACC=1 GOTOOLCHAIN=auto go test -tags=testcontainers ./mysql/... -v $(if $(TESTARGS),-run "$(TESTARGS).*WithTestcontainers",-run WithTestcontainers) -timeout=30m
8488

8589
testversion: ## Run tests against MySQL version (set MYSQL_VERSION)
8690
@DOCKER_IMAGE=mysql:$(MYSQL_VERSION) PATH="$(CURDIR)/bin:${PATH}" TF_ACC=1 GOTOOLCHAIN=auto go test -tags=testcontainers ./mysql/... -v $(if $(TESTARGS),-run "$(TESTARGS).*WithTestcontainers",-run WithTestcontainers) -timeout=30m
8791

8892
# Percona test targets - use testcontainers
89-
testpercona%: ## Run tests against Percona version (e.g., testpercona8.0)
93+
# Preferred format: test-percona-VERSION (e.g., test-percona-8.0)
94+
test-percona-%: ## Run tests against Percona version (e.g., test-percona-8.0)
95+
@$(MAKE) testpercona$*
96+
97+
testpercona%: ## Run tests against Percona version (e.g., testpercona8.0) [backwards compatible]
9098
@DOCKER_IMAGE=percona:$* PATH="$(CURDIR)/bin:${PATH}" TF_ACC=1 GOTOOLCHAIN=auto go test -tags=testcontainers ./mysql/... -v $(if $(TESTARGS),-run "$(TESTARGS).*WithTestcontainers",-run WithTestcontainers) -timeout=30m
9199

92100
testpercona: ## Run tests against Percona version (set MYSQL_VERSION)
@@ -101,14 +109,22 @@ testrdsdb: ## Run tests against Amazon RDS (requires MYSQL_ENDPOINT env vars)
101109
$(MAKE) testacc
102110

103111
# TiDB test targets - use testcontainers
104-
testtidb%: ## Run tests against TiDB version (e.g., testtidb8.5.3)
112+
# Preferred format: test-tidb-VERSION (e.g., test-tidb-8.5.3)
113+
test-tidb-%: ## Run tests against TiDB version (e.g., test-tidb-8.5.3)
114+
@$(MAKE) testtidb$*
115+
116+
testtidb%: ## Run tests against TiDB version (e.g., testtidb8.5.3) [backwards compatible]
105117
@DOCKER_IMAGE=tidb:$* PATH="$(CURDIR)/bin:${PATH}" TF_ACC=1 GOTOOLCHAIN=auto go test -tags=testcontainers ./mysql/... -v $(if $(TESTARGS),-run "$(TESTARGS).*WithTestcontainers",-run WithTestcontainers) -timeout=30m
106118

107119
testtidb: ## Run tests against TiDB version (set MYSQL_VERSION)
108120
@DOCKER_IMAGE=tidb:$(MYSQL_VERSION) PATH="$(CURDIR)/bin:${PATH}" TF_ACC=1 GOTOOLCHAIN=auto go test -tags=testcontainers ./mysql/... -v $(if $(TESTARGS),-run "$(TESTARGS).*WithTestcontainers",-run WithTestcontainers) -timeout=30m
109121

110122
# MariaDB test targets - use testcontainers
111-
testmariadb%: ## Run tests against MariaDB version (e.g., testmariadb10.10)
123+
# Preferred format: test-mariadb-VERSION (e.g., test-mariadb-10.10)
124+
test-mariadb-%: ## Run tests against MariaDB version (e.g., test-mariadb-10.10)
125+
@$(MAKE) testmariadb$*
126+
127+
testmariadb%: ## Run tests against MariaDB version (e.g., testmariadb10.10) [backwards compatible]
112128
@DOCKER_IMAGE=mariadb:$* PATH="$(CURDIR)/bin:${PATH}" TF_ACC=1 GOTOOLCHAIN=auto go test -tags=testcontainers ./mysql/... -v $(if $(TESTARGS),-run "$(TESTARGS).*WithTestcontainers",-run WithTestcontainers) -timeout=30m
113129

114130
testmariadb: ## Run tests against MariaDB version (set MYSQL_VERSION)

0 commit comments

Comments
 (0)