diff --git a/.ahoy.yml b/.ahoy.yml index cc8bfec..10a1745 100644 --- a/.ahoy.yml +++ b/.ahoy.yml @@ -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: @@ -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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0dc24f5..0753a6a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 @@ -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 @@ -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 diff --git a/bin/process-artifacts.sh b/bin/process-artifacts.sh index e20a7e6..b2066b5 100755 --- a/bin/process-artifacts.sh +++ b/bin/process-artifacts.sh @@ -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/