This patch decreases the locally test run from 12.6 to 2.8 seconds.

Problem/Motivation

TrackerUserUidTest makes no HTTP requests but is a functional test

Proposed resolution

  • Convert TrackerUserUidTest into a Kernel test.
  • TrackerTestBase has lost the use cases from Drupal core. More, the integration with Views should be tested with Kernel tests, as it don't involve HTTP requests.

Remaining tasks

None.

User interface changes

None.

API changes

TrackerTestBase is deprecated.

Data model changes

None.

Release notes snippet

N/A

CommentFileSizeAuthor
#2 3046937-2.patch4.46 KBclaudiu.cristea

Comments

claudiu.cristea created an issue. See original summary.

claudiu.cristea’s picture

Status: Active » Needs review
StatusFileSize
new4.46 KB

This patch decreases the locally test run from 12.6 to 2.8 seconds.

naveenvalecha’s picture

Status: Needs review » Reviewed & tested by the community

Neat conversion and we're not losing any coverage.
Thanks!

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 516025b and pushed to 8.8.x. Thanks!

Committed 34434cc without the deprecation and pushed to 8.7.x in order to keep the test bases the same. Thanks!

+++ b/core/modules/tracker/tests/src/Kernel/Views/TrackerUserUidTest.php
@@ -55,13 +86,13 @@ public function testUserUid() {
-    $this->executeView($view, [rand()]);
+    $view->preview(NULL, [rand()]);

Can we get a follow-up to remove this use of rand() - it's not the correct use of randomness in tests. And it can almost certain cause a random fail and rand() will return an integer between 0 and PHP_INT_MAX

  • alexpott committed 516025b on 8.8.x
    Issue #3046937 by claudiu.cristea, naveenvalecha: Convert...

  • alexpott committed 34434cc on 8.7.x
    Issue #3046937 by claudiu.cristea, naveenvalecha: Convert...
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.

quietone’s picture

Publish the change record