Problem/Motivation

\Drupal\Tests\locale\Functional\LocaleUpdateTest::testUpdateProjects() is not making any HTTP calls.

Proposed resolution

Convert it to a kernel test.

Remaining tasks

None.

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

None.

Comments

claudiu.cristea created an issue. See original summary.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

claudiu.cristea’s picture

Status: Active » Needs review
Issue tags: +Performance
StatusFileSize
new3.04 KB

Patch. On my machine:

  • \Drupal\Tests\locale\Functional\LocaleUpdateTest::testUpdateProjects() ~10 seconds.
  • \Drupal\Tests\locale\Kernel\LocaleUpdateTest::testUpdateProjects() ~1 second.
lendude’s picture

Status: Needs review » Needs work
+++ b/core/modules/locale/tests/src/Kernel/LocaleUpdateTest.php
@@ -0,0 +1,40 @@
+    require_once $this->getDrupalRoot() . '/core/modules/locale/locale.compare.inc';

Lets not do a manual require_once but add the locale module and $this->container->get('module_handler')->loadInclude('locale', 'compare.inc');

claudiu.cristea’s picture

Status: Needs work » Needs review
StatusFileSize
new3.02 KB
new786 bytes

Thank you. Fixed the line. However, I used \Drupal instead of $this->container as per #2066993: Use magic methods to sync container property to \Drupal::getContainer in functional tests issue.

claudiu.cristea’s picture

StatusFileSize
new3.05 KB
new966 bytes

Added locale module. switched to $this->container as per @alexpott last comment comment from #2066993: Use magic methods to sync container property to \Drupal::getContainer in functional tests.

lendude’s picture

Status: Needs review » Reviewed & tested by the community

@claudiu.cristea thanks!

alexpott’s picture

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed 0daec5301d to 8.8.x and 1b5da14815 to 8.7.x. Thanks!

As a test only change backported to 8.7.x - I discussed backporting test-only changes with @catch (as a release manager).

  • alexpott committed 0daec53 on 8.8.x
    Issue #3037042 by claudiu.cristea, Lendude: Convert LocaleUpdateTest::...

  • alexpott committed 1b5da14 on 8.7.x
    Issue #3037042 by claudiu.cristea, Lendude: Convert LocaleUpdateTest::...
alexpott’s picture

Version: 8.8.x-dev » 8.7.x-dev

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.