From 6cac853bd14063e940632c574474f5bdb3171a2e Mon Sep 17 00:00:00 2001 From: amercader Date: Wed, 17 Jul 2024 11:59:02 +0200 Subject: [PATCH 1/3] Update actions, test 2.11 --- .github/workflows/test.yml | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 374b880..08535e2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,8 +4,8 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 with: python-version: '3.10' - name: Install requirements @@ -19,16 +19,16 @@ jobs: needs: lint strategy: matrix: - ckan-version: ["2.10", 2.9, 2.9-py2, 2.8, 2.7] + ckan-version: ["2.11", "2.10", 2.9] fail-fast: false name: CKAN ${{ matrix.ckan-version }} runs-on: ubuntu-latest container: - image: openknowledge/ckan-dev:${{ matrix.ckan-version }} + image: ckan/ckan-dev:${{ matrix.ckan-version }} services: solr: - image: ckan/ckan-solr:${{ matrix.ckan-version }} + image: ckan/ckan-solr:${{ matrix.ckan-version }}-solr9 postgres: image: ckan/ckan-postgres-dev:${{ matrix.ckan-version }} env: @@ -46,7 +46,7 @@ jobs: CKAN_REDIS_URL: redis://redis:6379/1 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install requirements run: | pip install -r requirements.txt @@ -54,15 +54,9 @@ jobs: 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 (CKAN >= 2.9) - if: ${{ matrix.ckan-version != '2.7' && matrix.ckan-version != '2.8' }} + - name: Setup extension run: | ckan -c test.ini db init ckan -c test.ini archiver init - - name: Setup extension (CKAN < 2.9) - if: ${{ matrix.ckan-version == '2.7' || matrix.ckan-version == '2.8' }} - run: | - paster --plugin=ckan db init -c test.ini - paster --plugin=ckanext-archiver archiver init -c test.ini - name: Run tests run: pytest --ckan-ini=test.ini --cov=ckanext.archiver --disable-warnings ckanext/archiver/tests From 5c16466a0db4b3cc0178cc8e7919486ef9a3882d Mon Sep 17 00:00:00 2001 From: amercader Date: Wed, 17 Jul 2024 12:13:22 +0200 Subject: [PATCH 2/3] Call parent init method in test plugin --- ckanext/archiver/plugin.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ckanext/archiver/plugin.py b/ckanext/archiver/plugin.py index beb37e2..5bb2b85 100644 --- a/ckanext/archiver/plugin.py +++ b/ckanext/archiver/plugin.py @@ -238,6 +238,7 @@ class TestIPipePlugin(p.SingletonPlugin): p.implements(IPipe, inherit=True) def __init__(self, *args, **kwargs): + super().__init__() self.calls = [] def reset(self): From 14aa5e8d4c7abf49e756215b3968fabd918d3375 Mon Sep 17 00:00:00 2001 From: amercader Date: Wed, 17 Jul 2024 12:18:22 +0200 Subject: [PATCH 3/3] Pass args to parent method --- ckanext/archiver/plugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ckanext/archiver/plugin.py b/ckanext/archiver/plugin.py index 5bb2b85..15c0c36 100644 --- a/ckanext/archiver/plugin.py +++ b/ckanext/archiver/plugin.py @@ -238,7 +238,7 @@ class TestIPipePlugin(p.SingletonPlugin): p.implements(IPipe, inherit=True) def __init__(self, *args, **kwargs): - super().__init__() + super().__init__(*args, **kwargs) self.calls = [] def reset(self):