Add internal links to LinkItemUrlValidationTest

Created on 19 January 2025, 8 months ago

Problem/Motivation

It would be great to check internal urls as well at test Drupal\Tests\link\Kernel\LinkItemUrlValidationTest. This idea come from πŸ“Œ Attempt to move large parts of LinkFieldTest to a kernel test Active .

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

πŸ“Œ Task
Status

Active

Version

11.0 πŸ”₯

Component

link.module

Created by

πŸ‡·πŸ‡ΊRussia zniki.ru

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

Merge Requests

Comments & Activities

  • Issue created by @zniki.ru
  • πŸ‡·πŸ‡ΊRussia zniki.ru

    Create draft MR, need to decide what other internal links to test.

  • Pipeline finished with Failed
    8 months ago
    Total: 618s
    #400196
  • πŸ‡·πŸ‡ΊRussia zniki.ru

    Add internal links.
    Improved error message. Provide violation message.

  • Pipeline finished with Success
    8 months ago
    Total: 503s
    #406266
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Think if we are going to refactor this why not use a dataprovider?

  • Status changed to Needs review about 2 months ago
  • πŸ‡ΊπŸ‡ΈUnited States dcam

    Think if we are going to refactor this why not use a dataprovider?

    I'd seen the docblock of LinkSeparateFormatterDisplayTest::testLinkSeparateFormatter() that says "Run tests without dataProvider to improve speed." The issue for which that test was created noted that not using a data provider was a considerable performance increase. So that made me curious, what would be the performance impact of running these tests with a data provider?

    As they are now, the tests run in 3-5 seconds on my local environment. I refactored them to use data providers instead. The external link tests alone took 1min 17sec. The internal link tests didn't run because the provider function uses $this which isn't allowed in a static function. So that would take further refactoring. But I think it's clear that using a provider is less preferable without doing that extra work.

  • Pipeline finished with Success
    about 2 months ago
    Total: 1246s
    #561001
  • πŸ‡ΊπŸ‡ΈUnited States dcam

    I left a couple of comments on the MR.

Production build 0.71.5 2024