diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2f2b652..b985413 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,43 +34,58 @@ jobs: name: Test on CKAN ${{ matrix.ckan-version }} runs-on: ubuntu-latest - container: drevops/ci-runner:23.12.0 + container: + image: ckan/ckan-dev:${{ matrix.ckan-version }} + options: --user root + services: + solr: + image: ckan/ckan-solr:${{ matrix.ckan-version }}-solr9 + postgres: + image: ckan/ckan-postgres-dev:${{ matrix.ckan-version }} + env: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + POSTGRES_DB: postgres + ports: + - 5432:5432 + options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 + redis: + image: redis:3 env: CKAN_VERSION: ${{ matrix.ckan-version }} steps: - # Patch https://github.com/actions/runner/issues/863 - - name: Preserve $HOME set in the container - run: echo HOME=/root >> "$GITHUB_ENV" - - uses: actions/checkout@v4 continue-on-error: ${{ matrix.experimental }} timeout-minutes: 2 - - name: Build + - name: Install requirements continue-on-error: ${{ matrix.experimental }} - run: bin/build.sh + run: bin/init-ext.sh timeout-minutes: 15 - name: Unit test continue-on-error: ${{ matrix.experimental }} - run: bin/test.sh + run: | + pytest --ckan-ini=$CKAN_INI --cov=ckanext --junit-xml=test/junit/results.xml timeout-minutes: 10 + - name: Create sample data + continue-on-error: ${{ matrix.experimental }} + run: bin/create-test-data.sh + - name: Scenario test continue-on-error: ${{ matrix.experimental }} - run: bin/test-bdd.sh + run: | + mailmock -p 8025 -o test/emails & + sleep 5 + behave --junit -k test/features --tags=smoke --junit-directory=test/junit/ && \ + behave --junit -k test/features --tags=-smoke --junit-directory=test/junit/ timeout-minutes: 30 - name: Retrieve logs if: always() - run: ahoy logs - continue-on-error: ${{ matrix.experimental }} - timeout-minutes: 1 - - - name: Retrieve results - if: always() - run: bin/process-artifacts.sh + uses: jwalton/gh-docker-logs@v2 continue-on-error: ${{ matrix.experimental }} timeout-minutes: 1 @@ -78,7 +93,7 @@ jobs: uses: test-summary/action@v2 continue-on-error: ${{ matrix.experimental }} with: - paths: "/tmp/artifacts/junit/*.xml" + paths: "test/junit/*.xml" if: always() - name: Upload screenshots @@ -87,5 +102,5 @@ jobs: continue-on-error: ${{ matrix.experimental }} with: name: CKAN ${{ matrix.ckan-version }} screenshots - path: /tmp/artifacts/behave/screenshots + path: test/screenshots timeout-minutes: 1