Review main Merged

71890[TASK] Do not cache phpunit results

Christian Kuhn CR +2 V +2 Easy +4 −1 updated 10/19/21, 16:28

Commit message

phpunit has a default-enabled feature to write test
result to a cache file. phpunit however has no option
to only run failed tests since those tests may have
an @depends annatation and its hard for phpunit to
sort this out. The cache file is of rather little
use and mostly only pollutes the filesystem in real
life.

When developing core tests, developer typically
use a filter or a path constraint to execute a sub set
of tests only.

Additionally, with multiple phpunit .xml files in
one directory, the cache file overrides itself when
different suites are executed.

The patch disables that cache file by default in
phpunit xml files.

If anyone still wants to run the test suite and have
tests that failed executed first, the option can be
enabled on a per-use basis, example using runTests.sh:

  # Run suite and create cache file
  Build/Scripts/runTests.sh -e '--cache-result'
  # Run tests that failed first and update cache file
  Build/Scripts/runTests.sh -e '--cache-result --order-by=depends,defect'

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
    • Wouter Wolters +1
    • Stefan Bürk +1
  • Verified V +2 Done
    • Christian Kuhn +2
    • Wouter Wolters +1
    • Stefan Bürk +1
    • core-ci +1 CI

Issues 1

Files 5

Review log 911

  1. Christian Kuhn uploaded patch set 1 10/19/21, 15:59

  2. Mathias Brodala commented on patch set 1 10/19/21, 16:02

    .gitignore:37

    IMO this should be moved to the top without the /Build/phpunit/ prefix. This way this file will never end up in Git accidentally.
  3. Christian Kuhn updated the commit message in patch set 2 10/19/21, 16:02

  4. Christian Kuhn commented on patch set 2 10/19/21, 16:05

    .gitignore:37 Reply

    phpunit writes this file parallel to the .xml file by default. Since probably 'nobody' uses the mentioned commands of the commit message anyway (there is simply not much benefit), I decided to drop the .gitignore entry, too. *if* anyone pushed a patch including that file, we should see that in the review.
  5. Christian Kuhn commented on patch set 2 10/19/21, 16:06

    .gitignore:37 Reply

    ah, and running phpunit without option -c to point to the .xml file does not make sense for monorepo, either. and we have runTests.sh to take care of this. So imho fine to not have .gitignore's for this file.
  6. core-ci voted on patch set 1 V +1 10/19/21, 16:14 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/18329

  7. Stefan Bürk commented on patch set 2 V +1 CR +1 10/19/21, 16:15

    .gitignore:37 Reply

    Ack.
  8. core-ci voted on patch set 2 V +1 10/19/21, 16:17 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/18330

  9. Wouter Wolters voted on patch set 2 V +1 CR +1 10/19/21, 16:27

  10. Christian Kuhn voted on patch set 2 V +2 CR +2 10/19/21, 16:28

  11. Christian Kuhn merged patch set 3 10/19/21, 16:28