Skip to content

ci: switch test workflows to MariaDB#461

Merged
nielsdrost7 merged 4 commits into
developfrom
codex/switch-github-actions-to-mariadb-or-mysql
Jun 6, 2026
Merged

ci: switch test workflows to MariaDB#461
nielsdrost7 merged 4 commits into
developfrom
codex/switch-github-actions-to-mariadb-or-mysql

Conversation

@nielsdrost7

@nielsdrost7 nielsdrost7 commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

Motivation

  • The CI was using an SQLite in-memory setup which produced SQL errors for queries like SHOW TABLES, so tests should run against MariaDB/MySQL in GitHub Actions to match production behavior.
  • Ensure workflows that run migrations, seeds or full tests have a consistent MySQL/MariaDB service and the correct PDO extension installed so CI test runs succeed.

Description

  • Replaced SQLite testing defaults with MySQL settings in .env.testing.example by setting DB_CONNECTION=mysql and adding DB_HOST, DB_PORT, DB_DATABASE, DB_USERNAME, and DB_PASSWORD.
  • Updated phpunit.xml and phpunit.smoke.xml to use MySQL connection environment variables instead of SQLite :memory:.
  • Modified GitHub Actions workflows (.github/workflows/phpunit.yml, smoke.yml, quickstart.yml, composer-update.yml, setup.yml, yarn-update.yml) to add a MariaDB service (image mariadb:11), expose matching DB_* env vars, and use a MariaDB-friendly healthcheck.
  • Replaced sqlite with pdo_mysql in the action defaults and workflow PHP extension lists and updated .github/actions/setup-php-composer/action.yml to default to pdo_mysql.
  • Updated documentation in .github/RUNNING_TESTS.md to reflect the MariaDB/MySQL-backed PHPUnit configuration.

Testing

  • Loaded all workflow YAML files with ruby -e 'require "yaml"; ...' and parsing succeeded for every .github/workflows/*.yml.
  • Ran composer validate --no-check-publish and it passed (Composer schema warnings remain but are unrelated to this change).
  • Verified with rg that the previous SQLite in-memory configuration was removed from phpunit.xml, phpunit.smoke.xml, .env.testing.example and workflows (no remaining SQLite test configuration in checked files).
  • Attempted composer install and php artisan test --env=testing locally but these were blocked: composer install failed due to the container PHP version (8.5.7-dev) incompatible with locked phpoffice/phpspreadsheet constraints, and php artisan test could not run because vendor/ was not available.

Codex Task

Summary by CodeRabbit

  • Chores

    • Updated testing infrastructure to use MySQL/MariaDB instead of SQLite for improved compatibility with production environment configurations.
  • Tests

    • Updated GitHub Actions workflows and PHPUnit configurations to align with new database setup.

@InvoicePlane InvoicePlane deleted a comment from coderabbitai Bot Jun 4, 2026
@nielsdrost7

Copy link
Copy Markdown
Collaborator Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Full review finished.

@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Looking for one thing? Review this PR in Change Stack to search files, summaries, diffs, and code without losing your place.

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1bb24ba3-95f2-42a4-b59a-926b60638e72

📥 Commits

Reviewing files that changed from the base of the PR and between 8a2500c and b4d4b11.

📒 Files selected for processing (5)
  • .github/RUNNING_TESTS.md
  • .github/workflows/phpunit.yml
  • .github/workflows/quickstart.yml
  • .github/workflows/smoke.yml
  • .github/workflows/yarn-update.yml

📝 Walkthrough

Walkthrough

This PR migrates the test infrastructure from in-memory SQLite to MySQL/MariaDB, updating PHPUnit configurations, GitHub Actions workflows with database services, PHP extensions, and documentation across the entire testing pipeline.

Changes

SQLite to MySQL Testing Infrastructure

Layer / File(s) Summary
Test Configuration and Documentation
phpunit.xml, phpunit.smoke.xml, .github/RUNNING_TESTS.md
Test environment files switch from SQLite in-memory (:memory:) to MySQL with explicit DB_HOST, DB_PORT, DB_DATABASE, DB_USERNAME, and DB_PASSWORD variables. Documentation is updated to reference MySQL configuration instead of SQLite.
PHP MySQL Driver Extensions
.github/actions/setup-php-composer/action.yml, .github/workflows/composer-update.yml, .github/workflows/setup.yml, .github/workflows/smoke.yml, .github/workflows/yarn-update.yml
Composite action default and all workflow steps are updated to load pdo_mysql for MySQL connectivity and remove previous sqlite, pdo_sqlite, and mysql extensions.
CI Workflows - MySQL Service and Database Connection
.github/workflows/composer-update.yml, .github/workflows/setup.yml, .github/workflows/phpunit.yml, .github/workflows/quickstart.yml, .github/workflows/smoke.yml
All CI workflows provision a MariaDB 11 service container with port 3306 exposed and health-check configured, and inject job-level environment variables for database connection (host, port, database, username, password).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Poem

🐰 From memory's fleeting SQLite dance,
We hop to MySQL's steady stance,
Extensions configured, services awake,
A database foundation for tests to make,
In workflows coordinated, credentials in place,
The testing grounds now embrace the pace.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and specifically summarizes the main change—migrating test workflows from SQLite to MariaDB for database testing consistency.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/switch-github-actions-to-mariadb-or-mysql

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/RUNNING_TESTS.md:
- Line 173: The sentence "Uses MariaDB/MySQL via the testing database settings
in `.env.testing.example`" is misleading because PHPUnit uses DB_* values
defined in phpunit.xml and phpunit.smoke.xml; update that line to state PHPUnit
reads DB_* from those XML files (phpunit.xml/phpunit.smoke.xml) and that
`.env.testing.example` is only an example/local reference for other tooling, not
the source of PHPUnit DB configuration.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 853f3b70-1c1f-41fa-a5e5-ff173e99e39d

📥 Commits

Reviewing files that changed from the base of the PR and between ad4cb74 and 8a2500c.

📒 Files selected for processing (11)
  • .env.testing.example
  • .github/RUNNING_TESTS.md
  • .github/actions/setup-php-composer/action.yml
  • .github/workflows/composer-update.yml
  • .github/workflows/phpunit.yml
  • .github/workflows/quickstart.yml
  • .github/workflows/setup.yml
  • .github/workflows/smoke.yml
  • .github/workflows/yarn-update.yml
  • phpunit.smoke.xml
  • phpunit.xml

Comment thread .github/RUNNING_TESTS.md Outdated
claude and others added 3 commits June 6, 2026 03:17
…ysql and resolve conflicts

Resolution strategy:
- Service name: use `mariadb` (from develop, more accurate)
- MariaDB image: keep `mariadb:11` (from codex branch, newer)
- Env vars: use `MYSQL_*` (from develop, broader compatibility)
- DB_DATABASE: use `invoiceplane_test` (from develop, consistent naming)
- Healthcheck: use `mysqladmin ping --silent` (from develop, simpler)
- smoke.yml php-extensions: drop pdo_sqlite/sqlite (codex intent — MySQL-only)
- yarn-update.yml: PHP 8.4 (from develop), without pdo_sqlite
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@nielsdrost7 nielsdrost7 marked this pull request as ready for review June 6, 2026 03:21
@nielsdrost7 nielsdrost7 merged commit 6538536 into develop Jun 6, 2026
3 of 5 checks passed
@nielsdrost7 nielsdrost7 deleted the codex/switch-github-actions-to-mariadb-or-mysql branch June 6, 2026 03:22
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.

2 participants