From 5e87e66ec226bc37a188566ed6fde6c5b47bd58f Mon Sep 17 00:00:00 2001 From: Paul Mitchum Date: Thu, 7 Dec 2023 12:08:53 -0600 Subject: [PATCH 01/16] clean out test area --- tests/dkan-init.bats | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/dkan-init.bats b/tests/dkan-init.bats index d19211a..4548667 100644 --- a/tests/dkan-init.bats +++ b/tests/dkan-init.bats @@ -11,6 +11,7 @@ setup() { export DDEV_NON_INTERACTIVE=true ddev delete -Oy ${PROJNAME} >/dev/null 2>&1 || true cd "${TESTDIR}" + rm -rf * ddev config --project-name=${PROJNAME} ddev get ${DIR} ddev restart >/dev/null @@ -61,8 +62,8 @@ teardown() { touch composer.json - run ddev dkan-init --project-version 10.1.x-dev - assert_output --partial "Using project version: 10.1.x-dev" + run ddev dkan-init --project-version 10.0.x-dev + assert_output --partial "Using project version: 10.0.x-dev" assert_output --partial "Found composer.json" assert_failure From 1c124054ab6b3f84b0125936754040636b80c65c Mon Sep 17 00:00:00 2001 From: Paul Mitchum Date: Thu, 7 Dec 2023 13:09:41 -0600 Subject: [PATCH 02/16] experimentally running only dkan-init.bats --- .github/workflows/tests.yml | 2 +- tests/dkan-init.bats | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8e34662..abd1acf 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -85,7 +85,7 @@ jobs: if: github.event.inputs.debug_enabled == 'true' - name: tests - run: ./tests/bats/bin/bats ./tests/ + run: ./tests/bats/bin/bats ./tests/dkan-init.bats # keepalive-workflow adds a dummy commit if there's no other action here, keeps # GitHub from turning off tests after 60 days diff --git a/tests/dkan-init.bats b/tests/dkan-init.bats index 4548667..1cf49b4 100644 --- a/tests/dkan-init.bats +++ b/tests/dkan-init.bats @@ -5,12 +5,12 @@ setup() { load 'test_helper/bats-assert/load' export DIR="$( cd "$( dirname "$BATS_TEST_FILENAME" )" >/dev/null 2>&1 && pwd )/.." - export TESTDIR=~/tmp/test-addon-template + export TESTDIR=~/tmp/test-addon-init mkdir -p $TESTDIR - export PROJNAME=test-addon-template + export PROJNAME=test-addon-init export DDEV_NON_INTERACTIVE=true - ddev delete -Oy ${PROJNAME} >/dev/null 2>&1 || true cd "${TESTDIR}" + ddev delete -Oy ${PROJNAME} >/dev/null 2>&1 || true rm -rf * ddev config --project-name=${PROJNAME} ddev get ${DIR} From b456aa69ced4d9add81d26e81a90d9757a5f8f16 Mon Sep 17 00:00:00 2001 From: Paul Mitchum Date: Thu, 7 Dec 2023 13:15:21 -0600 Subject: [PATCH 03/16] reverting experiment --- .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 abd1acf..8e34662 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -85,7 +85,7 @@ jobs: if: github.event.inputs.debug_enabled == 'true' - name: tests - run: ./tests/bats/bin/bats ./tests/dkan-init.bats + run: ./tests/bats/bin/bats ./tests/ # keepalive-workflow adds a dummy commit if there's no other action here, keeps # GitHub from turning off tests after 60 days From 130c0f8e5200494dbb830e1f96478b971238db0f Mon Sep 17 00:00:00 2001 From: Paul Mitchum Date: Thu, 7 Dec 2023 15:09:17 -0600 Subject: [PATCH 04/16] experimentally running only frontend-local-test --- .github/workflows/tests.yml | 2 +- tests/frontend-local-test.bats | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8e34662..75a2f2c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -85,7 +85,7 @@ jobs: if: github.event.inputs.debug_enabled == 'true' - name: tests - run: ./tests/bats/bin/bats ./tests/ + run: ./tests/bats/bin/bats ./tests/frontend-local-test.bats # keepalive-workflow adds a dummy commit if there's no other action here, keeps # GitHub from turning off tests after 60 days diff --git a/tests/frontend-local-test.bats b/tests/frontend-local-test.bats index 51e778d..f796096 100644 --- a/tests/frontend-local-test.bats +++ b/tests/frontend-local-test.bats @@ -5,18 +5,19 @@ setup() { load 'test_helper/bats-assert/load' export DIR="$( cd "$( dirname "$BATS_TEST_FILENAME" )" >/dev/null 2>&1 && pwd )/.." - export PROJNAME=test-dkan-ddev-addon + export PROJNAME=test-dkan-frontend export TESTDIR=~/tmp/$PROJNAME mkdir -p $TESTDIR export DDEV_NON_INTERACTIVE=true ddev delete -Oy ${PROJNAME} || true cd "${TESTDIR}" + rm -rf * ddev config --project-name=${PROJNAME} ddev get ${DIR} + ddev dkan-init --force mv .ddev/misc/docker-compose.cypress.yaml .ddev/docker-compose.cypress.yml ddev restart - ddev dkan-init --force ddev dkan-site-install ddev dkan-frontend-install ddev dkan-frontend-build From 64484c6c4e1f38828f7e6bffe6a04441f3670a8b Mon Sep 17 00:00:00 2001 From: Paul Mitchum Date: Thu, 7 Dec 2023 15:17:15 -0600 Subject: [PATCH 05/16] return to running all the tests --- .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 75a2f2c..8e34662 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -85,7 +85,7 @@ jobs: if: github.event.inputs.debug_enabled == 'true' - name: tests - run: ./tests/bats/bin/bats ./tests/frontend-local-test.bats + run: ./tests/bats/bin/bats ./tests/ # keepalive-workflow adds a dummy commit if there's no other action here, keeps # GitHub from turning off tests after 60 days From c3587f810ae31d5024cbca1197e2ca3979657f91 Mon Sep 17 00:00:00 2001 From: Paul Mitchum Date: Thu, 7 Dec 2023 15:55:16 -0600 Subject: [PATCH 06/16] experiment --- .github/workflows/tests.yml | 2 +- tests/frontend-local-test.bats | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8e34662..75a2f2c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -85,7 +85,7 @@ jobs: if: github.event.inputs.debug_enabled == 'true' - name: tests - run: ./tests/bats/bin/bats ./tests/ + run: ./tests/bats/bin/bats ./tests/frontend-local-test.bats # keepalive-workflow adds a dummy commit if there's no other action here, keeps # GitHub from turning off tests after 60 days diff --git a/tests/frontend-local-test.bats b/tests/frontend-local-test.bats index f796096..868cd03 100644 --- a/tests/frontend-local-test.bats +++ b/tests/frontend-local-test.bats @@ -7,11 +7,12 @@ setup() { export DIR="$( cd "$( dirname "$BATS_TEST_FILENAME" )" >/dev/null 2>&1 && pwd )/.." export PROJNAME=test-dkan-frontend export TESTDIR=~/tmp/$PROJNAME - mkdir -p $TESTDIR export DDEV_NON_INTERACTIVE=true ddev delete -Oy ${PROJNAME} || true + rm -rf $TESTDIR + mkdir -p $TESTDIR cd "${TESTDIR}" - rm -rf * + pwd ddev config --project-name=${PROJNAME} ddev get ${DIR} From 76a063d7045f0c6097f97977cb3d2f3104a5c313 Mon Sep 17 00:00:00 2001 From: Paul Mitchum Date: Thu, 7 Dec 2023 16:02:18 -0600 Subject: [PATCH 07/16] all tests --- .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 75a2f2c..8e34662 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -85,7 +85,7 @@ jobs: if: github.event.inputs.debug_enabled == 'true' - name: tests - run: ./tests/bats/bin/bats ./tests/frontend-local-test.bats + run: ./tests/bats/bin/bats ./tests/ # keepalive-workflow adds a dummy commit if there's no other action here, keeps # GitHub from turning off tests after 60 days From fef0c6ed22cc0311e402bfb832354f32bc0f85e1 Mon Sep 17 00:00:00 2001 From: Paul Mitchum Date: Fri, 8 Dec 2023 09:16:15 -0600 Subject: [PATCH 08/16] some more isolation --- tests/frontend-local-test.bats | 2 +- tests/frontend.bats | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/frontend-local-test.bats b/tests/frontend-local-test.bats index 868cd03..1e8e98a 100644 --- a/tests/frontend-local-test.bats +++ b/tests/frontend-local-test.bats @@ -5,7 +5,7 @@ setup() { load 'test_helper/bats-assert/load' export DIR="$( cd "$( dirname "$BATS_TEST_FILENAME" )" >/dev/null 2>&1 && pwd )/.." - export PROJNAME=test-dkan-frontend + export PROJNAME=test-dkan-frontend-local export TESTDIR=~/tmp/$PROJNAME export DDEV_NON_INTERACTIVE=true ddev delete -Oy ${PROJNAME} || true diff --git a/tests/frontend.bats b/tests/frontend.bats index da76d9d..4045748 100644 --- a/tests/frontend.bats +++ b/tests/frontend.bats @@ -5,8 +5,9 @@ setup() { load 'test_helper/bats-assert/load' export DIR="$( cd "$( dirname "$BATS_TEST_FILENAME" )" >/dev/null 2>&1 && pwd )/.." - export PROJNAME=test-dkan-ddev-addon + export PROJNAME=test-dkan-frontend-local export TESTDIR=~/tmp/$PROJNAME + rm -rf $TESTDIR mkdir -p $TESTDIR export DDEV_NON_INTERACTIVE=true ddev delete -Oy ${PROJNAME} || true From 57036fa4f7983805ca5733305ef7391e259bda87 Mon Sep 17 00:00:00 2001 From: Paul Mitchum Date: Fri, 8 Dec 2023 09:46:15 -0600 Subject: [PATCH 09/16] frontend --- .github/workflows/tests.yml | 2 +- tests/frontend.bats | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8e34662..e642c69 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -85,7 +85,7 @@ jobs: if: github.event.inputs.debug_enabled == 'true' - name: tests - run: ./tests/bats/bin/bats ./tests/ + run: ./tests/bats/bin/bats ./tests/frontend.bats # keepalive-workflow adds a dummy commit if there's no other action here, keeps # GitHub from turning off tests after 60 days diff --git a/tests/frontend.bats b/tests/frontend.bats index 4045748..a1929c6 100644 --- a/tests/frontend.bats +++ b/tests/frontend.bats @@ -5,19 +5,20 @@ setup() { load 'test_helper/bats-assert/load' export DIR="$( cd "$( dirname "$BATS_TEST_FILENAME" )" >/dev/null 2>&1 && pwd )/.." - export PROJNAME=test-dkan-frontend-local + export PROJNAME=test-dkan-frontend export TESTDIR=~/tmp/$PROJNAME - rm -rf $TESTDIR - mkdir -p $TESTDIR export DDEV_NON_INTERACTIVE=true ddev delete -Oy ${PROJNAME} || true + rm -rf $TESTDIR + mkdir -p $TESTDIR cd "${TESTDIR}" + pwd ddev config --project-name=${PROJNAME} ddev get ${DIR} + ddev dkan-init --force mv .ddev/misc/docker-compose.cypress.yaml .ddev/docker-compose.cypress.yml ddev restart - ddev dkan-init --force ddev dkan-site-install } From dad8c7e9018e42ab2dce16a7a18089f458d5fcbd Mon Sep 17 00:00:00 2001 From: Paul Mitchum Date: Fri, 8 Dec 2023 09:57:52 -0600 Subject: [PATCH 10/16] fixing phpunit --- .github/workflows/tests.yml | 2 +- tests/phpunit.bats | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e642c69..8fbdbe1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -85,7 +85,7 @@ jobs: if: github.event.inputs.debug_enabled == 'true' - name: tests - run: ./tests/bats/bin/bats ./tests/frontend.bats + run: ./tests/bats/bin/bats ./tests/phpunit.bats # keepalive-workflow adds a dummy commit if there's no other action here, keeps # GitHub from turning off tests after 60 days diff --git a/tests/phpunit.bats b/tests/phpunit.bats index bb8ebc3..50479a8 100644 --- a/tests/phpunit.bats +++ b/tests/phpunit.bats @@ -5,16 +5,17 @@ setup() { load 'test_helper/bats-assert/load' export DIR="$( cd "$( dirname "$BATS_TEST_FILENAME" )" >/dev/null 2>&1 && pwd )/.." - export PROJNAME=test-dkan-ddev-addon + export PROJNAME=test-dkan-phpunit export TESTDIR=~/tmp/$PROJNAME - mkdir -p $TESTDIR export DDEV_NON_INTERACTIVE=true ddev delete -Oy ${PROJNAME} || true + rm -rf $TESTDIR + mkdir -p $TESTDIR cd "${TESTDIR}" + pwd + ddev config --project-name=${PROJNAME} ddev get ${DIR} - ddev restart - ddev dkan-init --force # TODO: Change this after https://www.drupal.org/project/moderated_content_bulk_publish/issues/3301389 ddev composer require drupal/pathauto:^1.10 From 6b7813420667a252c99a80a4afdb9146c20238e1 Mon Sep 17 00:00:00 2001 From: Paul Mitchum Date: Fri, 8 Dec 2023 10:19:22 -0600 Subject: [PATCH 11/16] all the tests --- .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 8fbdbe1..8e34662 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -85,7 +85,7 @@ jobs: if: github.event.inputs.debug_enabled == 'true' - name: tests - run: ./tests/bats/bin/bats ./tests/phpunit.bats + run: ./tests/bats/bin/bats ./tests/ # keepalive-workflow adds a dummy commit if there's no other action here, keeps # GitHub from turning off tests after 60 days From 4b77e6a749e4d1822056e582359f27ddd4698584 Mon Sep 17 00:00:00 2001 From: Paul Mitchum Date: Mon, 11 Dec 2023 16:41:23 -0700 Subject: [PATCH 12/16] phpunit --- .github/workflows/tests.yml | 2 +- tests/project-test-phpunit.bats | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8e34662..b434d63 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -85,7 +85,7 @@ jobs: if: github.event.inputs.debug_enabled == 'true' - name: tests - run: ./tests/bats/bin/bats ./tests/ + run: ./tests/bats/bin/bats ./tests/project-test-phpunit.bats # keepalive-workflow adds a dummy commit if there's no other action here, keeps # GitHub from turning off tests after 60 days diff --git a/tests/project-test-phpunit.bats b/tests/project-test-phpunit.bats index 68b8009..3a90189 100644 --- a/tests/project-test-phpunit.bats +++ b/tests/project-test-phpunit.bats @@ -6,15 +6,21 @@ setup() { export SUT_DIR=$(pwd) export DIR="$( cd "$( dirname "$BATS_TEST_FILENAME" )" >/dev/null 2>&1 && pwd )/.." - export PROJNAME=test-dkan-ddev-addon + export PROJNAME=test-dkan-phpunit export TESTDIR=~/tmp/$PROJNAME - mkdir -p $TESTDIR export DDEV_NON_INTERACTIVE=true ddev delete -Oy ${PROJNAME} || true + rm -rf $TESTDIR + mkdir -p $TESTDIR cd "${TESTDIR}" + pwd + ddev config --project-name=${PROJNAME} ddev get ${DIR} + ddev dkan-init --force + mv .ddev/misc/docker-compose.cypress.yaml .ddev/docker-compose.cypress.yml ddev restart + ddev dkan-site-install } teardown() { From 608be301f859315ac83a4d4ba4d780945a60cd42 Mon Sep 17 00:00:00 2001 From: Paul Mitchum Date: Mon, 11 Dec 2023 16:44:42 -0700 Subject: [PATCH 13/16] removed webimage dependencies --- config.dkan.yaml | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/config.dkan.yaml b/config.dkan.yaml index c72c6f8..fe2f377 100644 --- a/config.dkan.yaml +++ b/config.dkan.yaml @@ -18,27 +18,6 @@ use_dns_when_possible: true composer_version: "2" nodejs_version: "16" -webimage_extra_packages: - - chromium - - chromium-driver - - g++ - - libgtk2.0-0 - - libgtk-3-0 - - libgbm-dev - - libnotify-dev - - libgconf-2-4 - - libnss3 - - libxss1 - - libasound2 - - libxtst6 - - make - - python2 - - python3-pip - - unzip - - wget - - xauth - - xvfb - web_environment: - COMPOSER_MEMORY_LIMIT=-1 - PHP_MEM_LIMIT=256M From 27afcf298c8938b2c60ee4eff8b15484469ede46 Mon Sep 17 00:00:00 2001 From: Paul Mitchum Date: Mon, 11 Dec 2023 17:11:02 -0700 Subject: [PATCH 14/16] remove no-binary test --- .github/workflows/tests.yml | 3 +-- tests/project-test-phpunit.bats | 12 +++++------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b434d63..6e70334 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -39,10 +39,9 @@ jobs: strategy: matrix: ddev_version: [stable, HEAD] - # ddev_version: [stable, edge, HEAD, PR] fail-fast: false - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 diff --git a/tests/project-test-phpunit.bats b/tests/project-test-phpunit.bats index 3a90189..7702a6b 100644 --- a/tests/project-test-phpunit.bats +++ b/tests/project-test-phpunit.bats @@ -4,8 +4,10 @@ setup() { load 'test_helper/bats-support/load' load 'test_helper/bats-assert/load' - export SUT_DIR=$(pwd) - export DIR="$( cd "$( dirname "$BATS_TEST_FILENAME" )" >/dev/null 2>&1 && pwd )/.." + SUT_DIR=$(pwd) + export SUT_DIR + DIR="$( cd "$( dirname "$BATS_TEST_FILENAME" )" >/dev/null 2>&1 && pwd )/.." + export DIR export PROJNAME=test-dkan-phpunit export TESTDIR=~/tmp/$PROJNAME export DDEV_NON_INTERACTIVE=true @@ -13,7 +15,6 @@ setup() { rm -rf $TESTDIR mkdir -p $TESTDIR cd "${TESTDIR}" - pwd ddev config --project-name=${PROJNAME} ddev get ${DIR} @@ -40,12 +41,9 @@ teardown() { assert_output --partial "PHPUnit config not found" assert_failure - # Add config, but no executable. + # Add config. mkdir -p docroot/modules/custom cp .ddev/misc/phpunit.xml docroot/modules/custom - run ddev project-test-phpunit - assert_output --partial "Unable to find PHPUnit executable" - assert_failure # Can perform test run, for a group that doesn't exist. ddev dkan-init --force From 2dceb977dbd45e9f79b24500c8343c7ca575dd37 Mon Sep 17 00:00:00 2001 From: Paul Mitchum Date: Mon, 11 Dec 2023 17:32:09 -0700 Subject: [PATCH 15/16] more --- tests/project-test-phpunit.bats | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/project-test-phpunit.bats b/tests/project-test-phpunit.bats index 7702a6b..6eccbbf 100644 --- a/tests/project-test-phpunit.bats +++ b/tests/project-test-phpunit.bats @@ -41,12 +41,7 @@ teardown() { assert_output --partial "PHPUnit config not found" assert_failure - # Add config. - mkdir -p docroot/modules/custom - cp .ddev/misc/phpunit.xml docroot/modules/custom - # Can perform test run, for a group that doesn't exist. - ddev dkan-init --force mkdir -p docroot/modules/custom cp .ddev/misc/phpunit.xml docroot/modules/custom run ddev project-test-phpunit --group this-group-should-not-exist From 4f0dea680dcda8b15a9108b77da2cd5f4dce632c Mon Sep 17 00:00:00 2001 From: Paul Mitchum Date: Mon, 11 Dec 2023 18:53:45 -0700 Subject: [PATCH 16/16] back to all tests --- .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 6e70334..5bbb61d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -84,7 +84,7 @@ jobs: if: github.event.inputs.debug_enabled == 'true' - name: tests - run: ./tests/bats/bin/bats ./tests/project-test-phpunit.bats + run: ./tests/bats/bin/bats ./tests # keepalive-workflow adds a dummy commit if there's no other action here, keeps # GitHub from turning off tests after 60 days