Skip to content

Commit

Permalink
remove extraneous output from ddev head version
Browse files Browse the repository at this point in the history
  • Loading branch information
rfay committed Oct 28, 2023
1 parent 28b1278 commit b52846d
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 34 deletions.
2 changes: 1 addition & 1 deletion tests/composerversion.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions tests/drupal10.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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 <describe.json
assert_output "web"

assert_equal "$(ddev exec 'echo $PLATFORM_ROUTES | base64 -d | jq -r "keys[0]"')" "https://${PROJNAME}.ddev.site/"
ddev exec 'echo $PLATFORM_RELATIONSHIPS | base64 -d' >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 <relationships.json)" "mariadb:10.4"
Expand Down
16 changes: 8 additions & 8 deletions tests/drupal9.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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 "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 <describe.json
assert_output "web"

assert_equal "$(ddev exec 'echo $PLATFORM_ROUTES | base64 -d | jq -r "keys[0]"')" "https://${PROJNAME}.ddev.site/"
ddev exec 'echo $PLATFORM_RELATIONSHIPS | base64 -d' >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 <relationships.json)" "mariadb:10.4"
Expand Down
4 changes: 2 additions & 2 deletions tests/laravel.bats
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ teardown() {
for source in $PROJECT_SOURCE ddev/ddev-platformsh; do
per_test_setup

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.0"
ddev describe -j >describe.json
ddev describe -j >describe.json 2>/dev/null
run jq -r .raw.docroot <describe.json
assert_output "public"
docker inspect ddev-${PROJNAME}-redis >/dev/null
Expand Down
4 changes: 2 additions & 2 deletions tests/mysql.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions tests/oddrelationships.bats
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ 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 </tmp/describe.json
assert_output "running"
run jq -r .raw.services.elasticsearch.status </tmp/describe.json
assert_output "running"
run jq -r .raw.services.memcached.status </tmp/describe.json
assert_output "running"
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

Expand Down
4 changes: 2 additions & 2 deletions tests/oracle-mysql.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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 <relationships.json)" "mysql:8.0"
Expand Down
2 changes: 1 addition & 1 deletion tests/php.bats
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ teardown() {
for source in $PROJECT_SOURCE ddev/ddev-platformsh; do
per_test_setup

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.0"
ddev describe -j >describe.json
run jq -r .raw.docroot <describe.json
Expand Down
4 changes: 2 additions & 2 deletions tests/postgresql.bats
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ 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 "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 <relationships.json)" "postgres:12"
assert_equal "$(jq -r .database[0].username <relationships.json)" "db"
assert_equal "$(jq -r .database[0].password <relationships.json)" "db"
Expand Down
6 changes: 3 additions & 3 deletions tests/wordpress-bedrock.bats
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ teardown() {
run curl -s http://${PROJNAME}.ddev.site/phpinfo.php
assert_line "DB_USER=db DB_PASSWORD=db"
curl -s http://${PROJNAME}.ddev.site | grep "Mindblown: a blog about"
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 '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 <describe.json
Expand Down
8 changes: 4 additions & 4 deletions tests/wordpress-composer.bats
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ teardown() {
for source in $PROJECT_SOURCE ddev/ddev-platformsh; do
per_test_setup

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 '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 <describe.json
Expand Down

0 comments on commit b52846d

Please sign in to comment.