From 4054519f4b3940f9812fb7574f4031cf2c4d5e64 Mon Sep 17 00:00:00 2001 From: Sally Young Date: Tue, 4 Jul 2023 17:32:44 +0100 Subject: [PATCH 01/31] Upgrade Nightwatch and add a test for functional tests --- .github/workflows/TestFunctional.yml | 78 +++++++++++++++++ drainpipe-dev/config/nightwatch.conf.js | 86 ++++++++++--------- .../nightwatch/docker-compose.selenium.yaml | 6 +- 3 files changed, 125 insertions(+), 45 deletions(-) create mode 100644 .github/workflows/TestFunctional.yml diff --git a/.github/workflows/TestFunctional.yml b/.github/workflows/TestFunctional.yml new file mode 100644 index 000000000..4fa61ae72 --- /dev/null +++ b/.github/workflows/TestFunctional.yml @@ -0,0 +1,78 @@ +name: Test Functional Tests +on: + push: + branches: + - main + pull_request: + types: [opened, synchronize, reopened] + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + Test-Functional: + runs-on: ubuntu-latest + steps: + - name: Create a Drupal project + run: composer create-project drupal/recommended-project . --ignore-platform-req=ext-gd + + - uses: actions/checkout@v3 + with: + path: drainpipe + + - name: Setup drainpipe-dev + run: mv drainpipe/drainpipe-dev . + + - uses: ./drainpipe/scaffold/github/actions/common/set-env + + - name: Install DDEV + uses: ./drainpipe/scaffold/github/actions/common/ddev + with: + git-name: Drainpipe Bot + git-email: no-reply@example.com + + - name: Setup Project + run: | + ddev config --auto + ddev start + ddev composer config extra.drupal-scaffold.gitignore true + ddev composer config --json extra.drupal-scaffold.allowed-packages '["lullabot/drainpipe-dev", "lullabot/drainpipe"]' + ddev composer config --no-plugins allow-plugins.composer/installers true + ddev composer config --no-plugins allow-plugins.drupal/core-composer-scaffold true + ddev composer config --no-plugins allow-plugins.lullabot/drainpipe true + ddev composer config --no-plugins allow-plugins.lullabot/drainpipe-dev true + ddev composer config repositories.drainpipe --json '{"type": "path", "url": "drainpipe", "options": {"symlink": false}}' + ddev composer config repositories.drainpipe-dev --json '{"type": "path", "url": "drainpipe-dev", "options": {"symlink": false}}' + ddev composer config minimum-stability dev + ddev composer require "lullabot/drainpipe @dev" --with-all-dependencies + ddev composer require "lullabot/drainpipe-dev @dev" --dev --with-all-dependencies + # Restart is required to enable the provided Selenium containers + ddev restart + + - name: Setup Nightwatch + run: | + ddev npm init -y + ddev npm install nightwatch nightwatch-accessibility @lullabot/nightwatch-drupal-commands --save-dev + echo "hooks:" >> .ddev/config.yaml + echo " post-start:" >> .ddev/config.yaml + echo " - exec: mysql -uroot -proot -hdb -e \"CREATE DATABASE IF NOT EXISTS firefox; GRANT ALL ON firefox.* TO 'db'@'%';\"" >> .ddev/config.yaml + ddev config --web-environment="NIGHTWATCH_DRUPAL_URL_FIREFOX=https://drupal_firefox,NIGHTWATCH_DRUPAL_URL_CHROME=https://drupal_chrome" + ddev config --additional-hostnames="*.$DDEV_SITENAME" + ddev restart + + - name: Install Drupal + run: | + ddev drush --yes site:install + ddev drush --uri=https://drupal_firefox --yes site:install + ddev drush --uri=https://drupal_chrome --yes site:install + + - name: Run Functional Tests + run: ddev task test:functional + + - name: Upload test artifacts + if: ${{ always() }} + uses: actions/upload-artifact@v2 + with: + name: test_result + path: test_result diff --git a/drainpipe-dev/config/nightwatch.conf.js b/drainpipe-dev/config/nightwatch.conf.js index 72592e930..a520d5541 100644 --- a/drainpipe-dev/config/nightwatch.conf.js +++ b/drainpipe-dev/config/nightwatch.conf.js @@ -10,6 +10,8 @@ try { drupalCommandsPath = './node_modules/@lullabot/nightwatch-drupal-commands'; } +const firefoxLaunchUrl = process.env.NIGHTWATCH_DRUPAL_URL_FIREFOX && process.env.NIGHTWATCH_DRUPAL_URL_FIREFOX.length ? process.env.NIGHTWATCH_DRUPAL_URL_FIREFOX.replace(/\/$/, '') : process.env.NIGHTWATCH_DRUPAL_URL; +const chromeLaunchUrl = process.env.NIGHTWATCH_DRUPAL_URL_CHROME && process.env.NIGHTWATCH_DRUPAL_URL_CHROME.length ? process.env.NIGHTWATCH_DRUPAL_URL_CHROME.replace(/\/$/, '') : process.env.NIGHTWATCH_DRUPAL_URL; module.exports = { // An array of folders (excluding subfolders) where your tests are located; @@ -32,50 +34,34 @@ module.exports = { webdriver: {}, + test_workers: { + enabled: true, + workers: 'auto' + }, + test_settings: { default: { filter: '**/*.nightwatch.js', - "screenshots" : { - "enabled" : true, - "on_failure" : true, - "on_error" : false, - "path" : "test_result" - } - }, - firefox: { - desiredCapabilities: { - resolution: "1240x4000", - browserName: 'firefox', - acceptInsecureCerts: true, - alwaysMatch: { - 'moz:firefoxOptions': { - args: [ - //'-headless', - // '-verbose' - ] - } - } - }, - webdriver: { - start_process: false, - host: 'firefox', - port: 4444, - cli_args: [ - // very verbose geckodriver logs - // '-vv' - ] - }, - globals: { - drupalUrl: process.env.NIGHTWATCH_DRUPAL_URL_FIREFOX && process.env.NIGHTWATCH_DRUPAL_URL_FIREFOX.length ? process.env.NIGHTWATCH_DRUPAL_URL_FIREFOX.replace(/\/$/, '') : process.env.NIGHTWATCH_DRUPAL_URL, + disable_error_log: false, + screenshots: { + enabled: false, + on_failure: true, + on_error: false, + path: 'test_result', }, }, + chrome: { + selenium: { + start_process: false, + host: 'chrome', + port: 4444 + }, desiredCapabilities: { - resolution: "1240x4000", browserName: 'chrome', + esolution: "1240x4000", 'goog:chromeOptions': { - // More info on Chromedriver: https://sites.google.com/a/chromium.org/chromedriver/ - // + w3c: true, args: [ '--no-sandbox', '--ignore-certificate-errors', @@ -84,17 +70,33 @@ module.exports = { ] } }, - webdriver: { + globals: { + drupalUrl: chromeLaunchUrl, + }, + launch_url: chromeLaunchUrl, + }, + + firefox: { + selenium: { start_process: false, - host: 'chrome', - port: 4444, - cli_args: [ - // --verbose - ] + host: 'firefox', + port: 4444 + }, + desiredCapabilities: { + browserName: 'firefox', + resolution: "1240x4000", + acceptInsecureCerts: true, + 'moz:firefoxOptions': { + args: [ + // '-headless', + // '-verbose' + ] + } }, globals: { - drupalUrl: process.env.NIGHTWATCH_DRUPAL_URL_CHROME && process.env.NIGHTWATCH_DRUPAL_URL_CHROME.length ? process.env.NIGHTWATCH_DRUPAL_URL_CHROME.replace(/\/$/, '') : process.env.NIGHTWATCH_DRUPAL_URL, + drupalUrl: firefoxLaunchUrl, }, + launch_url: firefoxLaunchUrl, }, } }; diff --git a/drainpipe-dev/scaffold/nightwatch/docker-compose.selenium.yaml b/drainpipe-dev/scaffold/nightwatch/docker-compose.selenium.yaml index 68d2a63c5..7d3d72d09 100644 --- a/drainpipe-dev/scaffold/nightwatch/docker-compose.selenium.yaml +++ b/drainpipe-dev/scaffold/nightwatch/docker-compose.selenium.yaml @@ -3,7 +3,7 @@ version: '3.6' services: chrome: container_name: ddev-${DDEV_SITENAME}-chrome - image: seleniarm/standalone-chromium:4.1.2-20220227 + image: seleniarm/standalone-chromium:4.10.0 labels: com.ddev.site-name: ${DDEV_SITENAME} com.ddev.approot: $DDEV_APPROOT @@ -29,7 +29,7 @@ services: firefox: container_name: ddev-${DDEV_SITENAME}-firefox - image: seleniarm/standalone-firefox:4.1.2-20220227 + image: seleniarm/standalone-firefox:4.10.0 labels: com.ddev.site-name: ${DDEV_SITENAME} com.ddev.approot: $DDEV_APPROOT @@ -37,7 +37,7 @@ services: expose: - 7901 environment: - - NO_VNC_PORT=7901 + - SE_NO_VNC_PORT=7901 - VIRTUAL_HOST=$DDEV_HOSTNAME - HTTPS_EXPOSE=7901:7901 - HTTP_EXPOSE=7911:7901 From 3c03c07c3473faf2490eef3540d94fe37b054733 Mon Sep 17 00:00:00 2001 From: Sally Young Date: Wed, 5 Jul 2023 09:04:44 +0100 Subject: [PATCH 02/31] Fix hostname --- .github/workflows/TestFunctional.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/TestFunctional.yml b/.github/workflows/TestFunctional.yml index 4fa61ae72..16f865332 100644 --- a/.github/workflows/TestFunctional.yml +++ b/.github/workflows/TestFunctional.yml @@ -58,7 +58,7 @@ jobs: echo " post-start:" >> .ddev/config.yaml echo " - exec: mysql -uroot -proot -hdb -e \"CREATE DATABASE IF NOT EXISTS firefox; GRANT ALL ON firefox.* TO 'db'@'%';\"" >> .ddev/config.yaml ddev config --web-environment="NIGHTWATCH_DRUPAL_URL_FIREFOX=https://drupal_firefox,NIGHTWATCH_DRUPAL_URL_CHROME=https://drupal_chrome" - ddev config --additional-hostnames="*.$DDEV_SITENAME" + ddev config --additional-hostnames="*.drainpipe" ddev restart - name: Install Drupal From 5036f5f16f3aa42f350355cfa618371f676367d2 Mon Sep 17 00:00:00 2001 From: Sally Young Date: Wed, 5 Jul 2023 09:23:30 +0100 Subject: [PATCH 03/31] Fix chrome database --- .github/workflows/TestFunctional.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/TestFunctional.yml b/.github/workflows/TestFunctional.yml index 16f865332..bdf585887 100644 --- a/.github/workflows/TestFunctional.yml +++ b/.github/workflows/TestFunctional.yml @@ -57,6 +57,7 @@ jobs: echo "hooks:" >> .ddev/config.yaml echo " post-start:" >> .ddev/config.yaml echo " - exec: mysql -uroot -proot -hdb -e \"CREATE DATABASE IF NOT EXISTS firefox; GRANT ALL ON firefox.* TO 'db'@'%';\"" >> .ddev/config.yaml + echo " - exec: mysql -uroot -proot -hdb -e \"CREATE DATABASE IF NOT EXISTS chrome; GRANT ALL ON chrome.* TO 'db'@'%';\"" >> .ddev/config.yaml ddev config --web-environment="NIGHTWATCH_DRUPAL_URL_FIREFOX=https://drupal_firefox,NIGHTWATCH_DRUPAL_URL_CHROME=https://drupal_chrome" ddev config --additional-hostnames="*.drainpipe" ddev restart From 22225ad4eac53f2ea5c94d45898e5865680d8ae4 Mon Sep 17 00:00:00 2001 From: Sally Young Date: Wed, 5 Jul 2023 09:35:00 +0100 Subject: [PATCH 04/31] Switch npm run to npx --- tasks/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/test.yml b/tasks/test.yml index 75a15b985..80f914339 100644 --- a/tasks/test.yml +++ b/tasks/test.yml @@ -276,7 +276,7 @@ tasks: cmds: - | if [ -f "package-lock.json" ]; then - npm run nightwatch --env $NIGHTWATCH_ENV {{.CLI_ARGS}} + npx nightwatch --env $NIGHTWATCH_ENV {{.CLI_ARGS}} elif [ -f "yarn.lock" ]; then yarn nightwatch --env $NIGHTWATCH_ENV {{.CLI_ARGS}} else From cbc0f48da47629416c864d31fe2e82167acaf71e Mon Sep 17 00:00:00 2001 From: Sally Young Date: Wed, 5 Jul 2023 09:42:22 +0100 Subject: [PATCH 05/31] Export config --- .github/workflows/TestFunctional.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/TestFunctional.yml b/.github/workflows/TestFunctional.yml index bdf585887..be34e5b0a 100644 --- a/.github/workflows/TestFunctional.yml +++ b/.github/workflows/TestFunctional.yml @@ -67,6 +67,7 @@ jobs: ddev drush --yes site:install ddev drush --uri=https://drupal_firefox --yes site:install ddev drush --uri=https://drupal_chrome --yes site:install + ddev drush config:export --yes - name: Run Functional Tests run: ddev task test:functional From 6ec15c69ee305361c58269da0486c97deb66a4ec Mon Sep 17 00:00:00 2001 From: Sally Young Date: Wed, 5 Jul 2023 09:52:37 +0100 Subject: [PATCH 06/31] Debugging --- .github/workflows/TestFunctional.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/TestFunctional.yml b/.github/workflows/TestFunctional.yml index be34e5b0a..cdf97bbc9 100644 --- a/.github/workflows/TestFunctional.yml +++ b/.github/workflows/TestFunctional.yml @@ -69,6 +69,9 @@ jobs: ddev drush --uri=https://drupal_chrome --yes site:install ddev drush config:export --yes + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 + - name: Run Functional Tests run: ddev task test:functional From 252fbf124d5492f3f2677d57f4d76a1ee5ff8f13 Mon Sep 17 00:00:00 2001 From: Sally Young Date: Wed, 5 Jul 2023 10:52:09 +0100 Subject: [PATCH 07/31] Disable workers and fix nightwatch a11y commands path --- drainpipe-dev/config/nightwatch.conf.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drainpipe-dev/config/nightwatch.conf.js b/drainpipe-dev/config/nightwatch.conf.js index a520d5541..cb214141f 100644 --- a/drainpipe-dev/config/nightwatch.conf.js +++ b/drainpipe-dev/config/nightwatch.conf.js @@ -6,7 +6,7 @@ try { drupalCommandsPath = resolveToUnqualified('@lullabot/nightwatch-drupal-commands', __filename).replace(/\/$/, ''); yarn2 = true; } catch(e) { - a11yPath = './node_modules/nightwatch-accessibility'; + a11yPath = './node_modules/nightwatch-accessibility/nightwatch'; drupalCommandsPath = './node_modules/@lullabot/nightwatch-drupal-commands'; } @@ -35,8 +35,7 @@ module.exports = { webdriver: {}, test_workers: { - enabled: true, - workers: 'auto' + enabled: false }, test_settings: { From 9a1fa11ddb3e7e3d563f2a04c1ba628eb6b49b03 Mon Sep 17 00:00:00 2001 From: Sally Young Date: Wed, 5 Jul 2023 10:57:55 +0100 Subject: [PATCH 08/31] Remove debugging --- .github/workflows/TestFunctional.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/TestFunctional.yml b/.github/workflows/TestFunctional.yml index cdf97bbc9..be34e5b0a 100644 --- a/.github/workflows/TestFunctional.yml +++ b/.github/workflows/TestFunctional.yml @@ -69,9 +69,6 @@ jobs: ddev drush --uri=https://drupal_chrome --yes site:install ddev drush config:export --yes - - name: Setup tmate session - uses: mxschmitt/action-tmate@v3 - - name: Run Functional Tests run: ddev task test:functional From 8a8284cf73dadbb31e1d17056e7b8cfd13213cd9 Mon Sep 17 00:00:00 2001 From: Sally Young Date: Wed, 5 Jul 2023 11:05:31 +0100 Subject: [PATCH 09/31] Split job --- .github/workflows/TestFunctional.yml | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/.github/workflows/TestFunctional.yml b/.github/workflows/TestFunctional.yml index be34e5b0a..0b29c5971 100644 --- a/.github/workflows/TestFunctional.yml +++ b/.github/workflows/TestFunctional.yml @@ -11,7 +11,7 @@ concurrency: cancel-in-progress: true jobs: - Test-Functional: + Build: runs-on: ubuntu-latest steps: - name: Create a Drupal project @@ -47,19 +47,36 @@ jobs: ddev composer config minimum-stability dev ddev composer require "lullabot/drainpipe @dev" --with-all-dependencies ddev composer require "lullabot/drainpipe-dev @dev" --dev --with-all-dependencies - # Restart is required to enable the provided Selenium containers - ddev restart - name: Setup Nightwatch run: | - ddev npm init -y - ddev npm install nightwatch nightwatch-accessibility @lullabot/nightwatch-drupal-commands --save-dev echo "hooks:" >> .ddev/config.yaml echo " post-start:" >> .ddev/config.yaml echo " - exec: mysql -uroot -proot -hdb -e \"CREATE DATABASE IF NOT EXISTS firefox; GRANT ALL ON firefox.* TO 'db'@'%';\"" >> .ddev/config.yaml echo " - exec: mysql -uroot -proot -hdb -e \"CREATE DATABASE IF NOT EXISTS chrome; GRANT ALL ON chrome.* TO 'db'@'%';\"" >> .ddev/config.yaml ddev config --web-environment="NIGHTWATCH_DRUPAL_URL_FIREFOX=https://drupal_firefox,NIGHTWATCH_DRUPAL_URL_CHROME=https://drupal_chrome" ddev config --additional-hostnames="*.drainpipe" + + - name: Upload Artifact + uses: actions/upload-artifact@v3 + with: + name: test-functional-build + path: ${{ github.workspace }} + + Test-NPM: + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v3 + with: + name: test-functional-build + + - name: Start DDEV + run: ddev start + + - name: Setup Nightwatch + run: | + ddev npm init -y + ddev npm install nightwatch nightwatch-accessibility @lullabot/nightwatch-drupal-commands --save-dev ddev restart - name: Install Drupal From ab93afe55cba7d21bfdd926e9b4f5867a00d278e Mon Sep 17 00:00:00 2001 From: Sally Young Date: Wed, 5 Jul 2023 11:07:59 +0100 Subject: [PATCH 10/31] Add job dependency --- .github/workflows/TestFunctional.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/TestFunctional.yml b/.github/workflows/TestFunctional.yml index 0b29c5971..ca831ef03 100644 --- a/.github/workflows/TestFunctional.yml +++ b/.github/workflows/TestFunctional.yml @@ -65,6 +65,7 @@ jobs: Test-NPM: runs-on: ubuntu-latest + needs: Build steps: - uses: actions/download-artifact@v3 with: From 9fa7e5584dddbd0599589767bd997ed8bc89a8e8 Mon Sep 17 00:00:00 2001 From: Sally Young Date: Wed, 5 Jul 2023 11:11:14 +0100 Subject: [PATCH 11/31] Install DDEV in second job --- .github/workflows/TestFunctional.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/TestFunctional.yml b/.github/workflows/TestFunctional.yml index ca831ef03..8a7291066 100644 --- a/.github/workflows/TestFunctional.yml +++ b/.github/workflows/TestFunctional.yml @@ -67,6 +67,14 @@ jobs: runs-on: ubuntu-latest needs: Build steps: + - uses: ./drainpipe/scaffold/github/actions/common/set-env + + - name: Install DDEV + uses: ./drainpipe/scaffold/github/actions/common/ddev + with: + git-name: Drainpipe Bot + git-email: no-reply@example.com# + - uses: actions/download-artifact@v3 with: name: test-functional-build From edf86c9c370ab647e9feff939a817919389a209b Mon Sep 17 00:00:00 2001 From: Sally Young Date: Wed, 5 Jul 2023 11:19:31 +0100 Subject: [PATCH 12/31] Create a zip of the workspace --- .github/workflows/TestFunctional.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/TestFunctional.yml b/.github/workflows/TestFunctional.yml index 8a7291066..8c1582199 100644 --- a/.github/workflows/TestFunctional.yml +++ b/.github/workflows/TestFunctional.yml @@ -57,11 +57,14 @@ jobs: ddev config --web-environment="NIGHTWATCH_DRUPAL_URL_FIREFOX=https://drupal_firefox,NIGHTWATCH_DRUPAL_URL_CHROME=https://drupal_chrome" ddev config --additional-hostnames="*.drainpipe" + - name: Create Artifact + run: zip -r /tmp/drainpipe.zip ${{ github.workspace }} + - name: Upload Artifact uses: actions/upload-artifact@v3 with: name: test-functional-build - path: ${{ github.workspace }} + path: /tmp/drainpipe.zip Test-NPM: runs-on: ubuntu-latest @@ -79,6 +82,11 @@ jobs: with: name: test-functional-build + - name: Restore Workspace + run: | + cd ../ + unzip -o /tmp/drainpipe.zip -d ${{ github.workspace }} + - name: Start DDEV run: ddev start From eb13954dc7f273f1707212c6d702f6df1e5b2e8a Mon Sep 17 00:00:00 2001 From: Sally Young Date: Wed, 5 Jul 2023 11:25:00 +0100 Subject: [PATCH 13/31] reorder --- .github/workflows/TestFunctional.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/TestFunctional.yml b/.github/workflows/TestFunctional.yml index 8c1582199..29e10f48e 100644 --- a/.github/workflows/TestFunctional.yml +++ b/.github/workflows/TestFunctional.yml @@ -70,14 +70,6 @@ jobs: runs-on: ubuntu-latest needs: Build steps: - - uses: ./drainpipe/scaffold/github/actions/common/set-env - - - name: Install DDEV - uses: ./drainpipe/scaffold/github/actions/common/ddev - with: - git-name: Drainpipe Bot - git-email: no-reply@example.com# - - uses: actions/download-artifact@v3 with: name: test-functional-build @@ -87,6 +79,14 @@ jobs: cd ../ unzip -o /tmp/drainpipe.zip -d ${{ github.workspace }} + - uses: ./drainpipe/scaffold/github/actions/common/set-env + + - name: Install DDEV + uses: ./drainpipe/scaffold/github/actions/common/ddev + with: + git-name: Drainpipe Bot + git-email: no-reply@example.com# + - name: Start DDEV run: ddev start From 536cc4692534ed7855041c471eb35adbb4ed35b9 Mon Sep 17 00:00:00 2001 From: Sally Young Date: Wed, 5 Jul 2023 11:30:52 +0100 Subject: [PATCH 14/31] file location --- .github/workflows/TestFunctional.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/TestFunctional.yml b/.github/workflows/TestFunctional.yml index 29e10f48e..0993661cb 100644 --- a/.github/workflows/TestFunctional.yml +++ b/.github/workflows/TestFunctional.yml @@ -77,7 +77,9 @@ jobs: - name: Restore Workspace run: | cd ../ + mv ${{ github.workspace }}/drainpipe.zip /tmp/drainpipe.zip unzip -o /tmp/drainpipe.zip -d ${{ github.workspace }} + cd ${{ github.workspace }} - uses: ./drainpipe/scaffold/github/actions/common/set-env From 8c0e24e74e8adc8f7b78a0bbb937f46a88ebcd00 Mon Sep 17 00:00:00 2001 From: Sally Young Date: Wed, 5 Jul 2023 11:37:57 +0100 Subject: [PATCH 15/31] cd to / --- .github/workflows/TestFunctional.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/TestFunctional.yml b/.github/workflows/TestFunctional.yml index 0993661cb..9e9445a02 100644 --- a/.github/workflows/TestFunctional.yml +++ b/.github/workflows/TestFunctional.yml @@ -76,7 +76,7 @@ jobs: - name: Restore Workspace run: | - cd ../ + cd / mv ${{ github.workspace }}/drainpipe.zip /tmp/drainpipe.zip unzip -o /tmp/drainpipe.zip -d ${{ github.workspace }} cd ${{ github.workspace }} From 1809ed9f396f6f9a044e73d3b295a63480a25e8e Mon Sep 17 00:00:00 2001 From: Sally Young Date: Wed, 5 Jul 2023 11:46:23 +0100 Subject: [PATCH 16/31] fix zip --- .github/workflows/TestFunctional.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/TestFunctional.yml b/.github/workflows/TestFunctional.yml index 9e9445a02..776117dac 100644 --- a/.github/workflows/TestFunctional.yml +++ b/.github/workflows/TestFunctional.yml @@ -58,7 +58,7 @@ jobs: ddev config --additional-hostnames="*.drainpipe" - name: Create Artifact - run: zip -r /tmp/drainpipe.zip ${{ github.workspace }} + run: zip -r /tmp/drainpipe.zip ./ - name: Upload Artifact uses: actions/upload-artifact@v3 @@ -76,7 +76,7 @@ jobs: - name: Restore Workspace run: | - cd / + cd ../ mv ${{ github.workspace }}/drainpipe.zip /tmp/drainpipe.zip unzip -o /tmp/drainpipe.zip -d ${{ github.workspace }} cd ${{ github.workspace }} From 9674d05b49aa6ba60ce24b13eceac0f8c15ed8f8 Mon Sep 17 00:00:00 2001 From: Sally Young Date: Wed, 5 Jul 2023 12:04:03 +0100 Subject: [PATCH 17/31] Test yarn classic --- .github/workflows/TestFunctional.yml | 50 ++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/.github/workflows/TestFunctional.yml b/.github/workflows/TestFunctional.yml index 776117dac..1ec3268af 100644 --- a/.github/workflows/TestFunctional.yml +++ b/.github/workflows/TestFunctional.yml @@ -114,3 +114,53 @@ jobs: with: name: test_result path: test_result + + Test-Yarn1: + runs-on: ubuntu-latest + needs: Build + steps: + - uses: actions/download-artifact@v3 + with: + name: test-functional-build + + - name: Restore Workspace + run: | + cd ../ + mv ${{ github.workspace }}/drainpipe.zip /tmp/drainpipe.zip + unzip -o /tmp/drainpipe.zip -d ${{ github.workspace }} + cd ${{ github.workspace }} + + - uses: ./drainpipe/scaffold/github/actions/common/set-env + + - name: Install DDEV + uses: ./drainpipe/scaffold/github/actions/common/ddev + with: + git-name: Drainpipe Bot + git-email: no-reply@example.com# + + - name: Start DDEV + run: ddev start + + - name: Setup Nightwatch + run: | + ddev yarn set version classic + ddev yarn init -y + ddev yarn add nightwatch nightwatch-accessibility @lullabot/nightwatch-drupal-command --dev + ddev restart + + - name: Install Drupal + run: | + ddev drush --yes site:install + ddev drush --uri=https://drupal_firefox --yes site:install + ddev drush --uri=https://drupal_chrome --yes site:install + ddev drush config:export --yes + + - name: Run Functional Tests + run: ddev task test:functional + + - name: Upload test artifacts + if: ${{ always() }} + uses: actions/upload-artifact@v2 + with: + name: test_result + path: test_result From be331ecd88a1ad21214b9761e1278d330f6167b0 Mon Sep 17 00:00:00 2001 From: Sally Young Date: Wed, 5 Jul 2023 12:34:10 +0100 Subject: [PATCH 18/31] Fix package name --- .github/workflows/TestFunctional.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/TestFunctional.yml b/.github/workflows/TestFunctional.yml index 1ec3268af..9c65e4cf2 100644 --- a/.github/workflows/TestFunctional.yml +++ b/.github/workflows/TestFunctional.yml @@ -115,7 +115,7 @@ jobs: name: test_result path: test_result - Test-Yarn1: + Test-Yarn-Classic: runs-on: ubuntu-latest needs: Build steps: @@ -145,7 +145,7 @@ jobs: run: | ddev yarn set version classic ddev yarn init -y - ddev yarn add nightwatch nightwatch-accessibility @lullabot/nightwatch-drupal-command --dev + ddev yarn add nightwatch nightwatch-accessibility @lullabot/nightwatch-drupal-commands --dev ddev restart - name: Install Drupal From 05240113cd49a87a844a5e9dce3b39fdae9a9ef6 Mon Sep 17 00:00:00 2001 From: Sally Young Date: Wed, 5 Jul 2023 12:43:58 +0100 Subject: [PATCH 19/31] Test Yarn Berry with the node-modules node linker --- .github/workflows/TestFunctional.yml | 51 ++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/.github/workflows/TestFunctional.yml b/.github/workflows/TestFunctional.yml index 9c65e4cf2..4b149ebce 100644 --- a/.github/workflows/TestFunctional.yml +++ b/.github/workflows/TestFunctional.yml @@ -164,3 +164,54 @@ jobs: with: name: test_result path: test_result + + Test-Yarn-Berry-Node-Linker: + runs-on: ubuntu-latest + needs: Build + steps: + - uses: actions/download-artifact@v3 + with: + name: test-functional-build + + - name: Restore Workspace + run: | + cd ../ + mv ${{ github.workspace }}/drainpipe.zip /tmp/drainpipe.zip + unzip -o /tmp/drainpipe.zip -d ${{ github.workspace }} + cd ${{ github.workspace }} + + - uses: ./drainpipe/scaffold/github/actions/common/set-env + + - name: Install DDEV + uses: ./drainpipe/scaffold/github/actions/common/ddev + with: + git-name: Drainpipe Bot + git-email: no-reply@example.com# + + - name: Start DDEV + run: ddev start + + - name: Setup Nightwatch + run: | + ddev yarn set version berry + ddev yarn init -y + yarn config set nodeLinker node-modules + ddev yarn add nightwatch nightwatch-accessibility @lullabot/nightwatch-drupal-commands --dev + ddev restart + + - name: Install Drupal + run: | + ddev drush --yes site:install + ddev drush --uri=https://drupal_firefox --yes site:install + ddev drush --uri=https://drupal_chrome --yes site:install + ddev drush config:export --yes + + - name: Run Functional Tests + run: ddev task test:functional + + - name: Upload test artifacts + if: ${{ always() }} + uses: actions/upload-artifact@v2 + with: + name: test_result + path: test_result From 0b8fdd8684edf9f2f30e5f2a452ec6a3ffea5eef Mon Sep 17 00:00:00 2001 From: Sally Young Date: Wed, 5 Jul 2023 13:40:13 +0100 Subject: [PATCH 20/31] Add a test for Yarn Berry --- .github/workflows/TestFunctional.yml | 50 ++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/.github/workflows/TestFunctional.yml b/.github/workflows/TestFunctional.yml index 4b149ebce..7593bedc1 100644 --- a/.github/workflows/TestFunctional.yml +++ b/.github/workflows/TestFunctional.yml @@ -215,3 +215,53 @@ jobs: with: name: test_result path: test_result + + Test-Yarn-Berry: + runs-on: ubuntu-latest + needs: Build + steps: + - uses: actions/download-artifact@v3 + with: + name: test-functional-build + + - name: Restore Workspace + run: | + cd ../ + mv ${{ github.workspace }}/drainpipe.zip /tmp/drainpipe.zip + unzip -o /tmp/drainpipe.zip -d ${{ github.workspace }} + cd ${{ github.workspace }} + + - uses: ./drainpipe/scaffold/github/actions/common/set-env + + - name: Install DDEV + uses: ./drainpipe/scaffold/github/actions/common/ddev + with: + git-name: Drainpipe Bot + git-email: no-reply@example.com# + + - name: Start DDEV + run: ddev start + + - name: Setup Nightwatch + run: | + ddev yarn set version berry + ddev yarn init -y + ddev yarn add nightwatch nightwatch-accessibility @lullabot/nightwatch-drupal-commands --dev + ddev restart + + - name: Install Drupal + run: | + ddev drush --yes site:install + ddev drush --uri=https://drupal_firefox --yes site:install + ddev drush --uri=https://drupal_chrome --yes site:install + ddev drush config:export --yes + + - name: Run Functional Tests + run: ddev task test:functional + + - name: Upload test artifacts + if: ${{ always() }} + uses: actions/upload-artifact@v2 + with: + name: test_result + path: test_result From d1270fc822062b8a4c23c5a8360b6cb1df5a913f Mon Sep 17 00:00:00 2001 From: Sally Young Date: Wed, 5 Jul 2023 14:05:26 +0100 Subject: [PATCH 21/31] Remove unecessary ddev restart --- .github/workflows/TestFunctional.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/TestFunctional.yml b/.github/workflows/TestFunctional.yml index 7593bedc1..108a8c7a1 100644 --- a/.github/workflows/TestFunctional.yml +++ b/.github/workflows/TestFunctional.yml @@ -96,7 +96,6 @@ jobs: run: | ddev npm init -y ddev npm install nightwatch nightwatch-accessibility @lullabot/nightwatch-drupal-commands --save-dev - ddev restart - name: Install Drupal run: | @@ -146,7 +145,6 @@ jobs: ddev yarn set version classic ddev yarn init -y ddev yarn add nightwatch nightwatch-accessibility @lullabot/nightwatch-drupal-commands --dev - ddev restart - name: Install Drupal run: | @@ -197,7 +195,6 @@ jobs: ddev yarn init -y yarn config set nodeLinker node-modules ddev yarn add nightwatch nightwatch-accessibility @lullabot/nightwatch-drupal-commands --dev - ddev restart - name: Install Drupal run: | @@ -247,7 +244,6 @@ jobs: ddev yarn set version berry ddev yarn init -y ddev yarn add nightwatch nightwatch-accessibility @lullabot/nightwatch-drupal-commands --dev - ddev restart - name: Install Drupal run: | From 26bfaeb0f73690ac3a53d3b08d18ef7c9fe27ca5 Mon Sep 17 00:00:00 2001 From: Sally Young Date: Wed, 5 Jul 2023 14:06:55 +0100 Subject: [PATCH 22/31] Fix the Sass compilation --- tasks/sass.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/sass.yml b/tasks/sass.yml index 61e2121d1..6fc5851bd 100644 --- a/tasks/sass.yml +++ b/tasks/sass.yml @@ -26,9 +26,9 @@ tasks: - | if [ "{{.DRAINPIPE_SASS}}" == "" ]; then echo "🪠 Nothing provided for Sass to compile"; exit 0; fi FILES="{{if .DRAINPIPE_SASS}}{{.DRAINPIPE_SASS | catLines | trim}}{{end}}" - COMMAND="node ./node_modules/.bin/drainpipe-sass" + COMMAND="npx dt addrainpipe-sass" if [ -f "yarn.lock" ]; then - COMMAND="yarn $COMMAND" + COMMAND="yarn drainpipe-sass" fi $COMMAND --files="$FILES"{{.args}} watch: From 332b8dd720a47a1c48a9b2ba5b99e6b2f9dc97e1 Mon Sep 17 00:00:00 2001 From: Sally Young Date: Wed, 5 Jul 2023 16:07:48 +0100 Subject: [PATCH 23/31] Fix missing dependency that nightwatch has used --- .github/workflows/TestFunctional.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/TestFunctional.yml b/.github/workflows/TestFunctional.yml index 108a8c7a1..66c65df4f 100644 --- a/.github/workflows/TestFunctional.yml +++ b/.github/workflows/TestFunctional.yml @@ -244,6 +244,10 @@ jobs: ddev yarn set version berry ddev yarn init -y ddev yarn add nightwatch nightwatch-accessibility @lullabot/nightwatch-drupal-commands --dev + echo "packageExtensions:" >> .yarnrc.yml + echo ' "nightwatch@*":' >> .yarnrc.yml + echo ' dependencies:' >> .yarnrc.yml + echo ' ws: "*"' >> .yarnrc.yml - name: Install Drupal run: | From 81f05202d4137a52d6070613febb93e1ff996a36 Mon Sep 17 00:00:00 2001 From: Sally Young Date: Wed, 5 Jul 2023 16:17:12 +0100 Subject: [PATCH 24/31] Re-run yarn --- .github/workflows/TestFunctional.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/TestFunctional.yml b/.github/workflows/TestFunctional.yml index 66c65df4f..722941dbc 100644 --- a/.github/workflows/TestFunctional.yml +++ b/.github/workflows/TestFunctional.yml @@ -248,6 +248,7 @@ jobs: echo ' "nightwatch@*":' >> .yarnrc.yml echo ' dependencies:' >> .yarnrc.yml echo ' ws: "*"' >> .yarnrc.yml + yarn - name: Install Drupal run: | From f0329d60516d2e8ec4bce68bedcd62f7c4b990cc Mon Sep 17 00:00:00 2001 From: Sally Young Date: Wed, 5 Jul 2023 16:33:01 +0100 Subject: [PATCH 25/31] Add ws --- .github/workflows/TestFunctional.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/TestFunctional.yml b/.github/workflows/TestFunctional.yml index 722941dbc..13a448fe1 100644 --- a/.github/workflows/TestFunctional.yml +++ b/.github/workflows/TestFunctional.yml @@ -243,7 +243,7 @@ jobs: run: | ddev yarn set version berry ddev yarn init -y - ddev yarn add nightwatch nightwatch-accessibility @lullabot/nightwatch-drupal-commands --dev + ddev yarn add nightwatch nightwatch-accessibility @lullabot/nightwatch-drupal-commands ws --dev echo "packageExtensions:" >> .yarnrc.yml echo ' "nightwatch@*":' >> .yarnrc.yml echo ' dependencies:' >> .yarnrc.yml From 97ba7854ef0fbe97d0d3e12d7bd265632e2f07df Mon Sep 17 00:00:00 2001 From: Sally Young Date: Wed, 5 Jul 2023 16:42:32 +0100 Subject: [PATCH 26/31] Add ws later --- .github/workflows/TestFunctional.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/TestFunctional.yml b/.github/workflows/TestFunctional.yml index 13a448fe1..c42425c71 100644 --- a/.github/workflows/TestFunctional.yml +++ b/.github/workflows/TestFunctional.yml @@ -243,11 +243,11 @@ jobs: run: | ddev yarn set version berry ddev yarn init -y - ddev yarn add nightwatch nightwatch-accessibility @lullabot/nightwatch-drupal-commands ws --dev echo "packageExtensions:" >> .yarnrc.yml echo ' "nightwatch@*":' >> .yarnrc.yml echo ' dependencies:' >> .yarnrc.yml echo ' ws: "*"' >> .yarnrc.yml + ddev yarn add nightwatch nightwatch-accessibility @lullabot/nightwatch-drupal-commands ws --dev yarn - name: Install Drupal From 5033711b64b0405eae5155e457d5216a9206fa01 Mon Sep 17 00:00:00 2001 From: Sally Young Date: Tue, 25 Jul 2023 16:00:30 +0100 Subject: [PATCH 27/31] remove wd/hub --- scaffold/phpunit-testtraits.xml | 4 ++-- scaffold/phpunit.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scaffold/phpunit-testtraits.xml b/scaffold/phpunit-testtraits.xml index 4f6163e8c..44e7b6cfa 100644 --- a/scaffold/phpunit-testtraits.xml +++ b/scaffold/phpunit-testtraits.xml @@ -26,10 +26,10 @@ --> - + - + diff --git a/scaffold/phpunit.xml b/scaffold/phpunit.xml index 383b5b680..f95b90baa 100644 --- a/scaffold/phpunit.xml +++ b/scaffold/phpunit.xml @@ -26,7 +26,7 @@ --> - + From a21b31bf3b21d0e753a65a63a7cd5999f5fe3eee Mon Sep 17 00:00:00 2001 From: Sally Young Date: Tue, 25 Jul 2023 16:17:09 +0100 Subject: [PATCH 28/31] Chrome options --- .github/workflows/{test-phpunit.yml => TestPHPUnit.yml} | 0 scaffold/phpunit-testtraits.xml | 4 ++-- scaffold/phpunit.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename .github/workflows/{test-phpunit.yml => TestPHPUnit.yml} (100%) diff --git a/.github/workflows/test-phpunit.yml b/.github/workflows/TestPHPUnit.yml similarity index 100% rename from .github/workflows/test-phpunit.yml rename to .github/workflows/TestPHPUnit.yml diff --git a/scaffold/phpunit-testtraits.xml b/scaffold/phpunit-testtraits.xml index 44e7b6cfa..85efdfd8a 100644 --- a/scaffold/phpunit-testtraits.xml +++ b/scaffold/phpunit-testtraits.xml @@ -26,10 +26,10 @@ --> - + - + diff --git a/scaffold/phpunit.xml b/scaffold/phpunit.xml index f95b90baa..5f3f9d1d2 100644 --- a/scaffold/phpunit.xml +++ b/scaffold/phpunit.xml @@ -26,7 +26,7 @@ --> - + From 95f0c4f707953865b00e24d313cd57cd0b2524c9 Mon Sep 17 00:00:00 2001 From: Sally Young Date: Tue, 25 Jul 2023 16:54:10 +0100 Subject: [PATCH 29/31] try firefox --- scaffold/phpunit-testtraits.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scaffold/phpunit-testtraits.xml b/scaffold/phpunit-testtraits.xml index 85efdfd8a..3be53d011 100644 --- a/scaffold/phpunit-testtraits.xml +++ b/scaffold/phpunit-testtraits.xml @@ -26,10 +26,10 @@ --> - + - + From c85aa3ac0fe4609e7913176710fa954f20d994bb Mon Sep 17 00:00:00 2001 From: Sally Young Date: Tue, 25 Jul 2023 18:02:59 +0100 Subject: [PATCH 30/31] try a fork --- .github/workflows/TestPHPUnit.yml | 2 +- scaffold/phpunit-testtraits.xml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/TestPHPUnit.yml b/.github/workflows/TestPHPUnit.yml index 28169a7fe..1f43eff65 100644 --- a/.github/workflows/TestPHPUnit.yml +++ b/.github/workflows/TestPHPUnit.yml @@ -118,7 +118,7 @@ jobs: ddev composer config repositories.drainpipe-dev --json '{"type": "path", "url": "drainpipe-dev", "options": {"symlink": false}}' ddev composer config minimum-stability dev ddev composer require "lullabot/drainpipe @dev" --with-all-dependencies - ddev composer require "lullabot/drainpipe-dev @dev" weitzman/drupal-test-traits behat/mink-selenium2-driver --dev --with-all-dependencies + ddev composer require "lullabot/drainpipe-dev @dev" weitzman/drupal-test-traits oleg-andreyev/mink-phpwebdriver --dev --with-all-dependencies # Restart is required to enable the provided Selenium containers ddev restart diff --git a/scaffold/phpunit-testtraits.xml b/scaffold/phpunit-testtraits.xml index 3be53d011..85efdfd8a 100644 --- a/scaffold/phpunit-testtraits.xml +++ b/scaffold/phpunit-testtraits.xml @@ -26,10 +26,10 @@ --> - + - + From 40d7ea181bbcd8c73b4b32d97025afa46f3d518f Mon Sep 17 00:00:00 2001 From: Sally Young Date: Wed, 26 Jul 2023 01:02:28 +0100 Subject: [PATCH 31/31] Downgrade selenium --- .github/workflows/TestPHPUnit.yml | 2 +- .../scaffold/nightwatch/docker-compose.selenium.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/TestPHPUnit.yml b/.github/workflows/TestPHPUnit.yml index 1f43eff65..28169a7fe 100644 --- a/.github/workflows/TestPHPUnit.yml +++ b/.github/workflows/TestPHPUnit.yml @@ -118,7 +118,7 @@ jobs: ddev composer config repositories.drainpipe-dev --json '{"type": "path", "url": "drainpipe-dev", "options": {"symlink": false}}' ddev composer config minimum-stability dev ddev composer require "lullabot/drainpipe @dev" --with-all-dependencies - ddev composer require "lullabot/drainpipe-dev @dev" weitzman/drupal-test-traits oleg-andreyev/mink-phpwebdriver --dev --with-all-dependencies + ddev composer require "lullabot/drainpipe-dev @dev" weitzman/drupal-test-traits behat/mink-selenium2-driver --dev --with-all-dependencies # Restart is required to enable the provided Selenium containers ddev restart diff --git a/drainpipe-dev/scaffold/nightwatch/docker-compose.selenium.yaml b/drainpipe-dev/scaffold/nightwatch/docker-compose.selenium.yaml index 7d3d72d09..093d9171e 100644 --- a/drainpipe-dev/scaffold/nightwatch/docker-compose.selenium.yaml +++ b/drainpipe-dev/scaffold/nightwatch/docker-compose.selenium.yaml @@ -3,7 +3,7 @@ version: '3.6' services: chrome: container_name: ddev-${DDEV_SITENAME}-chrome - image: seleniarm/standalone-chromium:4.10.0 + image: seleniarm/standalone-chromium:4.1.2-20220227 labels: com.ddev.site-name: ${DDEV_SITENAME} com.ddev.approot: $DDEV_APPROOT @@ -29,7 +29,7 @@ services: firefox: container_name: ddev-${DDEV_SITENAME}-firefox - image: seleniarm/standalone-firefox:4.10.0 + image: seleniarm/standalone-firefox:4.1.2-20220227 labels: com.ddev.site-name: ${DDEV_SITENAME} com.ddev.approot: $DDEV_APPROOT