Closed (fixed)
Project:
Drupal core
Version:
8.5.x-dev
Component:
block.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
24 Mar 2017 at 12:19 UTC
Updated:
19 Sep 2017 at 21:15 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
jofitzComment #4
michielnugter commentedComment #5
zviryatko commentedComment #6
zviryatko commentedComment #8
michielnugter commented@zviryatko, @Jo Fitzgerald:
Thanks for the start on this issue!
Aside from the CI aborting the following tests failed:
06:50:43 Drupal\Tests\block\Functional\BlockSystemBrandingTest 0 passes 1 fails
06:51:42 Drupal\Tests\block\Functional\BlockCacheTest 0 passes 1 fails
Code review:
Please add the correct documentation indicating the type of variable.
Let's wait untill #2795085: Add assertNoCacheTag to assertLegacyTrait lands and not add the method here.
It's ok to keep it here to get the tests to pass but please note it when posting a patch so everyone know's the intent is to leave it out :)
Comment #9
zviryatko commented@michielnugter, also I met problem when I extend BrowserTestBase two another test cases fails, but when extend JavascriptTestBase it's ok. That fails is related to block cache and \Drupal::state(), since block plugins from block_test module is depend on \Drupal::state() object, but for BrowserTestBase probably entire page is cached, but still not understand why for JavascriptTestBase it's ok.
Another problem that I met related to cache context, when BlockRepository gets all block per region and check access, the Access object has own cache tags/context/max-age, so BlockCacheTest fails because blockAccess not respect the block cache settings. I can't describe more now, all data on my home pc, I can provide you more info later if needed.
Comment #10
michielnugter commented@zviryatko
Not sure either why it would work with the conversion, maybe it has something to do with JavascriptTestBase using an actual browser instead of a simulated one. Let me know which tests and I might be able to help you out.
Not sure on that one, I'm not very deeply familiar with cache tags yet. Let me know which tests are failing on this and I might be able to figure it out, always fun to dive deep into Drupal core :)
Comment #11
naveenvalechaAdding #2795085: Add assertNoCacheTag to assertLegacyTrait as a blocker for this issue.
//Naveen
Comment #12
goz commentedComment #13
dawehnerThis is in, yeah!
Comment #14
dawehnerTests aren't passing right now ...
Comment #15
nlisgo commentedComment #16
nlisgo commentedComment #18
manuel garcia commentedFor now just getting the patch up to speed, removing
AssertLegacyTrait::assertNoCacheTag()from this patch, as it was already added in #2795085: Add assertNoCacheTag to assertLegacyTraitComment #20
lendudeTook care of a fail, don't know why CI times out, something in #18 is hanging it.
Deprecated/copied
\Drupal\block\Tests\BlockTestBaseinstead of moving.Added a CR, https://www.drupal.org/node/2901823
Moved the Views test.
This will fail because of drupalPostWithFormat
Comment #22
lendudeFixed the fail in \Drupal\Tests\block\Functional\Views\DisplayBlockTest::testBlockContextualLinks by using mink to do the post request.
Created \Drupal\Tests\block\Functional\AssertBlockAppearsTrait to hold the block appears methods, no idea what they were doing on WebTestBase but pretty sure we don't want them on BrowserTestBase and they are used very little in core, so not worth moving to AssertLegacyTrait IMO.
Comment #23
manuel garcia commentedThanks @Lendude, I couldnt figure out #18 either...
nitpick, fixable on commit
AssertBlockAppearsTrait seems like a good idea to me, I think #22 is good to go :)
Comment #24
dawehnerWhat about avoiding format_string here and go with
FormattableMarkup instead?While these changes are of course nice to do, I am wondering whether we should rather target a smaller patch size instead. The previous assertions still pass.
Comment #25
lendudeThanks for the feedback both!
Fixes #23 and #24
Comment #26
dawehnerThank you for reducing the patch size!
Comment #27
mile23For completeness' sake, linking to a similar issue: #2865336: Add \Drupal\simpletest\WebTestBase::assertBlockAppears to \Drupal\FunctionalTests\AssertLegacyTrait
Comment #29
Anonymous (not verified) commentedRandom fail #2906317: Random fail due to problems with database.
Comment #30
jonathan1055 commentedThis is good. Adding
assertBlockAppearsandassertNoBlockAppearsto a Trait in the Block module means that #2865336: Add \Drupal\simpletest\WebTestBase::assertBlockAppears to \Drupal\FunctionalTests\AssertLegacyTrait can be ditched, and #2864088: Convert web tests to browser tests for shortcut module can use the new Block trait.Comment #31
larowlanI'm not sure the word 'Ensure' adds anything here? Can be fixed on commit
Comment #34
larowlanfixed on commit
Committed as 7ba7715 and pushed to 8.5.x
Cherry picked as 4389c91 and pushed to 8.4.x
Published the change record.
Unpostponed the blocked issues.