Problem/Motivation

`ComponentRenderTest` contains lots of "test" (quotes intended) methods.

For testing performance reasons, this didn't use proper test methods when included in core.
Since then we've improved our testing performance by a lot.

And the real issue is, because of how phpunit handles exceptions, this might be hiding bugs/BC breaks.

E.g. checkInvalidSlot includes expectException. This means that once the exception is triggered, the test passes. But then checkEmptyProps never runs!

Steps to reproduce

See MR !13117 which is passing but should be failing.

Proposed resolution

Each `check` method should be a proper isolated test method.

Remaining tasks

User interface changes

None.

Introduced terminology

None.

API changes

None.

Data model changes

None.

Release notes snippet

None.

Issue fork drupal-3543939

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

penyaskito created an issue. See original summary.

penyaskito’s picture

Issue summary: View changes

penyaskito’s picture

Status: Active » Needs review
penyaskito’s picture

Issue summary: View changes
penyaskito’s picture

Issue summary: View changes
grimreaper’s picture

Status: Needs review » Reviewed & tested by the community

Hi,

Looks good to me. Especially with the other MR as POC to demonstrate the problem.

If this does not cause performance issue anymore, it should be good.

catch’s picture

If you look at the MR output for kernel test jobs, you can see how long the test takes to run.

26.121s Drupal\KernelTests\Components\ComponentRenderTest 14 passed

The longest Kernel tests are over 3 minutes so there's no benefit to consolidating the methods here and the MR should be fine.

nod_’s picture

Status: Reviewed & tested by the community » Fixed

not backporting to 10.x

Committed and pushed 3a9f2bab7e5 to 11.x and 17f7df3e200 to 11.2.x. Thanks!

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

  • nod_ committed 17f7df3e on 11.2.x
    Issue #3543939 by penyaskito, grimreaper, catch: SDC `...

  • nod_ committed 3a9f2bab on 11.x
    Issue #3543939 by penyaskito, grimreaper, catch: SDC `...

Status: Fixed » Closed (fixed)

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