Skip to content

Released version 2.7.0

Latest

Choose a tag to compare

@dg dg released this 26 Oct 22:25
· 4 commits to master since this release

Tester 2.7 makes itself at home in CI: failures land right in the pull request diff, hanging tests no longer hang the pipeline, and slow tests have nowhere to hide.

✨ New Features

  • GitHub Actions annotations – the new -o github output marks failed tests directly in the PR diff view, and it switches on automatically when Tester runs on GitHub Actions, so there is nothing to configure
  • Test time limit – --timeout <seconds> sets a limit for every test, @timeout overrides it per file; a test that runs over is terminated and reported as a failure instead of blocking the whole run
  • --slowest – prints the 10 (or as many as you ask for) slowest tests after the run, so you know exactly where the time goes
  • #[DataProvider] and #[Throws] attributes – TestCase methods can now use PHP attributes instead of docblock annotations; the annotations keep working
  • HttpAssert::fetch() accepts a timeout (30 seconds by default), so an unresponsive server can't stall a test
  • JUnit reports now include test durations, for failed and skipped tests as well
  • Faster cold start – TestCase methods are discovered in parallel with other tests, and each test file's annotations are parsed only once

πŸ’₯ Breaking Changes

  • PHP 8.1 is now the minimum required version
  • Environment::skip(), Environment::exit() and TestCase::skip() now return never; a subclass overriding them must change its return type too
  • The tester command exits with a non-zero code when it finds no tests, so a mistyped path no longer passes in CI
  • A TestCase data provider that returns no data sets is now an error, just like an empty file-level provider
  • Assertion type 'integer' in Assert::type() is deprecated, use 'int'

πŸ› Bug Fixes

  • TAP and JUnit outputs no longer contain ANSI color sequences
  • Environment::lock() reports an error when the lock directory does not exist