SearchMultilingualTest should use API to set up language

Created on 7 September 2023, about 1 year ago
Updated 29 August 2024, 3 months ago

Problem/Motivation

SearchMultilingualTest uses form submissions to change language settings.

This is expensive, and not what the test is covering.

Steps to reproduce

Proposed resolution

Change to API calls.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ“Œ Task
Status

Needs work

Version

11.0 πŸ”₯

Component
SearchΒ  β†’

Last updated 1 day ago

  • Maintained by
  • πŸ‡ΊπŸ‡ΈUnited States @pwolanin
Created by

πŸ‡¬πŸ‡§United Kingdom joachim

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

Merge Requests

Comments & Activities

  • Issue created by @joachim
  • First commit to issue fork.
  • Pipeline finished with Success
    3 months ago
    Total: 572s
    #250607
  • Status changed to Needs review 3 months ago
  • I didn't find http request for SearchMultilingualTest 11.x here, However noticed if we remove 'language' module still test working properly , may be we can remove 'language' as 'content_translation' module mentioned in $modules variable & 'content_translation' module has dependency on 'language' module.

    So, removed 'language' module from $modules variable list, resource usage goes from Time: 00:07.592, Memory: 4.00 MB to Time: 00:07.258, Memory: 4.00 MB after MR changes, apart from nothing seems to be left

    Please review, moving NR.

  • Status changed to RTBC 3 months ago
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Almost was tempted to close as such a small change for a single test. But does seem to be a slight improvement and guess can't hurt. Thanks for the time info.

  • Status changed to Needs review 3 months ago
  • πŸ‡³πŸ‡ΏNew Zealand quietone

    How does removing the language module from a MultiLingual test make sense? Oh, this is a browsertest so 'language will get installed as part of installed content_translation'.

    I used "git log -- core/modules/views/tests/src/Functional/SearchMultilingualTest.php" to find changes to this file. That shows that this was fixed in πŸ“Œ Use the API to set up languages in tests that are not specifically testing the language form Fixed making this a duplicate.

    The change does reduce the test time, I presume locally, by 0.334s. So, there is a bit of a gain but if we are to do this it should be for all BrowserTests that list modules in the $modules list that will be installed as a dependency.

  • Status changed to Needs work 3 months ago
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Will definitely need a title update and summary tweak.

    Do we have a META for tracking this? If not probably good idea to add one.

    Probably good number of novice level tickets that could be opened around it.

    @quietone would it be good scope to tackle these on a per module basis?

  • I believe instead of updating title of this issue, we should fix this issue, can create separate meta ticket where can attach this issue link so that we can track where we exactly trace out these changes , may be further tackle these on a per module basis.

  • πŸ‡¬πŸ‡§United Kingdom joachim

    > So, removed 'language' module from $modules variable list, resource usage goes from Time: 00:07.592, Memory: 4.00 MB to Time: 00:07.258, Memory: 4.00 MB after MR changes, apart from nothing seems to be left

    Just checking I've understood this correctly....

    The 'language' module gets installed in both cases, but if we list it explicitly, the test time is longer, and if we don't list it but let it be installed as a dependency, then the test time is shorter.

    That sounds like some bad algorithms in the module installation process. I think I've seen an issue about that recently -- something about enabling all the modules in one go rather than one at a time?

    I think it's better DX if tests can be explicit about what's being enabled, at least for modules which play a part in what's being tested.

Production build 0.71.5 2024