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.
Scope:
All tests not deemed out-of-scope
Out of scope followup issue:#2887134: Convert web tests to browser tests for taxonomy module Part -2
- TaxonomyTermIndentationTest this should be converted to a javascript test
- TermAutocompleteTest should be converted to a javascript test
- \Drupal\Tests\taxonomy\Functional\TermTest::testTermReorder should be split of and converted to a javascript test
- TermTranslationTest needs AssertBreadcrumbTrait to be converted
- Drupal\taxonomy\Tests\RssTest
Comment | File | Size | Author |
---|---|---|---|
#36 | 2870459-34.patch | 27.18 KB | naveenvalecha |
#34 | interdiff-2870459-30-34.txt | 1.16 KB | naveenvalecha |
Comments
Comment #2
michielnugter CreditAttribution: michielnugter as a volunteer and at Synetic commentedComment #3
michielnugter CreditAttribution: michielnugter as a volunteer and at Synetic commentedComment #4
michielnugter CreditAttribution: michielnugter as a volunteer and at Synetic commentedUpdated the scope for a small change in scope so we have less issues this one is postponed on.
Left views in as a dependency because of the huge amount of tests here.
If you feel like giving if a go, please don't wait and start with all the non-views tests :)
Comment #5
michielnugter CreditAttribution: michielnugter as a volunteer and at Synetic commentedComment #6
dawehnerComment #7
jofitz CreditAttribution: jofitz at ComputerMinds commentedMoved the non-views tests.
Comment #8
claudiu.cristeaQuick review:
Again, we should use either "in Drupal 9.0.x" or "before Drupal 9.0.0". Also the "Use" word should go on the 1st line, even I know it's not nice, but we have this rule at https://www.drupal.org/docs/develop/coding-standards/api-documentation-a...
I wonder why these are public methods? I don't say they should not, I didn't investigate the matter. If it's not necessary let's keep the protected.
Due to their nature, can be also randomString(), no?
Comment #10
zahord CreditAttribution: zahord as a volunteer and at Skilld commentedHi all!
I just created a patch of the taxonomy module for the BrowserTestBase.
Comment #11
andypostComment #13
dawehnerNote: For backward compability reasons we should keep this file around
Note: We just add the
@deprecated
bits to baee classes, not individual test classesComment #14
zahord CreditAttribution: zahord as a volunteer and at Skilld commentedHi,
I did the changes to maintain the file TaxonomyTestBase.php in the old location and update the text with the @deprecated, additionally I updated to fix issues with the files TaxonomyGlossaryTest, PrepareUninstallTest and EntityReferenceFieldAttributesTest according the last test result.
Comment #15
zahord CreditAttribution: zahord as a volunteer and at Skilld commentedComment #16
andypostUse
to make patch smaller please
Comment #18
dawehnerI agree with @andypost. Otherwise the patch is basically impossible to review :) See https://www.drupal.org/documentation/git/configure for more information about this.
Comment #19
LendudeBit of a cleanup and some fixes but very much a work in progress.
\Drupal\taxonomy\Tests\TermAutocompleteTest should be out of scope for now, it needs to be converted to a javascript test.
Comment #20
Lendude.....
Comment #22
Lendude\Drupal\Tests\taxonomy\Functional\TermTest::testTermReorder and TaxonomyTermIndentationTest both use drupalpostform to set values on hidden fields, which Mink doesn't allow you to do (users can't do it, so mink won't do it). Since in both instances this is done to emulate javascript behaviour, they should be done in a javascript test.
TermTranslationTest needs AssertBreadcrumbTrait to be converted first
VocabularyUiTest uses assertNoTitle which doesn't exist on BrowserTestBase, but .... the assertNoTitle comes right after an assertTitle, so the assertNoTitle is completely redundant, it will never fail if the previous asserting passes (and in PHPUnit will never be run if the previous assertion failed). So I think we can just take it out, it doesn't do anything.
All Views tests still need to be done, but lets see if this is green.
Comment #23
dawehner+1
Comment #25
naveenvalechaFixing the failures of #22.
Created followup issue for the out-of-scope items of this issue #2887102: Convert web tests to browser tests for taxonomy module Part-2
//Naveen
Comment #26
Lendude@naveenvalecha try adding --find-copies to your git diff, it makes the patches smaller when deprecating and copying the traits.
Looks good so far, back to needs work for the Views tests.
Comment #27
naveenvalechaHere we go with Views Tests as well.
Comment #28
naveenvalechaAdded followup issue for the out of the scope items. #2887134: Convert web tests to browser tests for taxonomy module Part -2
//Naveen
Comment #30
naveenvalechaHere we go with fixes.
//Naveen
Comment #31
Lendude@naveenvalecha thanks so much!
The patch looks good.
Checked the files that are left: 5 tests left and these are all marked for a follow up.
Comment #32
larowlanI ran these locally using just the bare
phpunit -c core --filter=taxonomy
Got one deprecation notice
Is that expected given the planned followups?
I think it indicates that something in our phpunit based tests is using the simpletest - which might point to something we missed?
Comment #33
Lendude@larowlan++
There are two tests in the RDF module that are in the PHPUnit namespace but extend WebTestBase version of TaxonomyTestBase.
\Drupal\Tests\rdf\Functional\EntityReferenceFieldAttributesTest
\Drupal\Tests\rdf\Functional\TaxonomyAttributesTest
Those we need to fix and extend from the BrowserTestBase base class because it leads to weirdness like you describe. @Mile23 figured out what was happening here: #2876145: ConfigTranslationViewListUiTest is a WTB test in the Functional namespace
Comment #34
naveenvalecha#32,
Good catch :) +1
Addressed #33 in the same patch.
//Naveen
Comment #36
naveenvalechaHere's the patch. local branch needs rebasing before patch generation.
Comment #37
Lendude@naveenvalecha thanks for the addition. This should fix it.
I can't seem to reproduce the fail in #32 in my setup. @larowlan could you check again with the patch in #36 or @naveenvalecha did you manage to reproduce #32 and seen it pass with #36?
Comment #38
naveenvalechaI can't able to reproduce #32 on my local setup, but wouldn't able to reproduce it on my local.
//Naveen
Comment #39
naveenvalechaSetting it to RTBC so that we could get the review from @larowlan on #32
//Naveen
Comment #40
larowlanWill rerun locally
Comment #41
larowlanFixed - no deprecation error now - thanks
Comment #42
larowlanComment #43
larowlanRan the tests again locally, and triggered full bot run against 8.3 to evaluate backport.
For posterity, I was using
./drupal/vendor/bin/phpunit -c ./drupal/core --filter=taxonomy
, not../vendor/bin/phpunit modules/taxonomy/tests/src
, guessing that is why you weren't able to reproduce - that matches 103 tests, not 101.Committed as c4b5c0d and pushed to 8.4.x.
Comment #45
larowlanCommitted as ccbd1e1 and pushed to 8.3.x.
Comment #47
naveenvalechaThanks, Lee!
Updated #2735005: Convert all Simpletest web tests to BrowserTestBase (or UnitTestBase/KernelTestBase) and added #2887134: Convert web tests to browser tests for taxonomy module Part -2 to the list
Comment #48
dawehnerThank you @larowlan!
Comment #49
BerdirThis added the new TaxonomyTestTrait in the functional test namespace but I was using it in a kernel test in token.module, a bit weird to include it there now from a kernel test. AFAIK we can't have classes outside of one of the defined test suite locations, we have to put it somewhere I guess, maybe we should have a place to pust test "API" things like this trait?