-
Notifications
You must be signed in to change notification settings - Fork 2k
Dev: Ensure tests are run in random #9968
Copy link
Copy link
Open
Labels
devhelp wantedMore help is needed for the proper resolution of an issue or pull requestMore help is needed for the proper resolution of an issue or pull requesttestingPull requests that changes tests onlyPull requests that changes tests only
Metadata
Metadata
Assignees
Labels
devhelp wantedMore help is needed for the proper resolution of an issue or pull requestMore help is needed for the proper resolution of an issue or pull requesttestingPull requests that changes tests onlyPull requests that changes tests only
Type
Fields
Give feedbackNo fields configured for Task.
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.
CacheTest#9967Securitytest fail by itself #9969