Skip to content

[e2e] Trim low-value e2e tests, fold --only quote variants, revive orphaned rules-summary test - #8334

Merged
TomasVotruba merged 2 commits into
mainfrom
trim-low-value-e2e-tests
Aug 10, 2026
Merged

[e2e] Trim low-value e2e tests, fold --only quote variants, revive orphaned rules-summary test#8334
TomasVotruba merged 2 commits into
mainfrom
trim-low-value-e2e-tests

Conversation

@TomasVotruba

@TomasVotruba TomasVotruba commented Aug 10, 2026

Copy link
Copy Markdown
Member

Trims the e2e suite down to tests that cover real engine/CLI behaviour, and fixes one e2e test that silently never ran. 26 -> 16 CI jobs, each of which did 2 full composer install.

Removed: 7 tests that only re-assert unit-tested rule behaviour

removed already covered by
applied-rule-removed-node fixture byte-identical to applied-rule-removed-node-with-cache and -no-diffs, which both run it
invalid-paths plain path validation, no engine-specific behaviour
print-new-node AddParamBasedOnParentClassMethodRector has 22 fixtures + 8 cross-file Source/ parents in its rules-test; phpstan-container-bootstrap runs the same rule end-to-end
applied-rule-change-docblock RenameClassRector on a docblock by applied-auto-import, RemoveUselessVarTagRector by config-dist-fallback + config-file-priority. Its third rule, DowngradeAttributeToAnnotationRector, produced no change in the expected output at all
applied-rule-return-array-nodes its src/ is byte-identical to only-option/src, with the same 2 rules
different-path-over-skip-config SkippedPathsResolverTest + SkipperRectorRuleTest
no-parallel-reflection-resolver same fixture as parallel-reflection-resolver; the non-parallel path is what every rules-test runs

Fixed: rules-summary-option never ran

It was present in e2e/ but listed in no workflow, so CI never executed it. Having gone unrun, its expected output had rotted to the pre-@@ Line N @@ hunk header format:

-@@ @@
+@@ Line 4 @@

Refreshed and added to the matrix, so --rules-summary is actually covered again.

Folded: 4 --only quote variants into only-option

only-option-quote-single, -quote-single-equalnone, -quote-single-bsdouble and -quote-double-equalnone had identical rector.php, identical expected-output.diff, and all pointed at only-option/src. They differed only in the shell quoting of one option, yet each burned a separate CI job.

The runner now takes an explicit options file, so a single job covers all 5 quotings:

-$cliOptions = 'cli-options.txt';
+// allow running the same fixture with another set of CLI options, e.g. various quoting of the same option
+$cliOptionsIndex = array_search('--cli-options', $argv, true);
+$cliOptions = $cliOptionsIndex === false ? 'cli-options.txt' : $argv[$cliOptionsIndex + 1];
# the "--only" option must handle any shell quoting of the very same rule class
- run: |
    php ../e2eTestRunner.php --cli-options cli-options-quote-single.txt
    php ../e2eTestRunner.php --cli-options cli-options-quote-single-bsdouble.txt
    php ../e2eTestRunner.php --cli-options cli-options-quote-single-equalnone.txt
    php ../e2eTestRunner.php --cli-options cli-options-quote-double-equalnone.txt

All 5 quoting variants verified locally:

### cli-options.txt                              [OK] End-to-end test successfully completed
### cli-options-quote-single.txt                 [OK] End-to-end test successfully completed
### cli-options-quote-single-bsdouble.txt        [OK] End-to-end test successfully completed
### cli-options-quote-single-equalnone.txt       [OK] End-to-end test successfully completed
### cli-options-quote-double-equalnone.txt       [OK] End-to-end test successfully completed

Kept

Everything exercising the engine or CLI that cannot be unit tested: cache reuse, parallel worker escaping / reflection / skip aggregation, --no-diffs, --output-format=json, --rules-summary, --only, -c/--config, rector.dist.php resolution, bootstrapFiles(), real vendor polyfill detection, and name importing.

composer.json autoload-dev drops the no-parallel-reflection-resolver PSR-4 path; composer validate passes.

The 11 obsolete required status checks on main were removed, so PRs are not blocked waiting on jobs that no longer exist.

…gle job

Drop 3 e2e tests that only re-assert rule behaviour already covered by unit tests:

* applied-rule-removed-node - fixture is byte-identical to
  applied-rule-removed-node-with-cache and applied-rule-removed-node-no-diffs,
  which both already run it
* invalid-paths - covered by path validation, no engine specific behaviour
* print-new-node - AddParamBasedOnParentClassMethodRector has 22 fixtures and 8
  cross-file parents in its rules-test; phpstan-container-bootstrap covers the
  same rule end-to-end

Fold the 4 "--only" quote variants into the only-option test. They shared the
same config and the same expected output, and differed only in the shell
quoting of a single option, yet each ran as its own CI job with 2 full composer
installs. The e2e runner now accepts "--cli-options <file>", so one job runs
all 5 quoting variants.

E2E CI jobs: 26 -> 19.
…ry-option

* applied-rule-change-docblock - RenameClassRector on a docblock is covered by
  applied-auto-import, RemoveUselessVarTagRector by config-dist-fallback and
  config-file-priority; DowngradeAttributeToAnnotationRector produced no change
  in its expected output at all
* applied-rule-return-array-nodes - its src/ is byte-identical to
  only-option/src, with the same 2 rules
* different-path-over-skip-config - covered by SkippedPathsResolverTest and
  SkipperRectorRuleTest
* no-parallel-reflection-resolver - same fixture as parallel-reflection-resolver,
  and the non-parallel path is what every rules-test runs

Found while auditing: rules-summary-option was in no workflow at all, so it
never ran and its expected output had rotted to the pre "@@ Line N @@" hunk
header format. Refreshed and added to the matrix, so "--rules-summary" is
covered again.
@TomasVotruba TomasVotruba changed the title [e2e] Remove low-value e2e tests, fold --only quote variants into single job [e2e] Trim low-value e2e tests, fold --only quote variants, revive orphaned rules-summary test Aug 10, 2026
@TomasVotruba
TomasVotruba merged commit 8c872db into main Aug 10, 2026
54 checks passed
@TomasVotruba
TomasVotruba deleted the trim-low-value-e2e-tests branch August 10, 2026 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant