Skip to content

Merge pull request #30 from dpc-sdp/uat #32

Merge pull request #30 from dpc-sdp/uat

Merge pull request #30 from dpc-sdp/uat #32

Workflow file for this run

name: Tests
on: [push, pull_request]
jobs:
test:
strategy:
matrix:
ckan-version: ["2.11"]
fail-fast: false
name: CKAN ${{ matrix.ckan-version }}
runs-on: ubuntu-latest
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
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
redis:
image: redis:7
env:
CKAN_SQLALCHEMY_URL: postgresql://postgres:postgres@postgres/postgres
CKAN_DATASTORE_WRITE_URL: postgresql://postgres:postgres@postgres/postgres
CKAN_DATASTORE_READ_URL: postgresql://postgres:postgres@postgres/postgres
CKAN_SOLR_URL: http://solr:8983/solr/ckan
CKAN_REDIS_URL: redis://redis:6379/1
steps:
- uses: actions/checkout@v5
- name: Install requirements
run: |
pip install -e .
# Replace default path to CKAN core config file with the one on the container
sed -i -e 's/use = config:.*/use = config:\/srv\/app\/src\/ckan\/test-core.ini/' test.ini
- name: Setup extension
run: |
pip install -r dev-requirements.txt
ckan -c test.ini db init
ckan -c test.ini db pending-migrations --apply
- name: Run all tests
run: pytest --ckan-ini=test.ini --cov=ckanext.datavic_reporting ckanext/datavic_reporting/tests