Skip to content

feat(env-setup): add postgres + mysql to services block#28

Merged
AndriiTsok merged 1 commit intomainfrom
feat/services-postgres-mysql
Apr 19, 2026
Merged

feat(env-setup): add postgres + mysql to services block#28
AndriiTsok merged 1 commit intomainfrom
feat/services-postgres-mysql

Conversation

@AndriiTsok
Copy link
Copy Markdown
Contributor

Consumers shipping SQL bindings need a running DB to test against. New services: postgres: true / services: mysql: true installs + starts the server, creates mcpg:mcpg/mcpg_test, and exports POSTGRES_TEST_URL / MYSQL_TEST_URL. Tests read the env var directly.

Linux-only; warning on non-Linux. Tagging v1.7.0 after merge.

Consumers writing a SQL binding need a running database to test
against. Extend the services block with two new keys:

  services:
    postgres: true
    mysql: true

Unlike redis/nats (binaries installed on PATH; tests spawn them),
postgres and mysql are heavier: the action installs the server AND
starts it AND creates a test user + database, then exports the
connection URL as a well-known env var.

  service_postgres=true → POSTGRES_TEST_URL=postgres://mcpg:mcpg@localhost/mcpg_test
  service_mysql=true    → MYSQL_TEST_URL=mysql://mcpg:mcpg@127.0.0.1/mcpg_test

Tests read the env var directly; no in-test server spawning
needed. Credentials are standardized so integration tests across
consumers don't have to negotiate.

Linux-only (same as redis/nats). Warning on non-Linux runners.
Self-test gets two new asserts on the skip path.
@AndriiTsok AndriiTsok merged commit 02dc499 into main Apr 19, 2026
6 checks passed
@AndriiTsok AndriiTsok deleted the feat/services-postgres-mysql branch April 19, 2026 04:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant