Skip to content

Commit

Permalink
[QOLDEV-1005] add optional testing on latest master
Browse files Browse the repository at this point in the history
  • Loading branch information
ThrawnCA committed Nov 13, 2024
1 parent 64da22d commit 86f0d1e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .ahoy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ commands:
usage: Run unit tests.
cmd: |
ahoy title 'Run unit tests'
ahoy cli 'pytest --ckan-ini=${CKAN_INI} "${APP_DIR}"/ckanext' || \
ahoy cli 'pytest --ckan-ini=${CKAN_INI} "${APP_DIR}"/ckanext --junit-xml=test/junit/results.xml' || \
[ "${ALLOW_UNIT_FAIL:-0}" -eq 1 ]
test-bdd:
Expand All @@ -144,7 +144,7 @@ commands:
ahoy start-ckan-job-worker &
ahoy start-mailmock &
sleep 5
ahoy cli "behave -k ${*:-test/features} --tags=-format_autocomplete" || \
ahoy cli "behave --junit -k ${*:-test/features} --tags=-format_autocomplete --junit-directory=test/junit/" || \
[ "${ALLOW_BDD_FAIL:-0}" -eq 1 ]
ahoy stop-mailmock
ahoy stop-ckan-job-worker
Expand Down
14 changes: 13 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ jobs:
fail-fast: false
matrix:
ckan-version: ["2.11", "2.10", 2.9]
experimental: [false]
include:
- ckan-version: 'master'
experimental: true #master is unstable, good to know if we are compatible or not

name: Test on CKAN ${{ matrix.ckan-version }}
runs-on: ubuntu-latest
Expand All @@ -43,10 +47,12 @@ jobs:
timeout-minutes: 2

- name: Build
continue-on-error: ${{ matrix.experimental }}
run: bin/build.sh
timeout-minutes: 15

- name: Test
continue-on-error: ${{ matrix.experimental }}
run: bin/test.sh
timeout-minutes: 15

Expand All @@ -55,11 +61,17 @@ jobs:
run: ahoy logs
timeout-minutes: 1

- name: Retrieve screenshots
- name: Retrieve results
if: always()
run: bin/process-artifacts.sh
timeout-minutes: 1

- name: Test Summary
uses: test-summary/action@v2
with:
paths: "/tmp/artifacts/junit/*.xml"
if: always()

- name: Upload screenshots
if: failure()
uses: actions/upload-artifact@v4
Expand Down
5 changes: 3 additions & 2 deletions bin/process-artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ set -e

# Create screenshots directory in case it was not created before. This is to
# avoid this script to fail when copying artifacts.
ahoy cli "mkdir -p test/screenshots"
ahoy cli "mkdir -p test/screenshots test/junit"

# Copy from the app container to the build host for storage.
mkdir -p /tmp/artifacts/behave
mkdir -p /tmp/artifacts/behave /tmp/artifacts/junit
docker cp "$(sh bin/docker-compose.sh ps -q ckan)":/srv/app/test/screenshots /tmp/artifacts/behave/
docker cp "$(sh bin/docker-compose.sh ps -q ckan)":/srv/app/test/junit /tmp/artifacts/

0 comments on commit 86f0d1e

Please sign in to comment.