See #2735005: Convert all Simpletest web tests to BrowserTestBase (or UnitTestBase/KernelTestBase)
Scope:
- All tests are in scope
| Comment | File | Size | Author |
|---|---|---|---|
| #20 | 2867304-20.patch | 10.02 KB | maxocub |
| #18 | 2867304-18.patch | 13.4 KB | dawehner |
| #15 | 2867304-15.patch | 16.63 KB | jofitz |
| #15 | interdiff-13-15.txt | 1.49 KB | jofitz |
| #13 | interdiff-10-13.txt | 8.84 KB | maxocub |
Comments
Comment #2
quietone commentedThis patch has the conversions except for translatePostValues(). Therefore, not running the tests. Is there a 'replacement' for translatePostValues() ?
Comment #3
michielnugter commentedComment #4
maxocub commentedI don't see any replacement for translatePostValues() and it seems to be only used in two other tests.
We could move it to BrowserTestBase or just do the transformation directly in the test.
I did try moving it to the MigrateUpgradeTestBase, but then another problem arose:
This seems to be failing because it doesn't wait until the upgrade is done before looking for that string, so it still on the progress page and it fails.
I don't know how to wait for an active progress to be done in BrowserTestBase, I'll look into that.
Comment #5
maxocub commentedThis is postponed on #2862885: Batch: Convert system functional tests to phpunit.
We will need the waitBatchProccessToEnd() method that's being implemented there.
Comment #6
maxocub commentedNow that #2862885: Batch: Convert system functional tests to phpunit is in, let's see if this is green.
I moved translatePostValues() into BrowserTestBase since a few other tests will probably be using it.
Comment #7
michielnugter commentedPlease use
-M --find-copieswith git diff for rolling patches, that will detect moves and copies and make the patch better reviewable. I attached a directly rerolled patch and will review from there.Comment #8
michielnugter commentedI don't think that adding this to the BrowserTestBase class is a good idea for now. We want to keep the magic methods down on the base class and promote testing like a user (i.e. directly manipulating the fields themselves).
As the Simpletest version is only used twice in core right now I want to hold off on adding it to BrowserTestBase. It really should be fine in MigrateUpgradeTestBase,
it really comes down to the same thing for the tests themselves.
Whoops, now I made a mess of it ;) Ignore that one please! New patch attached (same as 6-7 but without the test.html..).
Comment #9
michielnugter commentedComment #10
maxocub commented@michielnugter: Thanks for the git diff tip, it's much easier to read the patch now indeed.
Comment #11
maxocub commentedBlank line missing.
Comment #12
dawehnerNote: We should keep the old base classes around. These then should get a
@trigger_errorstatement, have a look at https://www.drupal.org/files/issues/2870453-21.patch for an example.Comment #13
maxocub commentedAdded back the old base class with the @trigger_error and @deprecated.
Also corrected the missing blank line.
Comment #14
lendude@maxocub thanks so much for working on this!
couple of nits:
No need for the @see, git blame will lead anybody interested here anyway
Over 80 characters long, just moving 'Use' to the first line of the @deprecated statement should fix that.
And just wondering, do we consider the image files to be internal? If contrib is using these files to test migrations, those test will be broken now, but not sure how we deprecate an image file.....
I'm fine with moving them, but I'm not as BC conscious as some others
Comment #15
jofitzFixed @Lendude's nits from #14.
Comment #16
dawehnerJust out of curiousity, do you understand why git doesn't pick up this file as being renamed?
Comment #17
jofitzMigrateUpgradeTestBase.php is not picked up as being renamed because the original remains and is deprecated while a copy (new file) is created in the new location.
Comment #18
dawehnerWell, git should still be able to deal with that. Here is what I get as part of my git configuration ...
I guess this bit of configuration:
makes the difference?
Comment #20
maxocub commented@dawehner: Yes, that's a better diff. Here's a new patch without the unrelated changes though.
Comment #21
dawehnerThanks a ton @maxocub!
Comment #23
catchCommitted/pushed to 8.4.x and cherry-picked to 8.3.x. Thanks!
Comment #26
maxocub commented