Skip to content

fix: Make tests run successfully #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Setup SSH
run: ssh-keyscan -t rsa git.drupal.org >> ~/.ssh/known_hosts

- uses: ddev/github-action-add-on-test@v2
with:
ddev_version: ${{ matrix.ddev_version }}
Expand Down
24 changes: 14 additions & 10 deletions tests/test.bats
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,18 @@ setup() {
export PROJNAME=ddev-drupal-core-dev
export DDEV_NON_INTERACTIVE=true
ddev delete -Oy ${PROJNAME} >/dev/null 2>&1 || true
git clone [email protected]:project/drupal.git ${TESTDIR}
curl -L -o /tmp/drupal.tar.gz https://ftp.drupal.org/files/projects/drupal-11.x-dev.tar.gz
tar --strip-components 1 -zxf /tmp/drupal.tar.gz -C ${TESTDIR}
cd "${TESTDIR}"
ddev config --project-name=${PROJNAME}
ddev config --project-name=${PROJNAME} --upload-dirs=.ddev/tmp
ddev config --update
ddev start -y >/dev/null
}

health_checks() {
ddev exec "curl -s chrome:7900" | grep "noVNC"
ddev exec "curl -s firefox:7901" | grep "noVNC"
ddev phpunit core/tests/Drupal/Tests/Component/Datetime/DateTimePlusTest.php
}

teardown() {
Expand All @@ -33,12 +36,13 @@ teardown() {
health_checks
}

@test "install from release" {
set -eu -o pipefail
cd ${TESTDIR} || ( printf "unable to cd to ${TESTDIR}\n" && exit 1 )
echo "# ddev get ddev/ddev-addon-template with project ${PROJNAME} in ${TESTDIR} ($(pwd))" >&3
ddev get justafish/ddev-drupal-core-dev
ddev restart >/dev/null
health_checks
}
#TODO: Re-enable release tests after the add-on has a release with DDEV v1.23.0 support
#@test "install from release" {
# set -eu -o pipefail
# cd ${TESTDIR} || ( printf "unable to cd to ${TESTDIR}\n" && exit 1 )
# echo "# ddev get ddev/ddev-addon-template with project ${PROJNAME} in ${TESTDIR} ($(pwd))" >&3
# ddev get justafish/ddev-drupal-core-dev
# ddev restart >/dev/null
# health_checks
#}

12 changes: 12 additions & 0 deletions web-build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,15 @@
RUN sudo apt-get update && sudo apt-get install chromium-driver -y
# This will not be necessary in DDEV v1.23+
RUN corepack enable

# TODO:
# This section is temporary and needs to be removed when
# https://github.com/justafish/ddev-drupal-core-dev/pull/23/files#top
# is pulled, because it includes this update.
ARG TARGETPLATFORM
RUN SQLITE_VERSION=3.45.1 && \
mkdir -p /tmp/sqlite3 && \
wget -O /tmp/sqlite3/sqlite3.deb https://ftp.debian.org/debian/pool/main/s/sqlite3/sqlite3_${SQLITE_VERSION}-1_${TARGETPLATFORM##linux/}.deb && \
wget -O /tmp/sqlite3/libsqlite3.deb https://ftp.debian.org/debian/pool/main/s/sqlite3/libsqlite3-0_${SQLITE_VERSION}-1_${TARGETPLATFORM##linux/}.deb && \
dpkg -i /tmp/sqlite3/*.deb && \
rm -rf /tmp/sqlite3