Problem/Motivation
run-tests.sh is pretty much the single most important piece of code in the Drupal QA process.
It's basically impossible to search for the string 'run-tests.sh' so it's difficult to be a dev who wants to work on it. :-)
This issue is one to use as a parent if you make an issue about run-tests.sh, in order to overcome the lack of searchability.
I've also taken the liberty of adding an issue tag for run-tests.sh, which might also help people find their way around.
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Comments
Comment #3
neclimdulIs this the place to voice the opinion that as we move to phpunit, run-tests.sh becomes a drupalci artifact that probably shouldn't be in core?
Comment #4
dawehnerThat's a valid question. Let's assume we don't have any simpletests anymore, would we need run-tests.sh to be able to run anything beside an entire testsuite (Kernel, Functional etc.)?
Basically run-tests.sh could end up with a wrapper which catches fatals inside phpunit itself and expose that to drupalci.
Comment #5
mile23See #2750461-28: Remove Simpletest UI because we don't want to maintain a graphical test runner
Comment #6
neclimdulre #4yeah pretty much. something something parallel tests as well maybe.
re #5your link in that that issue is why I'm here. I'm all for fixing up run-test.sh, the question clearly wasn't relevant to the Web UI discussion though. It is relevant to deciding how we look at the process of cleaning up run-tests.sh though. e.g. what is our audience.
Comment #7
mile23We tell people to run run-tests.sh when they say 'it passed locally..'
We also use run-tests.sh to isolate phpunit fatals.
drupalci is tooled to use run-tests.sh, but we can modify that as needed, because drupalci is more flexible than it looks.
If we take away the simpletest UI, then the onus is on run-tests.sh to show results of test runs.
I was trying to figure out the best set of small steps to take. I think refactoring existing functionality to make it more maintainable also makes it more flexible for us to make more major decisions. So for instance if we were to take all the PHPUnit runner stuff from simpletest module and move it to a class/library/component, that would aid us in either keeping run-tests.sh and maintaining it, or eventually writing or adapting a better runner and removing run-tests.sh. (That's this one: #2641632: Refactor simpletest's *_phpunit_*() (and junit) functions etc. to a class, deprecate which isn't really a run-test.sh improvement, though it does touch it.)
There are plenty of other examples of small improvements we can make that knock loose some cobwebs to make it easier to change in any direction later.
Because as a community we don't seem to be able to decide what to do, so we're left with an unmaintainable pile of code, which prevents us from moving forward on anything, which keeps us from making decisions. :-)
Comment #11
mile23New child: #2905007: Allow run-tests.sh to report skipped/incomplete PHPUnit tests
Comment #12
neclimdul"We also use run-tests.sh to isolate phpunit fatals." Maybe its because I'm using php 7 exclusively now but I couldn't find a fatal error that wasn't handled perfectly by phpunit.
Comment #13
mile23If you have three test classes and one of them passes and one crashes, then phpunit won't be able to tell you which one passed and which one didn't run. You'll have an error log but not a report.
Comment #14
neclimdulI'm saying that is not the case. The junit output correctly documents the fatal error.
Comment #15
mile23'Crashes' as in PHPUnit fatals, not that the test reports an error. run-tests.sh works around it by making a template fail report: #2560643: Fatal PHPUnit tests are not always reported as failure
Comment #16
neclimdulI think currently that just double reports failures.
Comment #18
mile23Want a coverage report from run-tests.sh? #2974911: Allow run-tests.sh to generate coverage reports
Comment #20
andypost