Problem/Motivation

The ./core/scripts/test-site.php which is used by Nightwatch tests depend on localize.drupal.org. This has a potential of causing random failures in the case of localize.drupal.org not being reachable. We have reduced our dependency on external services in our PHP based tests in the past.

Proposed resolution

Mock localize.drupal.org when installing site with ./core/scripts/test-site.php.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

lauriii created an issue. See original summary.

dww’s picture

Priority: Normal » Major

Yes, please. ;) Given the impact this has on core development, seems this should be at least major...

Thanks,
-Derek

clayfreeman’s picture

Status: Active » Needs review
FileSize
5.21 KB

The attached patch removes \Drupal\TestSite\TestSiteMultilingualInstallTestScript and consolidates its additional functionality into \Drupal\TestSite\TestSiteInstallTestScript. This allows the locale module to skip retrieving the translation file for Drupal core on install.

alexpott’s picture

Status: Needs review » Needs work

@clayfreeman how about changing the test to use core/tests/Drupal/TestSite/TestSiteMultilingualInstallTestScript.php
ie.
Change setupFile: 'core/tests/Drupal/TestSite/TestSiteInstallTestScript.php' to setupFile: 'core/tests/Drupal/TestSite/TestSiteMultilingualInstallTestScript.php', in core/tests/Drupal/TestSite/TestSiteMultilingualInstallTestScript.php

Removing core/tests/Drupal/TestSite/TestSiteMultilingualInstallTestScript.php means any custom or contrib tests that use it will break.

clayfreeman’s picture

Status: Needs work » Needs review
FileSize
580 bytes
dww’s picture

#5 looks great. Queued for a run on 9.1.x, too (although I believe the upstream problem is fixed where there was no 9.1.x po files for the installer on l.d.o, so it probably won't tell us much).

Tentatively +1 for an RTBC...

anu.a_95’s picture

Applied patch #5 successfully

The patch in #5 as per the suggestion in #4 looks great and is applied cleanly. The Drupal (9.1.x-dev) instance worked as normal after the patch.

-Thanks

anu.a_95’s picture

Status: Needs review » Reviewed & tested by the community
alexpott’s picture

Version: 9.0.x-dev » 8.9.x-dev
Status: Reviewed & tested by the community » Fixed

Committed and pushed bf2b32abc7 to 9.1.x and 0d9ca03d03 to 9.0.x and 6dca0459c6 to 8.9.x. Thanks!

Backported to 8.9.x as this is a test only change.

diff --git a/core/tests/Drupal/Nightwatch/Tests/langcodeTest.js b/core/tests/Drupal/Nightwatch/Tests/langcodeTest.js
index 35b70ce09a..4fbce17649 100644
--- a/core/tests/Drupal/Nightwatch/Tests/langcodeTest.js
+++ b/core/tests/Drupal/Nightwatch/Tests/langcodeTest.js
@@ -2,7 +2,8 @@ module.exports = {
   '@tags': ['core'],
   before(browser) {
     browser.drupalInstall({
-      setupFile: 'core/tests/Drupal/TestSite/TestSiteMultilingualInstallTestScript.php',
+      setupFile:
+        'core/tests/Drupal/TestSite/TestSiteMultilingualInstallTestScript.php',
       langcode: 'fr',
     });
   },

Coding standards fail due to:

/Users/alex/dev/drupal/core/tests/Drupal/Nightwatch/Tests/langcodeTest.js
  5:17  error  Insert `⏎·······`  prettier/prettier

✖ 1 problem (1 error, 0 warnings)
  1 error and 0 warnings potentially fixable with the `--fix` option.

  • alexpott committed bf2b32a on 9.1.x
    Issue #3122002 by clayfreeman, lauriii, alexpott: Remove dependency to...

  • alexpott committed 0d9ca03 on 9.0.x
    Issue #3122002 by clayfreeman, lauriii, alexpott: Remove dependency to...

  • alexpott committed 6dca045 on 8.9.x
    Issue #3122002 by clayfreeman, lauriii, alexpott: Remove dependency to...

Status: Fixed » Closed (fixed)

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