From 202ab835fa19409b3f36893437759856946c9184 Mon Sep 17 00:00:00 2001 From: Randy Fay Date: Sat, 28 Oct 2023 10:11:29 -0700 Subject: [PATCH] remove extraneous output from ddev head version (#118) --- .github/workflows/tests.yml | 6 +++++- tests/composerversion.bats | 2 +- tests/drupal10.bats | 14 +++++++------- tests/drupal9.bats | 16 ++++++++-------- tests/laravel.bats | 4 ++-- tests/mysql.bats | 4 ++-- tests/oddrelationships.bats | 4 ++-- tests/oracle-mysql.bats | 4 ++-- tests/php.bats | 2 +- tests/postgresql.bats | 4 ++-- tests/wordpress-bedrock.bats | 6 +++--- tests/wordpress-composer.bats | 8 ++++---- 12 files changed, 39 insertions(+), 35 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e5e427c..7657ddf 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -27,7 +27,11 @@ jobs: fail-fast: false runs-on: ubuntu-latest - + env: + # Don't try interactive behaviors + DDEV_NONINTERACTIVE: "true" + # Don't send telemetry to amplitude + DDEV_NO_INSTRUMENTATION: "true" steps: - uses: ddev/github-action-add-on-test@v1 with: diff --git a/tests/composerversion.bats b/tests/composerversion.bats index ddf41ea..1fd34d8 100644 --- a/tests/composerversion.bats +++ b/tests/composerversion.bats @@ -28,7 +28,7 @@ teardown() { base=$(basename $t) expectedComposerVersion=${base#*_} echo "# base=${base} expectedComposerVersion=${expectedComposerVersion}" >&3 - run ddev exec "composer --version | awk '{print \$3}'" + run ddev exec "composer --version | awk '{print \$3}'" 2>/dev/null # If version has a caret, then we just want the first number # Otherwise we use the explicit value provided diff --git a/tests/drupal10.bats b/tests/drupal10.bats index f3b6b61..46e61b7 100644 --- a/tests/drupal10.bats +++ b/tests/drupal10.bats @@ -15,26 +15,26 @@ teardown() { for source in $PROJECT_SOURCE ddev/ddev-platformsh; do per_test_setup - ddev exec drush cr + ddev exec drush cr 2>/dev/null run curl -L -s http://${PROJNAME}.ddev.site/ assert_output --partial "Test of ddev-platformsh on drupal10" - run ddev exec -s db 'echo ${DDEV_DATABASE}' + run ddev exec -s db 'echo ${DDEV_DATABASE}' 2>/dev/null assert_output "mariadb:10.4" - run ddev exec "php --version | awk 'NR==1 { sub(/\.[0-9]+$/, \"\", \$2); print \$2 }'" + run ddev exec "php --version | awk 'NR==1 { sub(/\.[0-9]+$/, \"\", \$2); print \$2 }'" 2>/dev/null assert_output "8.1" - ddev exec 'touch ${PLATFORM_CACHE_DIR}/junk.txt' + ddev exec 'touch ${PLATFORM_CACHE_DIR}/junk.txt' 2>/dev/null ddev describe -j >describe.json run jq -r .raw.docroot relationships.json + assert_equal "$(ddev exec 'echo $PLATFORM_ROUTES 2>/dev/null | base64 -d | jq -r "keys[0]"')" "https://${PROJNAME}.ddev.site/" + ddev exec 'echo $PLATFORM_RELATIONSHIPS | base64 -d' >relationships.json 2>/dev/null echo "# PLATFORM_RELATIONSHIPS=$(cat relationships.json)" >&3 - ddev exec 'echo $PLATFORM_ROUTES | base64 -d' >routes.json + ddev exec 'echo $PLATFORM_ROUTES | base64 -d' >routes.json 2>/dev/null echo "# PLATFORM_ROUTES=$(cat routes.json)" >&3 assert_equal "$(jq -r .database[0].type /dev/null run curl -L -s http://${PROJNAME}.ddev.site/ assert_output --partial "this is a test of ddev-platformsh drupal9" - run ddev exec -s db 'echo ${DDEV_DATABASE}' + run ddev exec -s db 'echo ${DDEV_DATABASE}' 2>/dev/null assert_output "mariadb:10.4" - run ddev exec "php --version | awk 'NR==1 { sub(/\.[0-9]+$/, \"\", \$2); print \$2 }'" + run ddev exec "php --version | awk 'NR==1 { sub(/\.[0-9]+$/, \"\", \$2); print \$2 }'" 2>/dev/null assert_output "8.1" - ddev exec 'touch ${PLATFORM_CACHE_DIR}/junk.txt' + ddev exec 'touch ${PLATFORM_CACHE_DIR}/junk.txt' 2>/dev/null - ddev describe -j >describe.json + ddev describe -j >describe.json 2>/dev/null run jq -r .raw.docroot relationships.json + assert_equal "$(ddev exec 'echo $PLATFORM_ROUTES | base64 -d | jq -r "keys[0]"' 2>/dev/null)" "https://${PROJNAME}.ddev.site/" + ddev exec 'echo $PLATFORM_RELATIONSHIPS | base64 -d' >relationships.json 2>/dev/null echo "# PLATFORM_RELATIONSHIPS=$(cat relationships.json)" >&3 - ddev exec 'echo $PLATFORM_ROUTES | base64 -d' >routes.json + ddev exec 'echo $PLATFORM_ROUTES | base64 -d' >routes.json 2>/dev/null echo "# PLATFORM_ROUTES=$(cat routes.json)" >&3 assert_equal "$(jq -r .database[0].type /dev/null assert_output "8.0" - ddev describe -j >describe.json + ddev describe -j >describe.json 2>/dev/null run jq -r .raw.docroot /dev/null diff --git a/tests/mysql.bats b/tests/mysql.bats index 575453e..dfdc654 100644 --- a/tests/mysql.bats +++ b/tests/mysql.bats @@ -25,9 +25,9 @@ teardown() { printf "x\nx\nx\n" | ddev get $source ddev start -y >/dev/null DDEV_DEBUG="" ddev describe -j >/tmp/describe.json - run ddev exec -s db 'echo ${DDEV_DATABASE}' + run ddev exec -s db 'echo ${DDEV_DATABASE}' >/dev/null assert_output "mariadb:10.5" - ddev exec 'echo $PLATFORM_RELATIONSHIPS | base64 -d' >relationships.json + ddev exec 'echo $PLATFORM_RELATIONSHIPS | base64 -d' >relationships.json 2>/dev/null echo "# PLATFORM_RELATIONSHIPS=$(cat relationships.json)" >&3 diff --git a/tests/oddrelationships.bats b/tests/oddrelationships.bats index 4425534..9307dd6 100644 --- a/tests/oddrelationships.bats +++ b/tests/oddrelationships.bats @@ -24,7 +24,7 @@ teardown() { printf "x\nx\nx\n" | ddev get $source ddev start -y >/dev/null DDEV_DEBUG="" ddev describe -j >/tmp/describe.json - run ddev exec -s db 'echo ${DDEV_DATABASE}' + run ddev exec -s db 'echo ${DDEV_DATABASE}' >/dev/null assert_output "mysql:8.0" run jq -r .raw.services.redis.status relationships.json + ddev exec 'echo $PLATFORM_RELATIONSHIPS | base64 -d' >relationships.json 2>/dev/null echo "# PLATFORM_RELATIONSHIPS=$(cat relationships.json)" >&3 diff --git a/tests/oracle-mysql.bats b/tests/oracle-mysql.bats index 55e6df5..db4f6ce 100644 --- a/tests/oracle-mysql.bats +++ b/tests/oracle-mysql.bats @@ -24,10 +24,10 @@ teardown() { printf "x\nx\nx\n" | ddev get $source ddev start -y >/dev/null DDEV_DEBUG="" ddev describe -j >/tmp/describe.json - run ddev exec -s db 'echo ${DDEV_DATABASE}' + run ddev exec -s db 'echo ${DDEV_DATABASE}' >/dev/null assert_output "mysql:8.0" - ddev exec 'echo $PLATFORM_RELATIONSHIPS | base64 -d' >relationships.json + ddev exec 'echo $PLATFORM_RELATIONSHIPS | base64 -d' >relationships.json 2>/dev/null echo "# PLATFORM_RELATIONSHIPS=$(cat relationships.json)" >&3 assert_equal "$(jq -r .database[0].type /dev/null assert_output "8.0" ddev describe -j >describe.json run jq -r .raw.docroot /dev/null DDEV_DEBUG="" ddev describe -j >/tmp/describe.json - run ddev exec -s db 'echo ${DDEV_DATABASE}' + run ddev exec -s db 'echo ${DDEV_DATABASE}' >/dev/null assert_output "postgres:12" echo "# PLATFORM_RELATIONSHIPS=$(cat relationships.json)" >&3 - ddev exec 'echo $PLATFORM_RELATIONSHIPS | base64 -d' >relationships.json + ddev exec 'echo $PLATFORM_RELATIONSHIPS | base64 -d' >relationships.json 2>/dev/null assert_equal "$(jq -r .database[0].type /dev/null assert_output "mariadb:10.4" - run ddev exec 'echo $PLATFORM_RELATIONSHIPS | base64 -d | jq -r ".database[0].username"' + run ddev exec 'echo $PLATFORM_RELATIONSHIPS | base64 -d | jq -r ".database[0].username"' 2>/dev/null assert_output "db" - run ddev exec "php --version | awk 'NR==1 { sub(/\.[0-9]+$/, \"\", \$2); print \$2 }'" + run ddev exec "php --version | awk 'NR==1 { sub(/\.[0-9]+$/, \"\", \$2); print \$2 }'" 2>/dev/null assert_output "8.1" ddev describe -j >describe.json run jq -r .raw.docroot /dev/null assert_output "mariadb:10.4" - run ddev exec 'echo $PLATFORM_RELATIONSHIPS | base64 -d | jq -r ".database[0].username"' + run ddev exec 'echo $PLATFORM_RELATIONSHIPS | base64 -d | jq -r ".database[0].username"' 2>/dev/null assert_output "db" - run ddev exec "php --version | awk 'NR==1 { sub(/\.[0-9]+$/, \"\", \$2); print \$2 }'" + run ddev exec "php --version | awk 'NR==1 { sub(/\.[0-9]+$/, \"\", \$2); print \$2 }'" 2>/dev/null assert_output "8.1" - run ddev exec ls wordpress/wp-config.php + run ddev exec ls wordpress/wp-config.php 2>/dev/null assert_output "wordpress/wp-config.php" ddev describe -j >describe.json run jq -r .raw.docroot