From 06a79a612bef97826606b04a2d94ad3f659bc992 Mon Sep 17 00:00:00 2001 From: Alexey Murz Korepov <MurzNN@gmail.com> Date: Mon, 3 Feb 2025 18:47:16 +0400 Subject: [PATCH] Reproduce gitlab templates issue #3504045 --- .gitlab-ci.yml | 11 +++++ .../Nightwatch/Lib/getBeforeAfterFunctions.js | 2 +- .../tests/src/Nightwatch/Tests/drushTest.js | 41 +++++++++++++++++++ 3 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 tests/modules/test_helpers_functional/tests/src/Nightwatch/Tests/drushTest.js diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 75590950..582965c3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -68,6 +68,17 @@ variables: _SHOW_ENVIRONMENT_VARIABLES: 1 _CSPELL_IGNORE_PATHS: "src/lib/CoreFeaturesMaps/**" + SKIP_COMPOSER_LINT: "1" + SKIP_PAGES: "1" + SKIP_PHPCS: "1" + SKIP_PHPSTAN: "1" + SKIP_PHPUNIT: "1" + SKIP_STYLELINT: "1" + SKIP_ESLINT: "1" + SKIP_CSPELL: "1" + # SKIP_NIGHTWATCH: "1" + OPT_IN_TEST_MAX_PHP: "1" + pages: image: name: phpdoc/phpdoc diff --git a/tests/modules/test_helpers_functional/tests/src/Nightwatch/Lib/getBeforeAfterFunctions.js b/tests/modules/test_helpers_functional/tests/src/Nightwatch/Lib/getBeforeAfterFunctions.js index 62a54ce7..3ad0a0f7 100644 --- a/tests/modules/test_helpers_functional/tests/src/Nightwatch/Lib/getBeforeAfterFunctions.js +++ b/tests/modules/test_helpers_functional/tests/src/Nightwatch/Lib/getBeforeAfterFunctions.js @@ -23,7 +23,7 @@ module.exports = function getBeforeAfterFunctions( forceUninstall = false, ) { return { - '@tags': ['test_helpers', 'test_helpers_functional'], + '@tags': ['test_helpers_off', 'test_helpers_functional'], /** * Function to run before the tests. diff --git a/tests/modules/test_helpers_functional/tests/src/Nightwatch/Tests/drushTest.js b/tests/modules/test_helpers_functional/tests/src/Nightwatch/Tests/drushTest.js new file mode 100644 index 00000000..16c0d385 --- /dev/null +++ b/tests/modules/test_helpers_functional/tests/src/Nightwatch/Tests/drushTest.js @@ -0,0 +1,41 @@ +const { execSync } = require("child_process"); + +module.exports = { + '@tags': ['test_helpers'], + before: function (browser) { + browser + .drupalInstall(); + }, + after: function (browser) { + browser + .drupalUninstall(); + }, + 'Run drush directly': (browser) => { + browser + .drupalRelativeURL('/') + .perform(async () => { + const drushCommand = `drush status`; + console.log(drushCommand); + const result = execSync(drushCommand); + console.log(result.toString()); + }); + + }, + 'Run drush with ENV': (browser) => { + browser + .drupalRelativeURL('/') + .perform(async () => { + const simpletestUserAgentCookieObject = await browser.cookies.get( + 'SIMPLETEST_USER_AGENT', + ); + const simpletestUserAgentCookie = decodeURIComponent( + simpletestUserAgentCookieObject.value, + ); + const drushCommand = `HTTP_USER_AGENT="${simpletestUserAgentCookie}" drush status`; + console.log(drushCommand); + const result = execSync(drushCommand); + console.log(result.toString()); + }); + }, + +}; -- GitLab