Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
20 changes: 11 additions & 9 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ jobs:

steps:
- uses: ddev/github-action-add-on-test@v2
env:
# Ensure that browser_output, junit, Nightwatch report are available as artifacts.
SKIP_CLEANUP: "true"
with:
ddev_version: ${{ matrix.ddev_version }}
token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -47,20 +44,25 @@ jobs:
- name: Archive browser_output
uses: actions/upload-artifact@v4
with:
name: browser_output
name: browser_output-${{ matrix.ddev_version }}
path: |
web/sites/simpletest/browser_output
${{ env.TESTDIR }}/web/sites/simpletest/browser_output

- name: Archive junits
uses: actions/upload-artifact@v4
with:
name: junits
name: junits-${{ matrix.ddev_version }}
path: |
*.junit.xml
${{ env.TESTDIR }}/web/*.junit.xml

- name: Zip Nightwatch reports
run: |
cd ${{ env.TESTDIR }}/web/core/reports
zip -r nightwatch.zip nightwatch

- name: Nightwatch reports
uses: actions/upload-artifact@v4
with:
name: nightwatch
name: nightwatch-${{ matrix.ddev_version }}
path: |
web/core/reports/nightwatch
${{ env.TESTDIR }}/web/core/reports/nightwatch.zip
9 changes: 7 additions & 2 deletions tests/test.bats
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ setup() {

export DIR="$(cd "$(dirname "${BATS_TEST_FILENAME}")/.." >/dev/null 2>&1 && pwd)"
export PROJNAME="test-$(basename "${GITHUB_REPO}")"
export SKIP_CLEANUP=1
mkdir -p ~/tmp
export TESTDIR=$(mktemp -d ~/tmp/${PROJNAME}.XXXXXX)
export DDEV_NONINTERACTIVE=true
Expand Down Expand Up @@ -90,7 +89,13 @@ health_checks() {
teardown() {
set -eu -o pipefail
ddev delete -Oy ${PROJNAME} >/dev/null 2>&1
[ ! -z "${SKIP_CLEANUP}" ] || ( [ "${TESTDIR}" != "" ] && rm -rf ${TESTDIR} )
# Persist TESTDIR if running inside GitHub Actions. Useful for uploading test result artifacts
# See example at https://github.com/ddev/github-action-add-on-test#preserving-artifacts
if [ -n "${GITHUB_ENV:-}" ]; then
echo "TESTDIR=${TESTDIR}" >> "${GITHUB_ENV}"
else
[ "${TESTDIR}" != "" ] && rm -rf "${TESTDIR}"
fi
}

@test "install from directory" {
Expand Down