Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run test suite with executionOrder="random" #3449

Closed
Majkl578 opened this issue Feb 6, 2019 · 3 comments
Closed

Run test suite with executionOrder="random" #3449

Majkl578 opened this issue Feb 6, 2019 · 3 comments

Comments

@Majkl578
Copy link
Contributor

Majkl578 commented Feb 6, 2019

Triggered by https://twitter.com/phpdudeaz/status/1093176110047584257.

My main concern with this approach is determinism. I know it's the sole point of this idea, but debugging these failures locally (or getting them randomly in PRs) is terrifying.
Therefore it may be a good idea to run tests randomly only when if: NOT type = pr.

I'm not sure whether PHPUnit provides seed used for the execution that could later be used for reproducible failure. If not, adding such feature into PHPUnit may be a pre-requisite.

Edit: PHPUnit does provide a way to set the seed, as well as printing it as part of output, but only in verbose mode (sebastianbergmann/phpunit#3515).

@Majkl578 Majkl578 changed the title [WIP] Run test suite with executionOrder="random" Run test suite with executionOrder="random" Feb 6, 2019
@morozov
Copy link
Member

morozov commented Feb 6, 2019

In general, I agree that the random order should be only used on release branches, not in PRs. A contributor of a given change doesn't have to solve unrelated issues caused by hidden dependencies in existing tests.

On the other hand, a new PR should be prevented from introducing those dependencies. Therefore, once the tests get stable enough on feature branches, we can try enabling random order on PRs as well.

@morozov
Copy link
Member

morozov commented Jul 26, 2021

I took an initial stab at it in #4731. Since there doesn't seem to be a way to make failures optional on GitHub, running tests in random order on CI doesn't seem feasible.

@morozov morozov closed this as completed Jul 26, 2021
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants