Skip to content

Commit

Permalink
[ci] Remove drupal8, add drupal10 with database (#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
rfay authored Aug 25, 2023
1 parent 85cc00d commit 4302b62
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 29 deletions.
48 changes: 48 additions & 0 deletions tests/drupal10.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Requires bats-assert and bats-support
# brew tap kaos/shell &&
# brew install bats-core bats-assert bats-support jq mkcert yq
setup() {
load setup.sh
}

teardown() {
load teardown.sh
}

@test "drupal10" {
load per_test.sh
template="drupal10"
for source in $PROJECT_SOURCE ddev/ddev-platformsh; do
per_test_setup

ddev exec drush cr

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}'
assert_output "mariadb:10.4"
run ddev exec "php --version | awk 'NR==1 { sub(/\.[0-9]+$/, \"\", \$2); print \$2 }'"
assert_output "8.1"

ddev exec 'touch ${PLATFORM_CACHE_DIR}/junk.txt'

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
echo "# PLATFORM_RELATIONSHIPS=$(cat relationships.json)" >&3
ddev exec 'echo $PLATFORM_ROUTES | base64 -d' >routes.json
echo "# PLATFORM_ROUTES=$(cat routes.json)" >&3

assert_equal "$(jq -r .database[0].type <relationships.json)" "mariadb:10.4"
assert_equal "$(jq -r .database[0].username <relationships.json)" "db"
assert_equal "$(jq -r .database[0].password <relationships.json)" "db"
assert_equal "$(jq -r .redis[0].hostname <relationships.json)" "redis"

docker inspect ddev-${PROJNAME}-redis >/dev/null
per_test_teardown
done
}
29 changes: 0 additions & 29 deletions tests/drupal8.bats

This file was deleted.

Binary file added tests/testdata/drupal10/db.sql.gz
Binary file not shown.

0 comments on commit 4302b62

Please sign in to comment.