Skip unsupported methods in rest/jsonapi tests in an efficient way

Created on 18 July 2024, 3 months ago
Updated 18 September 2024, 30 days ago

Problem/Motivation

\Drupal\Tests\rest\Functional\EntityResource\XmlEntityNormalizationQuirksTrait skips both testPatch and testPost but this occurs after installing Drupal. This can cost 15 seconds of compute time per skipped test... see page 169 of https://git.drupalcode.org/project/drupal/-/pipelines/227006/test_report...

Steps to reproduce

Run ./vendor/bin/phpunit core/modules/comment/tests/src/Functional/Rest/CommentXmlBasicAuthTest.php --filter testPostDxWithoutCriticalBaseFields

Proposed resolution

Use attributes to add methods run before a test to mark it skipped if we are skipping based on name.

Running ./vendor/bin/phpunit core/modules/comment/tests/src/Functional/Rest/CommentXmlBasicAuthTest.php --filter testPostDxWithoutCriticalBaseFields before takes Time: 00:08.349, Memory: 10.00 MB and after takes Time: 00:00.463, Memory: 10.00 MB

Remaining tasks

None

User interface changes

None

API changes

None

Data model changes

None

Release notes snippet

N/a

📌 Task
Status

Fixed

Version

10.3

Component
PHPUnit 

Last updated 1 day ago

Created by

🇬🇧United Kingdom alexpott 🇪🇺🌍

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024