Skip to content

Fix test suite and run it in CI - #116

Merged
jasonvarga merged 4 commits into
masterfrom
test-suite
Oct 9, 2026
Merged

jasonvarga merged 4 commits into
masterfrom
test-suite

Conversation

@jasonvarga

@jasonvarga jasonvarga commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Running phpunit did nothing because there was no PHPUnit config, and there was no workflow running the tests.

  • Adds phpunit.xml.dist.
  • Updates the integration tests, which had drifted from NewCommand: the command now runs non-interactively (CommandTester defaulted to interactive, which tried to use a TTY), and failures are asserted via exit code 1 since the command catches RuntimeException instead of throwing. Also dropped the DB_DATABASE assertion since the database isn't configured in non-interactive mode.
  • Adds a Tests workflow running on PHP 8.2–8.5 with prefer-lowest and prefer-stable, plus a PHP tests aggregate job (matching the CMS repo) that can be used as the single required check.
  • Ignores .phpunit.result.cache.

Running the suite on Linux in CI surfaced a real bug: --no-ansi (when output isn't decorated) and --quiet were appended to every command except chmod and git, including the rm -rf / rd /s /q used by --force. GNU rm rejects unknown options, so statamic new --force failed on Linux when piped, in CI, or with -q. These commands are now skipped, consistent with the Laravel installer's fix in laravel/installer#437.

jasonvarga and others added 4 commits October 9, 2026 14:16
Add a PHPUnit config so the suite runs, and update the integration tests to run the command non-interactively and assert on exit codes instead of exceptions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GNU rm rejects unknown options, so --force failed on Linux whenever output wasn't decorated or --quiet was used.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jasonvarga
jasonvarga merged commit a8f2caa into master Oct 9, 2026
13 checks passed
@jasonvarga
jasonvarga deleted the test-suite branch October 9, 2026 18:43
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