From c057f9c5a9d035b6d08841fba3a5df05f933ac27 Mon Sep 17 00:00:00 2001 From: Volker Killesreiter Date: Mon, 9 May 2022 13:45:53 +0200 Subject: [PATCH 01/20] try --- .github/workflows/tests.yml | 243 ++---------------------------------- 1 file changed, 7 insertions(+), 236 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 772186c8c..63b6cd7aa 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -98,7 +98,7 @@ jobs: name: build-${{ matrix.PHP_VERSION }} path: build-${{ matrix.PHP_VERSION }}.tgz - test-max: + test-config: needs: build runs-on: ubuntu-20.04 @@ -148,243 +148,14 @@ jobs: - name: Unzip build artifact run: mkdir -p /tmp/test; tar xCfz /tmp/test build-${{ matrix.PHP_VERSION }}/build-${{ matrix.PHP_VERSION }}.tgz thunder; rm -rf build-${{ matrix.PHP_VERSION }} - - name: Setup Apache - uses: thunder/apache-shiva-php-action@v1 - with: - php-version: ${{ matrix.PHP_VERSION }} - site-directory: /tmp/test/thunder/install/docroot - http-port: ${{ env.DRUPAL_TESTING_HTTP_PORT }} - - - name: Run tests - run: test-drupal-project run_tests - env: - THUNDER_TEST_CHUNK: ${{ matrix.CHUNK }} - DRUPAL_TESTING_TEST_PATH: /tmp/test/thunder/install/docroot/profiles/contrib/thunder/tests/src/TestSuites/ThunderTestSuite.php - - test-upgrade: - - runs-on: ubuntu-20.04 - - services: - mysql: - image: mariadb:latest - env: - MYSQL_ROOT_PASSWORD: root - ports: - - 3306:3306 - selenium: - image: selenium/standalone-chrome - options: --shm-size 2g --add-host=thunder-testing:host-gateway --name selenium - ports: - - 4444:4444 - - strategy: - matrix: - PHP_VERSION: [ '7.4' ] - - if: ${{ contains(github.event.pull_request.labels.*.name, 'test-upgrade') || github.event_name == 'schedule' }} - - env: - DRUPAL_TESTING_TEST_GROUP_EXCLUDE: "NoUpdate" - DRUPAL_TESTING_TEST_GROUP: Thunder - - steps: - - uses: actions/checkout@v1 - - - uses: shivammathur/setup-php@v2 - with: - coverage: none - php-version: ${{ matrix.PHP_VERSION }} - extensions: Imagick, gd, pdo_mysql - - - name: Cache composer dependencies - uses: actions/cache@v1 - with: - path: ~/.composer/cache - key: ${{ runner.os }}-composer-cache-${{ hashFiles('**/composer.json') }} - restore-keys: ${{ runner.os }}-composer-cache- - - - name: Prepare fixtures - run: docker cp ./tests/fixtures selenium:/fixtures - - - name: Add host - run: echo "127.0.0.1 thunder-testing" | sudo tee -a /etc/hosts - - - name: Get build environment - run: composer global require thunder/drupal-testing:${DRUPAL_TESTING_VERSION} - - - name: Prepare the build - run: test-drupal-project prepare_build - - - name: Use Thunder 6 lockfile - run: | - touch /tmp/test/thunder/finished-stages/build - cp ${GITHUB_WORKSPACE}/tests/fixtures/thunder6.composer.lock composer.lock - composer install - working-directory: /tmp/test/thunder/install - - - name: Install drupal - run: test-drupal-project install - - name: Update the docroot run: | - composer remove thunder/thunder-distribution --no-update - composer config name "drupal-testing-thunder/thunder-distribution" --working-dir="${GITHUB_WORKSPACE}" - composer require "drupal-testing-thunder/thunder-distribution:*" --no-update - - composer update - composer exec -- drush updb -y - - cd docroot - php core/scripts/db-tools.php dump-database-d8-mysql > db-dump.php - working-directory: /tmp/test/thunder/install - - - name: Setup Apache - uses: thunder/apache-shiva-php-action@v1 - with: - php-version: ${{ matrix.PHP_VERSION }} - site-directory: /tmp/test/thunder/install/docroot - http-port: ${{ env.DRUPAL_TESTING_HTTP_PORT }} - - - name: Run tests suite - run: test-drupal-project run_tests - - test-min: - - runs-on: ubuntu-20.04 - - services: - mysql: - image: mariadb:latest - env: - MYSQL_ROOT_PASSWORD: root - ports: - - 3306:3306 - selenium: - image: selenium/standalone-chrome - options: --shm-size 2g --add-host=thunder-testing:host-gateway --name selenium - ports: - - 4444:4444 - - strategy: - matrix: - PHP_VERSION: [ '7.4' ] - - if: ${{ contains(github.event.pull_request.labels.*.name, 'test-min') || github.event_name == 'schedule' }} - - env: - DRUPAL_TESTING_DRUPAL_VERSION: '~9.3.0' - DRUPAL_TESTING_TEST_GROUP: Thunder - - steps: - - uses: actions/checkout@v1 - - - uses: shivammathur/setup-php@v2 - with: - coverage: none - php-version: ${{ matrix.PHP_VERSION }} - extensions: Imagick, gd, pdo_mysql - - - name: Cache composer dependencies - uses: actions/cache@v1 - with: - path: ~/.composer/cache - key: ${{ runner.os }}-composer-cache-${{ hashFiles('**/composer.json') }} - restore-keys: ${{ runner.os }}-composer-cache- - - - name: Prepare fixtures - run: docker cp ./tests/fixtures selenium:/fixtures - - - name: Add host - run: echo "127.0.0.1 thunder-testing" | sudo tee -a /etc/hosts - - - name: Get build environment - run: | - composer self-update - composer global require thunder/drupal-testing:${DRUPAL_TESTING_VERSION} - - - name: Prepare the build - run: test-drupal-project prepare_build - - - name: Install suggested dependencies - run: composer require "drupal/core-dev:~9.3.0" "consolidation/robo:^2.0" --no-update --no-progress --working-dir=/tmp/test/thunder/install - - - name: Build the docroot - run: test-drupal-project build - env: - DRUPAL_TESTING_MIN_BUILD: true - - - name: Setup Apache - uses: thunder/apache-shiva-php-action@v1 - with: - php-version: ${{ matrix.PHP_VERSION }} - site-directory: /tmp/test/thunder/install/docroot - http-port: ${{ env.DRUPAL_TESTING_HTTP_PORT }} - - - name: Run the tests - run: test-drupal-project run_tests - - test-performance: - needs: [build, test-max] - - runs-on: ubuntu-20.04 - - if: ${{ contains(github.event.pull_request.labels.*.name, 'test-performance') || github.event_name == 'schedule' }} - - steps: - - uses: actions/checkout@v1 - with: - repository: thunder/docker-thunder-performance - path: thunder-distribution/docker-thunder-performance - ref: 'master' - - - uses: shivammathur/setup-php@master - with: - coverage: none - php-version: '7.4' - extensions: Imagick - - - name: Download build - uses: actions/download-artifact@v1 - with: - name: build-7.4 - - - name: Unzip build artifact - run: mkdir -p /tmp/test; tar xCfz /tmp/test build-7.4/build-7.4.tgz thunder; rm -rf build-7.4; mv /tmp/test/thunder/install ${GITHUB_WORKSPACE}/docker-thunder-performance/www - - - name: Set variables - id: vars - # GITHUB_HEAD_REF is only defined in PRs. GITHUB_REF is on the default branch something like refs/heads/8.x-4.x. - # So if GITHUB_HEAD_REF is not defined we use GITHUB_REF and remove leading refs/heads/. On the result / will replaced by _ - run: | - echo ::set-output name=DOCKER_SANITIZED_BRANCH_NAME::$(echo ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} | sed 's/\//_/g') - echo ::set-output name=DOCKER_TAG::$(echo ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} | sed 's/\//_/g')-${{ github.run_id }} - - - name: Create image and push to registry - working-directory: docker-thunder-performance - run: | - echo ${{ secrets.DOCKER_TOKEN }} | docker login -u thundertechnology --password-stdin - export DOCKER_IMAGE_TAG="burda/thunder-performance:${{ steps.vars.outputs.DOCKER_TAG }}" - chmod u+w www/docroot/sites/default - bash -x ./build.sh --tag "${DOCKER_IMAGE_TAG}" - docker push "${DOCKER_IMAGE_TAG}" - - - name: Start Thunder performance testing task for created image - run: | - API_CALL_HTTP_CODE=$(curl \ - --request POST \ - --insecure \ - "https://${{ secrets.THUNDER_PTM_HOST }}:3000/warmers" \ - --header "Authorization: Bearer ${{ secrets.THUNDER_PTM_TOKEN }}" \ - --header "Content-Type: application/json" \ - --data "{\"branchTag\":\"${{ steps.vars.outputs.DOCKER_SANITIZED_BRANCH_NAME }}\",\"imageTag\":\"${{ steps.vars.outputs.DOCKER_TAG }}\",\"composeType\":\"default\"}" \ - --output /dev/stderr \ - --write-out "%{http_code}" \ - ) - - if [[ "${API_CALL_HTTP_CODE}" != "200" ]]; then - exit 1 - fi + ls -alh + composer require config_profile + vendor/bin/drush cex + cd docroot/profile/contrib/thunder + git clean -fd + git status # Start a debug session. # - name: Setup tmate session From 927b4bef8c543b1ae58c34568eac3cff333abba7 Mon Sep 17 00:00:00 2001 From: Volker Killesreiter Date: Mon, 9 May 2022 13:51:27 +0200 Subject: [PATCH 02/20] huch --- .github/workflows/tests.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 63b6cd7aa..a94931c4e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -119,9 +119,7 @@ jobs: strategy: fail-fast: false matrix: - PHP_VERSION: [ '7.4', '8.1' ] - CHUNK: [ 1, 2, 3 ] - + PHP_VERSION: [ '8.1' ] steps: - uses: actions/checkout@v1 @@ -151,7 +149,7 @@ jobs: - name: Update the docroot run: | ls -alh - composer require config_profile + composer require drupal/config_profile vendor/bin/drush cex cd docroot/profile/contrib/thunder git clean -fd From a82862427b17afab5e41e52b1f13c48e8b66e989 Mon Sep 17 00:00:00 2001 From: Volker Killesreiter Date: Mon, 9 May 2022 14:31:09 +0200 Subject: [PATCH 03/20] anodda --- .github/workflows/tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a94931c4e..0495388a7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -146,7 +146,8 @@ jobs: - name: Unzip build artifact run: mkdir -p /tmp/test; tar xCfz /tmp/test build-${{ matrix.PHP_VERSION }}/build-${{ matrix.PHP_VERSION }}.tgz thunder; rm -rf build-${{ matrix.PHP_VERSION }} - - name: Update the docroot + - name: Check profile config + working-directory: /tmp/test/thunder/install/docroot run: | ls -alh composer require drupal/config_profile From af008fd67592e3ba7288b4a5675f10fd77108539 Mon Sep 17 00:00:00 2001 From: Volker Killesreiter Date: Wed, 11 May 2022 09:13:11 +0200 Subject: [PATCH 04/20] lets take a look --- .github/workflows/tests.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0495388a7..13a9ba502 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -146,6 +146,10 @@ jobs: - name: Unzip build artifact run: mkdir -p /tmp/test; tar xCfz /tmp/test build-${{ matrix.PHP_VERSION }}/build-${{ matrix.PHP_VERSION }}.tgz thunder; rm -rf build-${{ matrix.PHP_VERSION }} + + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 + - name: Check profile config working-directory: /tmp/test/thunder/install/docroot run: | @@ -156,6 +160,3 @@ jobs: git clean -fd git status -# Start a debug session. -# - name: Setup tmate session -# uses: mxschmitt/action-tmate@v3 From 99183a669188ad7f3dd0f1148f374e58c558e1b8 Mon Sep 17 00:00:00 2001 From: Volker Killesreiter Date: Wed, 11 May 2022 09:30:09 +0200 Subject: [PATCH 05/20] is it there --- .github/workflows/tests.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 13a9ba502..ccf04dad2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -146,12 +146,11 @@ jobs: - name: Unzip build artifact run: mkdir -p /tmp/test; tar xCfz /tmp/test build-${{ matrix.PHP_VERSION }}/build-${{ matrix.PHP_VERSION }}.tgz thunder; rm -rf build-${{ matrix.PHP_VERSION }} - - - name: Setup tmate session - uses: mxschmitt/action-tmate@v3 +# - name: Setup tmate session +# uses: mxschmitt/action-tmate@v3 - name: Check profile config - working-directory: /tmp/test/thunder/install/docroot + working-directory: /tmp/test/thunder/install run: | ls -alh composer require drupal/config_profile From 014a92fe65e296449d9318a411725dfafc5cc72b Mon Sep 17 00:00:00 2001 From: Volker Killesreiter Date: Thu, 12 May 2022 12:22:33 +0200 Subject: [PATCH 06/20] Do install --- .github/workflows/tests.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ccf04dad2..a0a06b8c6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -149,6 +149,11 @@ jobs: # - name: Setup tmate session # uses: mxschmitt/action-tmate@v3 + - name: Do install + run: test-drupal-project install + env: + DRUPAL_TESTING_TEST_PATH: /tmp/test/thunder/install/docroot/profiles/contrib/thunder/tests/src/TestSuites/ThunderTestSuite.php + - name: Check profile config working-directory: /tmp/test/thunder/install run: | From 996954d196fa42a74a584923af22d0171eed5605 Mon Sep 17 00:00:00 2001 From: Volker Killesreiter Date: Thu, 12 May 2022 13:08:29 +0200 Subject: [PATCH 07/20] hmm --- .github/workflows/tests.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a0a06b8c6..899f68b87 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -146,14 +146,15 @@ jobs: - name: Unzip build artifact run: mkdir -p /tmp/test; tar xCfz /tmp/test build-${{ matrix.PHP_VERSION }}/build-${{ matrix.PHP_VERSION }}.tgz thunder; rm -rf build-${{ matrix.PHP_VERSION }} -# - name: Setup tmate session -# uses: mxschmitt/action-tmate@v3 - name: Do install run: test-drupal-project install env: DRUPAL_TESTING_TEST_PATH: /tmp/test/thunder/install/docroot/profiles/contrib/thunder/tests/src/TestSuites/ThunderTestSuite.php + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 + - name: Check profile config working-directory: /tmp/test/thunder/install run: | From 7ec7f0d1f01648e147abd9d7358b4387e1115351 Mon Sep 17 00:00:00 2001 From: Volker Killesreiter Date: Tue, 31 May 2022 08:56:12 +0200 Subject: [PATCH 08/20] reset --- .github/workflows/tests.yml | 250 ++++++++++++++++++++++++++++++++++-- 1 file changed, 237 insertions(+), 13 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 899f68b87..772186c8c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -98,7 +98,7 @@ jobs: name: build-${{ matrix.PHP_VERSION }} path: build-${{ matrix.PHP_VERSION }}.tgz - test-config: + test-max: needs: build runs-on: ubuntu-20.04 @@ -119,7 +119,9 @@ jobs: strategy: fail-fast: false matrix: - PHP_VERSION: [ '8.1' ] + PHP_VERSION: [ '7.4', '8.1' ] + CHUNK: [ 1, 2, 3 ] + steps: - uses: actions/checkout@v1 @@ -146,22 +148,244 @@ jobs: - name: Unzip build artifact run: mkdir -p /tmp/test; tar xCfz /tmp/test build-${{ matrix.PHP_VERSION }}/build-${{ matrix.PHP_VERSION }}.tgz thunder; rm -rf build-${{ matrix.PHP_VERSION }} + - name: Setup Apache + uses: thunder/apache-shiva-php-action@v1 + with: + php-version: ${{ matrix.PHP_VERSION }} + site-directory: /tmp/test/thunder/install/docroot + http-port: ${{ env.DRUPAL_TESTING_HTTP_PORT }} - - name: Do install - run: test-drupal-project install + - name: Run tests + run: test-drupal-project run_tests env: + THUNDER_TEST_CHUNK: ${{ matrix.CHUNK }} DRUPAL_TESTING_TEST_PATH: /tmp/test/thunder/install/docroot/profiles/contrib/thunder/tests/src/TestSuites/ThunderTestSuite.php - - name: Setup tmate session - uses: mxschmitt/action-tmate@v3 + test-upgrade: + + runs-on: ubuntu-20.04 + + services: + mysql: + image: mariadb:latest + env: + MYSQL_ROOT_PASSWORD: root + ports: + - 3306:3306 + selenium: + image: selenium/standalone-chrome + options: --shm-size 2g --add-host=thunder-testing:host-gateway --name selenium + ports: + - 4444:4444 + + strategy: + matrix: + PHP_VERSION: [ '7.4' ] + + if: ${{ contains(github.event.pull_request.labels.*.name, 'test-upgrade') || github.event_name == 'schedule' }} + + env: + DRUPAL_TESTING_TEST_GROUP_EXCLUDE: "NoUpdate" + DRUPAL_TESTING_TEST_GROUP: Thunder + + steps: + - uses: actions/checkout@v1 + + - uses: shivammathur/setup-php@v2 + with: + coverage: none + php-version: ${{ matrix.PHP_VERSION }} + extensions: Imagick, gd, pdo_mysql + + - name: Cache composer dependencies + uses: actions/cache@v1 + with: + path: ~/.composer/cache + key: ${{ runner.os }}-composer-cache-${{ hashFiles('**/composer.json') }} + restore-keys: ${{ runner.os }}-composer-cache- + + - name: Prepare fixtures + run: docker cp ./tests/fixtures selenium:/fixtures + + - name: Add host + run: echo "127.0.0.1 thunder-testing" | sudo tee -a /etc/hosts - - name: Check profile config + - name: Get build environment + run: composer global require thunder/drupal-testing:${DRUPAL_TESTING_VERSION} + + - name: Prepare the build + run: test-drupal-project prepare_build + + - name: Use Thunder 6 lockfile + run: | + touch /tmp/test/thunder/finished-stages/build + cp ${GITHUB_WORKSPACE}/tests/fixtures/thunder6.composer.lock composer.lock + composer install working-directory: /tmp/test/thunder/install + + - name: Install drupal + run: test-drupal-project install + + - name: Update the docroot run: | - ls -alh - composer require drupal/config_profile - vendor/bin/drush cex - cd docroot/profile/contrib/thunder - git clean -fd - git status + composer remove thunder/thunder-distribution --no-update + composer config name "drupal-testing-thunder/thunder-distribution" --working-dir="${GITHUB_WORKSPACE}" + composer require "drupal-testing-thunder/thunder-distribution:*" --no-update + + composer update + composer exec -- drush updb -y + + cd docroot + php core/scripts/db-tools.php dump-database-d8-mysql > db-dump.php + working-directory: /tmp/test/thunder/install + + - name: Setup Apache + uses: thunder/apache-shiva-php-action@v1 + with: + php-version: ${{ matrix.PHP_VERSION }} + site-directory: /tmp/test/thunder/install/docroot + http-port: ${{ env.DRUPAL_TESTING_HTTP_PORT }} + + - name: Run tests suite + run: test-drupal-project run_tests + test-min: + + runs-on: ubuntu-20.04 + + services: + mysql: + image: mariadb:latest + env: + MYSQL_ROOT_PASSWORD: root + ports: + - 3306:3306 + selenium: + image: selenium/standalone-chrome + options: --shm-size 2g --add-host=thunder-testing:host-gateway --name selenium + ports: + - 4444:4444 + + strategy: + matrix: + PHP_VERSION: [ '7.4' ] + + if: ${{ contains(github.event.pull_request.labels.*.name, 'test-min') || github.event_name == 'schedule' }} + + env: + DRUPAL_TESTING_DRUPAL_VERSION: '~9.3.0' + DRUPAL_TESTING_TEST_GROUP: Thunder + + steps: + - uses: actions/checkout@v1 + + - uses: shivammathur/setup-php@v2 + with: + coverage: none + php-version: ${{ matrix.PHP_VERSION }} + extensions: Imagick, gd, pdo_mysql + + - name: Cache composer dependencies + uses: actions/cache@v1 + with: + path: ~/.composer/cache + key: ${{ runner.os }}-composer-cache-${{ hashFiles('**/composer.json') }} + restore-keys: ${{ runner.os }}-composer-cache- + + - name: Prepare fixtures + run: docker cp ./tests/fixtures selenium:/fixtures + + - name: Add host + run: echo "127.0.0.1 thunder-testing" | sudo tee -a /etc/hosts + + - name: Get build environment + run: | + composer self-update + composer global require thunder/drupal-testing:${DRUPAL_TESTING_VERSION} + + - name: Prepare the build + run: test-drupal-project prepare_build + + - name: Install suggested dependencies + run: composer require "drupal/core-dev:~9.3.0" "consolidation/robo:^2.0" --no-update --no-progress --working-dir=/tmp/test/thunder/install + + - name: Build the docroot + run: test-drupal-project build + env: + DRUPAL_TESTING_MIN_BUILD: true + + - name: Setup Apache + uses: thunder/apache-shiva-php-action@v1 + with: + php-version: ${{ matrix.PHP_VERSION }} + site-directory: /tmp/test/thunder/install/docroot + http-port: ${{ env.DRUPAL_TESTING_HTTP_PORT }} + + - name: Run the tests + run: test-drupal-project run_tests + + test-performance: + needs: [build, test-max] + + runs-on: ubuntu-20.04 + + if: ${{ contains(github.event.pull_request.labels.*.name, 'test-performance') || github.event_name == 'schedule' }} + + steps: + - uses: actions/checkout@v1 + with: + repository: thunder/docker-thunder-performance + path: thunder-distribution/docker-thunder-performance + ref: 'master' + + - uses: shivammathur/setup-php@master + with: + coverage: none + php-version: '7.4' + extensions: Imagick + + - name: Download build + uses: actions/download-artifact@v1 + with: + name: build-7.4 + + - name: Unzip build artifact + run: mkdir -p /tmp/test; tar xCfz /tmp/test build-7.4/build-7.4.tgz thunder; rm -rf build-7.4; mv /tmp/test/thunder/install ${GITHUB_WORKSPACE}/docker-thunder-performance/www + + - name: Set variables + id: vars + # GITHUB_HEAD_REF is only defined in PRs. GITHUB_REF is on the default branch something like refs/heads/8.x-4.x. + # So if GITHUB_HEAD_REF is not defined we use GITHUB_REF and remove leading refs/heads/. On the result / will replaced by _ + run: | + echo ::set-output name=DOCKER_SANITIZED_BRANCH_NAME::$(echo ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} | sed 's/\//_/g') + echo ::set-output name=DOCKER_TAG::$(echo ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} | sed 's/\//_/g')-${{ github.run_id }} + + - name: Create image and push to registry + working-directory: docker-thunder-performance + run: | + echo ${{ secrets.DOCKER_TOKEN }} | docker login -u thundertechnology --password-stdin + export DOCKER_IMAGE_TAG="burda/thunder-performance:${{ steps.vars.outputs.DOCKER_TAG }}" + chmod u+w www/docroot/sites/default + bash -x ./build.sh --tag "${DOCKER_IMAGE_TAG}" + docker push "${DOCKER_IMAGE_TAG}" + + - name: Start Thunder performance testing task for created image + run: | + API_CALL_HTTP_CODE=$(curl \ + --request POST \ + --insecure \ + "https://${{ secrets.THUNDER_PTM_HOST }}:3000/warmers" \ + --header "Authorization: Bearer ${{ secrets.THUNDER_PTM_TOKEN }}" \ + --header "Content-Type: application/json" \ + --data "{\"branchTag\":\"${{ steps.vars.outputs.DOCKER_SANITIZED_BRANCH_NAME }}\",\"imageTag\":\"${{ steps.vars.outputs.DOCKER_TAG }}\",\"composeType\":\"default\"}" \ + --output /dev/stderr \ + --write-out "%{http_code}" \ + ) + + if [[ "${API_CALL_HTTP_CODE}" != "200" ]]; then + exit 1 + fi + +# Start a debug session. +# - name: Setup tmate session +# uses: mxschmitt/action-tmate@v3 From 0a4387c82ad7caf00d1280d8b1d9a5dcef6fb459 Mon Sep 17 00:00:00 2001 From: Volker Killesreiter Date: Tue, 31 May 2022 09:03:06 +0200 Subject: [PATCH 09/20] lets see --- .github/workflows/tests.yml | 122 ++++++++++++++++++++---------------- 1 file changed, 68 insertions(+), 54 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 772186c8c..33b01429f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -32,6 +32,8 @@ jobs: runs-on: ubuntu-20.04 + if: ${{ contains(github.event.pull_request.labels.*.name, 'test-regular') || github.event_name == 'schedule' }} + services: mysql: image: mariadb:latest @@ -103,6 +105,8 @@ jobs: runs-on: ubuntu-20.04 + if: ${{ contains(github.event.pull_request.labels.*.name, 'test-regular') || github.event_name == 'schedule' }} + services: mysql: image: mariadb:latest @@ -182,7 +186,7 @@ jobs: matrix: PHP_VERSION: [ '7.4' ] - if: ${{ contains(github.event.pull_request.labels.*.name, 'test-upgrade') || github.event_name == 'schedule' }} +# if: ${{ contains(github.event.pull_request.labels.*.name, 'test-upgrade') || github.event_name == 'schedule' }} env: DRUPAL_TESTING_TEST_GROUP_EXCLUDE: "NoUpdate" @@ -237,17 +241,28 @@ jobs: cd docroot php core/scripts/db-tools.php dump-database-d8-mysql > db-dump.php + composer exec -- drush sql-dump > dump.sql + working-directory: /tmp/test/thunder/install - - name: Setup Apache - uses: thunder/apache-shiva-php-action@v1 - with: - php-version: ${{ matrix.PHP_VERSION }} - site-directory: /tmp/test/thunder/install/docroot - http-port: ${{ env.DRUPAL_TESTING_HTTP_PORT }} + - name: Zip build + run: cd /tmp/test; tar cfz upgrade-${{ matrix.PHP_VERSION }}.tgz thunder; mv upgrade-${{ matrix.PHP_VERSION }}.tgz ${GITHUB_WORKSPACE} - - name: Run tests suite - run: test-drupal-project run_tests + - name: Upload build + uses: actions/upload-artifact@v2 + with: + name: upgrade-${{ matrix.PHP_VERSION }} + path: upgrade-${{ matrix.PHP_VERSION }}.tgz + +# - name: Setup Apache +# uses: thunder/apache-shiva-php-action@v1 +# with: +# php-version: ${{ matrix.PHP_VERSION }} +# site-directory: /tmp/test/thunder/install/docroot +# http-port: ${{ env.DRUPAL_TESTING_HTTP_PORT }} +# +# - name: Run tests suite +# run: test-drupal-project run_tests test-min: @@ -324,67 +339,66 @@ jobs: - name: Run the tests run: test-drupal-project run_tests - test-performance: - needs: [build, test-max] + test-config: + needs: build runs-on: ubuntu-20.04 - if: ${{ contains(github.event.pull_request.labels.*.name, 'test-performance') || github.event_name == 'schedule' }} + services: + mysql: + image: mariadb:latest + env: + MYSQL_ROOT_PASSWORD: root + ports: + - 3306:3306 + selenium: + image: selenium/standalone-chrome + options: --shm-size 2g --add-host=thunder-testing:host-gateway --name selenium + ports: + - 4444:4444 + strategy: + fail-fast: false + matrix: + PHP_VERSION: [ '8.1' ] steps: - uses: actions/checkout@v1 - with: - repository: thunder/docker-thunder-performance - path: thunder-distribution/docker-thunder-performance - ref: 'master' - - uses: shivammathur/setup-php@master + - uses: shivammathur/setup-php@v2 with: coverage: none - php-version: '7.4' - extensions: Imagick + php-version: ${{ matrix.PHP_VERSION }} + extensions: :sodium, Imagick, gd, PDO, mysql, pdo_mysql, mbstring, xmlwriter, pdo, date, dom, filter, hash, json, pcre, session, SimpleXML, SPL, tokenizer, xml, curl - - name: Download build + - name: Add host + run: echo "127.0.0.1 thunder-testing" | sudo tee -a /etc/hosts + + - name: Prepare fixtures + run: docker cp ./tests/fixtures selenium:/fixtures + + - name: Get build environment + run: composer global require thunder/drupal-testing:${DRUPAL_TESTING_VERSION} + + - name: Download upgrade build uses: actions/download-artifact@v1 with: - name: build-7.4 - - - name: Unzip build artifact - run: mkdir -p /tmp/test; tar xCfz /tmp/test build-7.4/build-7.4.tgz thunder; rm -rf build-7.4; mv /tmp/test/thunder/install ${GITHUB_WORKSPACE}/docker-thunder-performance/www + name: upgrade-${{ matrix.PHP_VERSION }} - - name: Set variables - id: vars - # GITHUB_HEAD_REF is only defined in PRs. GITHUB_REF is on the default branch something like refs/heads/8.x-4.x. - # So if GITHUB_HEAD_REF is not defined we use GITHUB_REF and remove leading refs/heads/. On the result / will replaced by _ - run: | - echo ::set-output name=DOCKER_SANITIZED_BRANCH_NAME::$(echo ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} | sed 's/\//_/g') - echo ::set-output name=DOCKER_TAG::$(echo ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} | sed 's/\//_/g')-${{ github.run_id }} + - name: Unzip upgrade build artifact + run: mkdir -p /tmp/test; tar xCfz /tmp/test upgrade-${{ matrix.PHP_VERSION }}/build-${{ matrix.PHP_VERSION }}.tgz thunder; rm -rf upgrade-${{ matrix.PHP_VERSION }} - - name: Create image and push to registry - working-directory: docker-thunder-performance - run: | - echo ${{ secrets.DOCKER_TOKEN }} | docker login -u thundertechnology --password-stdin - export DOCKER_IMAGE_TAG="burda/thunder-performance:${{ steps.vars.outputs.DOCKER_TAG }}" - chmod u+w www/docroot/sites/default - bash -x ./build.sh --tag "${DOCKER_IMAGE_TAG}" - docker push "${DOCKER_IMAGE_TAG}" + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 - - name: Start Thunder performance testing task for created image + - name: Check profile config + working-directory: /tmp/test/thunder/install run: | - API_CALL_HTTP_CODE=$(curl \ - --request POST \ - --insecure \ - "https://${{ secrets.THUNDER_PTM_HOST }}:3000/warmers" \ - --header "Authorization: Bearer ${{ secrets.THUNDER_PTM_TOKEN }}" \ - --header "Content-Type: application/json" \ - --data "{\"branchTag\":\"${{ steps.vars.outputs.DOCKER_SANITIZED_BRANCH_NAME }}\",\"imageTag\":\"${{ steps.vars.outputs.DOCKER_TAG }}\",\"composeType\":\"default\"}" \ - --output /dev/stderr \ - --write-out "%{http_code}" \ - ) - - if [[ "${API_CALL_HTTP_CODE}" != "200" ]]; then - exit 1 - fi + ls -alh + composer require drupal/config_profile + vendor/bin/drush cex + cd docroot/profile/contrib/thunder + git clean -fd + git status # Start a debug session. # - name: Setup tmate session From 2d1d0334d9c398c91843160ff619430519f4efac Mon Sep 17 00:00:00 2001 From: Volker Killesreiter Date: Tue, 31 May 2022 09:15:57 +0200 Subject: [PATCH 10/20] earlier --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 33b01429f..d027fe955 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -238,10 +238,10 @@ jobs: composer update composer exec -- drush updb -y + composer exec -- drush sql-dump > docroot/dump.sql cd docroot php core/scripts/db-tools.php dump-database-d8-mysql > db-dump.php - composer exec -- drush sql-dump > dump.sql working-directory: /tmp/test/thunder/install From 0866f33f4ece602c83850b8c404bf6a75a46d7f3 Mon Sep 17 00:00:00 2001 From: Volker Killesreiter Date: Tue, 31 May 2022 09:24:26 +0200 Subject: [PATCH 11/20] tmate --- .github/workflows/tests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d027fe955..ea075e3bc 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -230,6 +230,9 @@ jobs: - name: Install drupal run: test-drupal-project install + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 + - name: Update the docroot run: | composer remove thunder/thunder-distribution --no-update From a4347b145a9aa6ec9c1b8b23ac6b69b10ee1483e Mon Sep 17 00:00:00 2001 From: Volker Killesreiter Date: Tue, 31 May 2022 09:47:08 +0200 Subject: [PATCH 12/20] maria --- .github/workflows/tests.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ea075e3bc..86399de2a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -230,9 +230,6 @@ jobs: - name: Install drupal run: test-drupal-project install - - name: Setup tmate session - uses: mxschmitt/action-tmate@v3 - - name: Update the docroot run: | composer remove thunder/thunder-distribution --no-update @@ -241,7 +238,7 @@ jobs: composer update composer exec -- drush updb -y - composer exec -- drush sql-dump > docroot/dump.sql + composer exec -- drush sql:dump --extra-dump='--column-statistics=0' > docroot/dump.sql cd docroot php core/scripts/db-tools.php dump-database-d8-mysql > db-dump.php From eb65da137c90be50b0d56e10bf3ae797d7048562 Mon Sep 17 00:00:00 2001 From: Volker Killesreiter Date: Tue, 31 May 2022 10:26:11 +0200 Subject: [PATCH 13/20] needs --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 86399de2a..4351cae76 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -340,7 +340,7 @@ jobs: run: test-drupal-project run_tests test-config: - needs: build + needs: test-upgrade runs-on: ubuntu-20.04 From 7c88b3ddea7b527b8db4ae4293c8e3190b31c97c Mon Sep 17 00:00:00 2001 From: Volker Killesreiter Date: Tue, 31 May 2022 11:37:46 +0200 Subject: [PATCH 14/20] php version --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4351cae76..f5cf1c372 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -360,7 +360,7 @@ jobs: strategy: fail-fast: false matrix: - PHP_VERSION: [ '8.1' ] + PHP_VERSION: [ '7.4' ] steps: - uses: actions/checkout@v1 From 5183c5e416a49b923b8d37ec70b299e272b339f3 Mon Sep 17 00:00:00 2001 From: Volker Killesreiter Date: Tue, 31 May 2022 13:21:58 +0200 Subject: [PATCH 15/20] dang --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f5cf1c372..fedb4be30 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -385,7 +385,7 @@ jobs: name: upgrade-${{ matrix.PHP_VERSION }} - name: Unzip upgrade build artifact - run: mkdir -p /tmp/test; tar xCfz /tmp/test upgrade-${{ matrix.PHP_VERSION }}/build-${{ matrix.PHP_VERSION }}.tgz thunder; rm -rf upgrade-${{ matrix.PHP_VERSION }} + run: mkdir -p /tmp/test; tar xCfz /tmp/test upgrade-${{ matrix.PHP_VERSION }}/upgrade-${{ matrix.PHP_VERSION }}.tgz thunder; rm -rf upgrade-${{ matrix.PHP_VERSION }} - name: Setup tmate session uses: mxschmitt/action-tmate@v3 From 143ef82bad7b779ce442d7a7d9bfd0b40cacbe38 Mon Sep 17 00:00:00 2001 From: Volker Killesreiter Date: Tue, 31 May 2022 14:14:59 +0200 Subject: [PATCH 16/20] lets see --- .github/workflows/tests.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fedb4be30..8b037ae83 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -387,15 +387,26 @@ jobs: - name: Unzip upgrade build artifact run: mkdir -p /tmp/test; tar xCfz /tmp/test upgrade-${{ matrix.PHP_VERSION }}/upgrade-${{ matrix.PHP_VERSION }}.tgz thunder; rm -rf upgrade-${{ matrix.PHP_VERSION }} + - name: Update the docroot + run: | + composer remove thunder/thunder-distribution --no-update + composer config name "drupal-testing-thunder/thunder-distribution" --working-dir="${GITHUB_WORKSPACE}" + composer require "drupal-testing-thunder/thunder-distribution:*" --no-update + + - name: Load database dump + working-directory: /tmp/test/thunder/install + run: | + composer exec -- drush sql:create -y + composer exec -- drush sql:cli < docroot/dump.sql + - name: Setup tmate session uses: mxschmitt/action-tmate@v3 - name: Check profile config working-directory: /tmp/test/thunder/install run: | - ls -alh composer require drupal/config_profile - vendor/bin/drush cex + composer exec -- drush cex cd docroot/profile/contrib/thunder git clean -fd git status From 6d37d865f7fc1f6e435c54f37391a4ed3d3f6c39 Mon Sep 17 00:00:00 2001 From: Volker Killesreiter Date: Tue, 31 May 2022 14:35:42 +0200 Subject: [PATCH 17/20] work dir --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8b037ae83..42d91b653 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -242,7 +242,6 @@ jobs: cd docroot php core/scripts/db-tools.php dump-database-d8-mysql > db-dump.php - working-directory: /tmp/test/thunder/install - name: Zip build @@ -388,6 +387,7 @@ jobs: run: mkdir -p /tmp/test; tar xCfz /tmp/test upgrade-${{ matrix.PHP_VERSION }}/upgrade-${{ matrix.PHP_VERSION }}.tgz thunder; rm -rf upgrade-${{ matrix.PHP_VERSION }} - name: Update the docroot + working-directory: /tmp/test/thunder/install run: | composer remove thunder/thunder-distribution --no-update composer config name "drupal-testing-thunder/thunder-distribution" --working-dir="${GITHUB_WORKSPACE}" From c49bf5b3eb4f51159acb0c20ec3216552112c7cc Mon Sep 17 00:00:00 2001 From: Volker Killesreiter Date: Tue, 31 May 2022 15:11:50 +0200 Subject: [PATCH 18/20] turn round --- .github/workflows/tests.yml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 42d91b653..c40470054 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -386,13 +386,6 @@ jobs: - name: Unzip upgrade build artifact run: mkdir -p /tmp/test; tar xCfz /tmp/test upgrade-${{ matrix.PHP_VERSION }}/upgrade-${{ matrix.PHP_VERSION }}.tgz thunder; rm -rf upgrade-${{ matrix.PHP_VERSION }} - - name: Update the docroot - working-directory: /tmp/test/thunder/install - run: | - composer remove thunder/thunder-distribution --no-update - composer config name "drupal-testing-thunder/thunder-distribution" --working-dir="${GITHUB_WORKSPACE}" - composer require "drupal-testing-thunder/thunder-distribution:*" --no-update - - name: Load database dump working-directory: /tmp/test/thunder/install run: | @@ -402,12 +395,21 @@ jobs: - name: Setup tmate session uses: mxschmitt/action-tmate@v3 + - name: Update the docroot + working-directory: /tmp/test/thunder/install + run: | + composer remove thunder/thunder-distribution --no-update + composer config name "drupal-testing-thunder/thunder-distribution" --working-dir="${GITHUB_WORKSPACE}" + composer require "drupal-testing-thunder/thunder-distribution:*" --no-update + - name: Check profile config working-directory: /tmp/test/thunder/install run: | composer require drupal/config_profile - composer exec -- drush cex - cd docroot/profile/contrib/thunder + vendor/bin/drush -y en config_profile + vendor/bin/drush cex + + cd docroot/profiles/contrib/thunder git clean -fd git status From 31fd8d0f9fcb300e028b661d3e54ff3ef78a7129 Mon Sep 17 00:00:00 2001 From: Volker Killesreiter Date: Tue, 31 May 2022 16:31:38 +0200 Subject: [PATCH 19/20] again --- .github/workflows/tests.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c40470054..3f92845b0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -389,23 +389,22 @@ jobs: - name: Load database dump working-directory: /tmp/test/thunder/install run: | - composer exec -- drush sql:create -y - composer exec -- drush sql:cli < docroot/dump.sql + vendor/bin/drush sql:create -y + vendor/bin/drush sql:cli < docroot/dump.sql - - name: Setup tmate session - uses: mxschmitt/action-tmate@v3 - - - name: Update the docroot + - name: Link the distribution working-directory: /tmp/test/thunder/install run: | composer remove thunder/thunder-distribution --no-update composer config name "drupal-testing-thunder/thunder-distribution" --working-dir="${GITHUB_WORKSPACE}" composer require "drupal-testing-thunder/thunder-distribution:*" --no-update + composer require drupal/config_profile + rm -rf docroot/profiles/contrib/thunder-distribution + ln -s "${GITHUB_WORKSPACE}" docroot/profiles/contrib/thunder - name: Check profile config working-directory: /tmp/test/thunder/install run: | - composer require drupal/config_profile vendor/bin/drush -y en config_profile vendor/bin/drush cex From bcd6557932def11d987cc316fbbd6e07ae41b9ca Mon Sep 17 00:00:00 2001 From: Volker Killesreiter Date: Thu, 2 Jun 2022 10:54:17 +0200 Subject: [PATCH 20/20] tmate --- .github/workflows/tests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3f92845b0..3fb7c3b96 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -402,6 +402,9 @@ jobs: rm -rf docroot/profiles/contrib/thunder-distribution ln -s "${GITHUB_WORKSPACE}" docroot/profiles/contrib/thunder + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 + - name: Check profile config working-directory: /tmp/test/thunder/install run: |