Skip to content

Commit 8caf1f4

Browse files
committed
test: run _mysqlcommon unit tests in make + CI; note MariaDB binary requirement
go test ./... skips underscore-prefixed dirs, so internal/driver/_mysqlcommon unit tests were silently excluded from make test and CI. Name _*-prefixed packages explicitly so the arg-builder/version tests actually run. Also document that the MariaDB driver requires the renamed mariadb-dump/mariadb binaries.
1 parent 9559175 commit 8caf1f4

3 files changed

Lines changed: 13 additions & 6 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,10 @@ jobs:
3838
cache: true
3939
- name: go vet
4040
run: go vet ./...
41+
# `./...` skips underscore-prefixed dirs, so name _*-prefixed packages
42+
# explicitly (e.g. internal/driver/_mysqlcommon) to run their unit tests.
4143
- name: go test
42-
run: go test ./...
44+
run: go test ./... ./internal/driver/_*/
4345
# Integration tests use testcontainers, which needs a Docker daemon.
4446
# Only ubuntu-latest runners have Docker available by default, so the
4547
# DB client install and integration suite are scoped to Ubuntu.
@@ -59,4 +61,4 @@ jobs:
5961
sudo apt-get install -y postgresql-client mysql-client mariadb-client
6062
- name: Integration tests (Ubuntu only — needs Docker)
6163
if: matrix.os == 'ubuntu-latest'
62-
run: go test -tags=integration ./...
64+
run: go test -tags=integration ./... ./internal/driver/_*/

Makefile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,19 @@ help: ## Show this help
99
lint: ## Run golangci-lint
1010
golangci-lint run
1111

12+
# NOTE: `go test ./...` skips directories whose names start with `_` (Go tool
13+
# convention), so underscore-prefixed packages with real tests (e.g.
14+
# internal/driver/_mysqlcommon) are silently excluded. Name them explicitly via
15+
# the `_*` glob so their unit tests actually run. The glob auto-picks up any
16+
# future _*-prefixed package under internal/driver/.
1217
test: ## Run unit tests
13-
go test ./...
18+
go test ./... ./internal/driver/_*/
1419

1520
test-verbose: ## Run unit tests verbosely
16-
go test -v ./...
21+
go test -v ./... ./internal/driver/_*/
1722

1823
test-integration: ## Run integration tests (build tag: integration)
19-
go test -tags=integration ./...
24+
go test -tags=integration ./... ./internal/driver/_*/
2025

2126
build: ## Build the siphon binary into ./bin
2227
@mkdir -p bin

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ A single binary that turns the painful, error-prone sprawl of `pg_dump` → `pg_
6464
- **Database client tools** — siphon shells out to the native dump/restore tools; it does not embed a client. You only need the tools for the engines you actually use:
6565
- **PostgreSQL** profiles need `pg_dump`, `pg_restore`, `psql`.
6666
- **MySQL** profiles need `mysqldump`, `mysql`.
67-
- **MariaDB** profiles need `mariadb-dump`, `mariadb`.
67+
- **MariaDB** profiles need `mariadb-dump`, `mariadb` (the renamed binaries shipped by MariaDB 10.5+; older installs that only ship `mysqldump`/`mysql` are not yet supported).
6868

6969
| Platform | PostgreSQL | MySQL / MariaDB |
7070
| ------------- | --------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------- |

0 commit comments

Comments
 (0)