Problem/Motivation

RelationshipUserFileDataTest makes no HTTP requests but is a functional test

Proposed resolution

Convert RelationshipUserFileDataTest into a Kernel test

Remaining tasks

None.

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

N/A

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

claudiu.cristea created an issue. See original summary.

claudiu.cristea’s picture

Status: Active » Needs review
FileSize
4.49 KB

This patch decreases the locally test run from 8.0 to 1.7 seconds.

klausi’s picture

Issue tags: +DevDaysTransylvania

Nice work, I think this is ready to go, just have 1 question:

+++ b/core/modules/file/tests/src/Kernel/Views/RelationshipUserFileDataTest.php
@@ -30,66 +40,57 @@ class RelationshipUserFileDataTest extends ViewTestBase {
     // Create the user profile field and instance.
     FieldStorageConfig::create([
+      'type' => 'file',
       'entity_type' => 'user',
       'field_name' => 'user_file',
-      'type' => 'file',
-      'translatable' => '0',
     ])->save();
     FieldConfig::create([
-      'label' => 'User File',
-      'description' => '',
-      'field_name' => 'user_file',
       'entity_type' => 'user',
       'bundle' => 'user',
-      'required' => 0,
+      'field_name' => 'user_file',
     ])->save();

Why did you modify this? Should work as before?

claudiu.cristea’s picture

@klausi, I've only improved the readability of the code: I removed useless keys (that are only setting default values) and I reordered some.

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

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

daffie’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll

Patch fails to apply.

longwave’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
2.93 KB

Rerolled from scratch, I tried to change as little as possible rather than refactoring as in #2.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

daffie’s picture

Status: Needs review » Reviewed & tested by the community

All changes look good to me.
For me it is RTBC.

  • catch committed c5e16af on 9.3.x
    Issue #3048423 by claudiu.cristea, longwave, klausi: Convert...

  • catch committed aa91f07 on 9.2.x
    Issue #3048423 by claudiu.cristea, longwave, klausi: Convert...
catch’s picture

Version: 9.3.x-dev » 9.2.x-dev
Status: Reviewed & tested by the community » Fixed

Committed/pushed to 9.3.x and cherry-picked to 9.2.x, thanks!

Status: Fixed » Closed (fixed)

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