- Issue created by @joachim
- Status changed to Needs review
over 1 year ago 10:00pm 21 April 2023 - last update
over 1 year ago 29,302 pass - @joachim opened merge request.
- 🇪🇸Spain penyaskito Seville 💃, Spain 🇪🇸, UTC+2 🇪🇺
Why? This actually covers the forms submission too.
Specially having to call
$this->rebuildContainer();
raises a red flag to me that better we test that happens on the form submission.
- 🇬🇧United Kingdom joachim
> Why? This actually covers the forms submission too.
The form submission already has specific test coverage.
If this test was where it was covered, then the form submissions should be in the testFoo() method, and not in setUp().
Here the form submission is being repeated for several test methods. That's wasteful of time, CPU cycles and energy because doing browser requests is more expensive than API calls. It increases d.org's CI costs.
See the parent issue and the sustainability docs for details.
> $this->rebuildContainer();
It's documented elsewhere that a kernel rebuild is needed when switching a site to multilingual. That has coverage elsewhere.
- 🇬🇧United Kingdom joachim
A search for the path 'admin/config/regional/content-language' in functional tests shows these test files:
contact/tests/src/Functional/ContactLanguageTest.php menu_ui/tests/src/Functional/MenuUiNodeTest.php content_moderation/tests/src/Functional/ModerationContentTranslationTest.php content_moderation/tests/src/Functional/ModerationFormTest.php content_moderation/tests/src/Functional/ModerationLocaleTest.php file/tests/src/Functional/FileOnTranslatedEntityTest.php file/tests/src/Functional/PrivateFileOnTranslatedEntityTest.php path/tests/src/Functional/PathLanguageTest.php path/tests/src/Functional/PathContentModerationTest.php language/tests/src/Functional/LanguageConfigSchemaTest.php language/tests/src/Functional/EntityTypeWithoutLanguageFormTest.php language/tests/src/Functional/LanguageSelectorTranslatableTest.php workspaces/tests/src/Functional/PathWorkspacesTest.php field/tests/src/Functional/EntityReference/EntityReferenceFieldTranslatedReferenceViewTest.php image/tests/src/Functional/ImageOnTranslatedEntityTest.php node/tests/src/Functional/NodeTranslationUITest.php views/tests/src/Functional/Plugin/DisplayFeedTranslationTest.php views/tests/src/Functional/SearchMultilingualTest.php content_translation/tests/src/FunctionalJavascript/ContentTranslationContextualLinksTest.php content_translation/tests/src/Functional/ContentTranslationSyncImageTest.php content_translation/tests/src/Functional/ContentTranslationEnableTest.php content_translation/tests/src/Functional/ContentTranslationStandardFieldsTest.php content_translation/tests/src/Functional/ContentTranslationDisableSettingTest.php content_translation/tests/src/Functional/ContentTranslationOperationsTest.php content_translation/tests/src/Functional/ContentTranslationUntranslatableFieldsTest.php content_translation/tests/src/Functional/ContentTranslationContextualLinksTest.php content_translation/tests/src/Functional/ContentTranslationUISkipTest.php content_translation/tests/src/Functional/ContentTranslationLanguageChangeTest.php content_translation/tests/src/Functional/ContentTranslationSettingsTest.php
That's far too many -- some of them such as ContentTranslationEnableTest or ContentTranslationDisableSettingTest are clearly about using the settings form.
But most of them have no need to use the form and should use the API. Anything outside of content_translation module shouldn't be dealing with a form that doesn't belong to it, and several of the content_translation tests need fixing too.
- 🇧🇪Belgium borisson_ Mechelen, 🇧🇪
That's far too many -- some of them such as ContentTranslationEnableTest or ContentTranslationDisableSettingTest are clearly about using the settings form.
I agree that should we should reduce the number of times we do this trough the api, I wonder if the scope of this issue is correct in that case. Should we do everything in one issue?
- 🇬🇧United Kingdom joachim
> Should we do everything in one issue?
Gah, no! It'll take way too long to get in.
I will though make a meta issue to identify the test coverage for the form.
This issue is fine to get in now though, as it's clearly not meant to be covering the form.
- Status changed to RTBC
over 1 year ago 1:31pm 22 April 2023 - 🇬🇧United Kingdom joachim
Thanks! I've filed 📌 Identify which browser tests should be running the language settings form and add a @covers to document it Fixed .
- last update
over 1 year ago 29,302 pass - last update
over 1 year ago 29,300 pass - last update
over 1 year ago 29,362 pass 50:56 46:56 Running- last update
over 1 year ago 29,367 pass - last update
over 1 year ago 29,374 pass - Status changed to Fixed
over 1 year ago 12:10pm 4 May 2023 - 🇬🇧United Kingdom catch
Committed/pushed to 10.1.x, thanks! Tagging for the follow-up.
Automatically closed - issue fixed for 2 weeks with no activity.
- Status changed to Fixed
over 1 year ago 1:49pm 20 June 2023 - 🇳🇿New Zealand quietone
@joachim, thanks for making the followup issue. I am removing the tag.