codeigniter4/CodeIgniter4

Dev: Ensure tests are run in random

Open

#9,968 建立於 2026年2月20日

在 GitHub 查看
 (4 留言) (1 反應) (0 負責人)PHP (1,707 fork)batch import
devhelp wantedtesting

倉庫指標

Star
 (4,492 star)
PR 合併指標
 (平均合併 4天 15小時) (30 天內合併 68 個 PR)

描述

PHP Version

8.5.0

CodeIgniter4 Version

4.7.1-dev

Per ChatGPT, tests need to run in random to enjoy the following benefits:

✔️ It reveals hidden dependencies ✔️ Forces true test isolation ✔️ Prevents flaky, misleading test results ✔️ Makes your test suite production-realistic

This issue has been initially tackled by #7717, but due to other complications it didn't fare well. As this is not a fairly easy task, I'm proposing we do it on pieces. Currently, our test suite runs in default order but should be random at some point (i.e., executionOrder="random").

Here's the plan, instead of one big PR changing all tests, we can do it by component (HTTP, Cache, Database, etc.). Then, after all tests run green on randomised testing, we set executionOrder in phpunit.xml to "random".

Please reference this issue for any PRs addressing pieces of this.

  • API: #9983
  • AutoReview: #10073
  • Autoloader: #10073
  • Cache
  • CLI:
    • #9998
    • #10014
  • Commands
  • Config
  • Cookie: #10073
  • Database
  • DataCaster
  • DataConverter
  • Debug
  • Email
  • Encryption
  • Entity
  • Events: #10073
  • Files: #10073
  • Filters
  • Format: #10073
  • Helpers
  • Honeypot
  • HotReloader: #10073
  • HTTP: #10372
  • I18n
  • Images
  • Language: #10073
  • Log: #10073
  • Pager: #10073
  • Publisher: #10073
  • RESTful: #10073
  • Router
    • #9967
  • Security
    • #9969
    • #10073
  • Session
  • Test
  • Throttle: #10073
  • Typography: #10073
  • Validation
  • View: #10073

貢獻者指南