Updated: Comment #0
Committers: amateescu should get credit on this issue.
Problem/Motivation
In #2125633: PHPUnit tests cannot be rerun from Simpletest UI the simpletest re-run submit handler was changed to use the API, and not just call other form's submit handlers directly.
But FormBuilder::submitForm() sets $form_state['programmed'] to TRUE, and that value is checked when deciding whether to show a progressive batch or not.
Proposed resolution
We have two options:
- Revert the fix, and document why it is a special case.
- Introduce a new $form_state flag to force the batch to work despite being programmed.
Remaining tasks
Pick an approach (I'm going to try #2 first)
User interface changes
Re-running a test in the UI will show a progress bar and display the duration of the test like it used to.
API changes
Possible API addition
Comment | File | Size | Author |
---|---|---|---|
#1 | simpletest-2140505-1.patch | 2.62 KB | tim.plunkett |
Comments
Comment #1
tim.plunkettWell this is option #1, for now.
Comment #2
amateescu CreditAttribution: amateescu commentedHeey, you stole my patch :D
Comment #3
tim.plunkettComment #4
BerdirA different problem, but has anyone seen the problem where it always displays a test execution of 0 seconds? I have that on some systems, no idea why.
Comment #5
amateescu CreditAttribution: amateescu commentedThis patch fixes it.
Comment #6
dawehnerI was so sure that this was a trick of tim to force people to write proper unit tests instead.
Comment #7
tim.plunkettIssue #2140505 by amateescu, tim.plunkett: Re-running a simpletest no longer displays the batch progress or duration.
Comment #8
chx CreditAttribution: chx commented*blink* what has happened to form API here? How, if at all, does whatever happened here affect other modules?
Comment #9
chx CreditAttribution: chx commentedTo elaborate:
drupal_form_submit()
did a$form_state['programmed'] = TRUE;
in D7, that's for sure. But I am not entirely sure how simpletest got to the point where it calls the equivalent ofdrupal_form_submit
or why.Edit: and whether that reason applies to other scenarios too.
Comment #10
webchickI had much the same questions as chx. Basically, what's happening here is SimpleTest is programmatically submitting forms behind the scenes and this was never compatible with Batch API (and is documented as such). However, Tim hadn't read this documentation when doing the conversion in #2125633: PHPUnit tests cannot be rerun from Simpletest UI and so accidentally introduced this bug. This is a partial revert of that patch to restore the UI elements of batch API in this part.
Committed and pushed to 8.x. Thanks!