OpenDataGIS / ckanext-iepnb

CKAN theme for the IEPNB open data portal - iepnb.es | Demo assets: https://github.com/OpenDataGIS/ckanext-iepnb_assets
GNU Affero General Public License v3.0
0 stars 1 forks source link

Test - Add ckanext-schemingdcat and deps extension to testing #55

Open mjanez opened 2 months ago

mjanez commented 2 months ago

https://github.com/OpenDataGIS/ckanext-iepnb/actions/runs/8647165003/job/23708013782

Template

To do

Para utilizar un Dockerfile personalizado en tu flujo de trabajo de GitHub Actions, se debe construir la imagen de Docker como un paso en tu flujo de trabajo.

name: Tests
on: [pull_request]
jobs:
  test:
    runs-on: ubuntu-latest
    services:
      solr:
        image: ckan/ckan-solr:2.9-solr9-spatial
      postgres:
        image: ckan/ckan-postgres-dev:2.9
        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-alpine

    env:
      CKAN_SQLALCHEMY_URL: postgresql://ckan_default:pass@postgres/ckan_test
      CKAN_DATASTORE_WRITE_URL: postgresql://datastore_write:pass@postgres/datastore_test
      CKAN_DATASTORE_READ_URL: postgresql://datastore_read:pass@postgres/datastore_test
      CKAN_SOLR_URL: http://solr:8983/solr/ckan
      CKAN_REDIS_URL: redis://redis:6379/1

    steps:
    - uses: actions/checkout@v4
    - name: Build Docker image
      run: docker build -t my-ckan -f ckanext/iepnb/tests/Dockerfile .
    - name: Setup extension
      # Extra initialization steps
      run: |
        # 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
        ckan -c test.ini db init
    - name: Run tests
      run: pytest --ckan-ini=test.ini --cov=ckanext.iepnb --disable-warnings ckanext/iepnb

En este ejemplo, se añade un paso llamado "Build Docker image" que construye la imagen de Docker utilizando el Dockerfile en el directorio ckanext/iepnb/tests/. Luego, esta imagen se utiliza en los pasos siguientes para configurar la extensión y ejecutar los tests.

mjanez commented 2 weeks ago

Fixed by: https://github.com/OpenDataGIS/ckanext-iepnb/pull/65