Test hardening#22799
Conversation
|
@LamentXU123 I noticed your like and since you own Aside: since I didn't built with all extensions |
|
Is the \PHP_EOF really necessary? I think it just is silly in the tests. Just PHP_EOF should be fine. |
Nah. Picked it out of habit. No strong opinion; can adjust to whatever we decide. |
|
I actually think this change is trivial. I don't have strong opinions on this (I am on the fence of this huge code churn) so might need to wait for other's opinion. |
|
nit: any reasons for targeting 8.5? |
Sometimes not avoidable to move things forward. :) Personally, I think it adds enough value to be justified. Flipping
Nope. Could be anything. Which one you want? |
Should be targeting master. (hint: convert this to draft when you are changing the base to avoid accidentally request a review from everyone) |
Given that you mentioned code churn, I am wondering if targeting master is the right call? Like, when someone diffs 8.6 against 8.5 this would all be extra in the diff. Why not 8.5 and then upmerge to master? Madee a full run over all tests, merging it up would have only 37 merge conflicts on a total of 2424 affected files. After the upmerge a separate master targeted run would only affect 83 new files. Moderate, no? |
|
Changed to |
Yes. This is a refactoring, which is not acceptable in released branches. To reduce churn, can the formatter also keep the type of quotes for the colon in cases where the general format is already as expected? The changes in ext/uri provide no value to improve the strength of the actual assertion. Phrased differently: If the change to the test code does not result in a change in the EXPECT section, then drop the change to the test code. |
Will target master! (surprised that this applies to tests)
I evaluated this before. Not worth the extra complexity and inconsistency, IMO. Why: your modules are already so clean that Though, there are other cases like where output is fixed in try/catch that not actually throw. These are risk free to fix, I did so, and I think we should. Why: contributor comes to an existing test file to add test, copies existing test, style is wrong, you review and flag it. You wasted time, contributor wasted time. Or it's missed and merged. Both avoidable. Having one consistency sweep will decrease this "risk". Even code owners have recent PRs that do not follow the regression-safe pattern. When -- after this here would be merged -- everyone sees everywhere the exact same pattern it will naturally be be better adapted. The same would of course be possible if we would make this part of the CI; but you didn't seem very bullish on that? Assumed we would do what you say, here some stats: 545 total files less; 243 are one lines changes, 334 out of it are <= 2 line diffs, 411 are <= 5 line diffs. |
Test files sweep to make exception assertions more robust, and slightly unify style.
Specifically:
Target format:
Approach:
Rewrites are handled by this deterministic helper for conservative and safe, automated replacements. All exception assertion "flavours" from
php-srcwere extracted, and the tests where they were found promoted to source fixtures. Rules were then ran against the fixtures, the results manually reviewed, and promoted to target fixtures. All replacement rules are tested against the source and target fixtures. The actual "fixing" works as follows:catchblocks.run-tests.php; skipped or already failing tests are not rewritten.run-tests.php.Modules & Commits
Changelog:
ext/intlandext/phar\PHP_EOL->PHP_EOLPoC, marked as draft for now, and in coordination with Tim
for now only applied to.ext/randomandext/uri