Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
As we know, the phpunit <-> simpletest integration is problematic.
Let's start to plan how we can use the phpunit test runner only.
Proposed resolution
First step: Don't run the tests in the UI but show just a code you can use in your shell to run it.
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#3 | 2566767-3.patch | 3.8 KB | dawehner |
#3 | Screen Shot 2015-09-12 at 10.34.35.png | 74.25 KB | dawehner |
Comments
Comment #2
jibran+1000 to this.
Comment #3
dawehnerSee screenshot.
Comment #6
MattA CreditAttribution: MattA commentedThat command seems unlikely to work on every supported system (especially for those that use Windows). Maybe just provide a link to a help page on d.o?
Comment #7
dawehner@MattA
Oh well, feel free to create a follow up to produce a different output for windows machines. I don't care much too be honest. There are ways to run phpunit tests on windows, this is for sure.
Comment #10
MattA CreditAttribution: MattA commentedYeah, Windows is irrelevant to the point. I'm saying that a link would probably be better at providing tailored, relevant information for those interested in running tests, rather than a specific command that may not even work. Even if it were simply to the testing chapter of the Drupal developer guide that would provide:
Comment #11
neclimdulI wouldn't say irrelevant. A good number of people use it for different reasons. We could probably do windows people a favor and replace in DIRECTORY_SEPARATOR
http://php.net/manual/en/dir.constants.php
Comment #12
dawehnerWell, I would never argue its irrelevant, I just don't care about it. Feel free to work on it, seems pretty tricky anyway :)
Comment #13
david_garcia CreditAttribution: david_garcia commentedCan someone expand on this? I really appreciate being able to run tests from the UI.
Comment #14
david_garcia CreditAttribution: david_garcia commentedComment #15
cilefen CreditAttribution: cilefen commentedComment #16
Mile23We could fix that. :-) #2641632: Refactor simpletest's *_phpunit_*() (and junit) functions etc. to a class, deprecate
Comment #17
Mile23Better than the refactoring issue: #2608532: Simpletest UI munges PHPUnit-based test output
Also fix test discovery of phpunit-based tests: #2427191: Test-runner ignores @group annotations for PHPUnit-based tests in modules.
Comment #19
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedNow that #2575725: Run PHPunit tests one at a time via UI to avoid exception when selecting too many has been completed, and the test results are displayed in a better way, maybe this issue is no longer relevant?
Comment #20
dawehner@jonathan1055
I still think that running phpunit via phpunit is the way to go, so IMHO its better to encourage people to learn the tools properly.
Comment #21
Mile23@dawehner: If we allow running tests at all through the UI, then we should allow running all tests. Then we have two useful tools instead of one.
Comment #22
klausiRelated: #2750461: Remove Simpletest UI because we don't want to maintain a graphical test runner
Comment #23
dawehner@mile23
Everytime you don't use batch you potentially have an much easier time to figure out why something fails. This is for me mostly about teaching good practises and well this takes time.
Comment #24
Mile23#2401797: Introduce a batch builder class to make the batch API easier to use looks pretty good... :-)
Comment #32
quietone CreditAttribution: quietone as a volunteer commentedTriaging issues in simpletest.module as part of the Bug Smash Initiative to determine if they should be in the Simpletest Project or core.
This looks like it belongs in the Simpletest project.