From 19bafa0af98beb219e34cf7270387c23735809df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Hagberg?= Date: Mon, 11 Nov 2024 16:14:41 +0100 Subject: [PATCH 1/7] Fix requirements.txt --- requirements.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index b2d47ca9..0bf3acde 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,6 +11,7 @@ psycopg2-binary==2.9.9 pika==1.3.2 sentry-sdk==2.12.0 tzdata==2024.1 +unittest_parametrize==1.5.0 # For OpenAPI schema generation. -uritemplate -pyyaml +#uritemplate +#pyyaml From b4a3e19e74f297c3800179a88c3fed6cc20995b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Hagberg?= Date: Tue, 12 Nov 2024 11:13:33 +0100 Subject: [PATCH 2/7] Install mreg-cli from binary release --- .github/workflows/container-image.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/container-image.yml b/.github/workflows/container-image.yml index baca73f4..9ad95568 100644 --- a/.github/workflows/container-image.yml +++ b/.github/workflows/container-image.yml @@ -77,14 +77,17 @@ jobs: with: python-version: 3.11 - name: Install mreg-cli + run: | + curl -L -o mreg-cli https://github.com/unioslo/mreg-cli/releases/download/1.0.1/mreg-cli-ubuntu-latest-3.12 + chmod 0755 mreg-cli + mv mreg-cli /usr/bin/ + - name: Run the tests run: | wget -nd https://github.com/unioslo/mreg-cli/archive/refs/heads/master.zip unzip master.zip cd mreg-cli-master - pip install -r requirements.txt - pip install -e . - - name: Run the tests - run: mreg-cli-master/ci/run_testsuite_and_record.sh + pip install -r requirements-dev.txt + mreg-cli-master/ci/run_testsuite_and_record.sh - name: Upload the log as an artifact uses: actions/upload-artifact@v4 with: From 775da7ba06c5857f84dbac201f55562dcdc5ec87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Hagberg?= Date: Tue, 12 Nov 2024 11:28:18 +0100 Subject: [PATCH 3/7] Fix action versions and sudo --- .github/workflows/container-image.yml | 2 +- .github/workflows/test.yml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/container-image.yml b/.github/workflows/container-image.yml index 9ad95568..da838047 100644 --- a/.github/workflows/container-image.yml +++ b/.github/workflows/container-image.yml @@ -80,7 +80,7 @@ jobs: run: | curl -L -o mreg-cli https://github.com/unioslo/mreg-cli/releases/download/1.0.1/mreg-cli-ubuntu-latest-3.12 chmod 0755 mreg-cli - mv mreg-cli /usr/bin/ + sudo mv mreg-cli /usr/bin/ # put it somewhere in $PATH - name: Run the tests run: | wget -nd https://github.com/unioslo/mreg-cli/archive/refs/heads/master.zip diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4efc6b70..36975348 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -39,9 +39,9 @@ jobs: - "3.12" steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Cache pip - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.cache/pip key: v1-pip-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('requirements-*.txt') }} @@ -50,7 +50,7 @@ jobs: v1-pip-${{ runner.os }} v1-pip- - name: Install Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install dependencies @@ -76,7 +76,7 @@ jobs: # name: openapi.yml # path: openapi.yml - name: Upload coverage - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: coverage-${{ matrix.python-version }} path: .coverage From c6267f45b1f3b16c18e84bdd385c3ee5f9e27c4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Hagberg?= Date: Tue, 12 Nov 2024 12:29:44 +0100 Subject: [PATCH 4/7] Fix path --- .github/workflows/container-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/container-image.yml b/.github/workflows/container-image.yml index da838047..60115b1c 100644 --- a/.github/workflows/container-image.yml +++ b/.github/workflows/container-image.yml @@ -87,7 +87,7 @@ jobs: unzip master.zip cd mreg-cli-master pip install -r requirements-dev.txt - mreg-cli-master/ci/run_testsuite_and_record.sh + ci/run_testsuite_and_record.sh - name: Upload the log as an artifact uses: actions/upload-artifact@v4 with: From 5297c5d80df607a0d200b7f66775179385ec4d87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Hagberg?= Date: Tue, 12 Nov 2024 13:26:58 +0100 Subject: [PATCH 5/7] Use mreg-cli.conf from the mreg-cli repo --- .github/workflows/container-image.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/container-image.yml b/.github/workflows/container-image.yml index 60115b1c..c4c77e5c 100644 --- a/.github/workflows/container-image.yml +++ b/.github/workflows/container-image.yml @@ -86,6 +86,7 @@ jobs: wget -nd https://github.com/unioslo/mreg-cli/archive/refs/heads/master.zip unzip master.zip cd mreg-cli-master + cp data/mreg-cli.conf ~/.config/mreg-cli.conf pip install -r requirements-dev.txt ci/run_testsuite_and_record.sh - name: Upload the log as an artifact From 9d81b97507b97ef65ee3adb35e78c62d271ffb89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Hagberg?= Date: Tue, 12 Nov 2024 14:16:57 +0100 Subject: [PATCH 6/7] Fix broken migrations check --- .github/workflows/test.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 36975348..8a66ae8f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -66,7 +66,9 @@ jobs: env: MREG_DB_PASSWORD: postgres - name: Check migrations - run: python manage.py makemigrations --check + run: | + export MREG_DB_NAME=mreg MREG_DB_USER=mreg MREG_DB_PASSWORD=postgres + python manage.py makemigrations --check # - name: Export OpenAPI schema # run: python manage.py generateschema > openapi.yml # - name: Upload OpenAPI schema @@ -107,11 +109,11 @@ jobs: v1-pip-${{ runner.os }} v1-pip- - name: Install Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Download coverage - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: coverage-${{ matrix.python-version }} - name: Install Coveralls From 514743ca24fc729bfe707d9495ed971d89d4c013 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Hagberg?= Date: Tue, 12 Nov 2024 15:18:06 +0100 Subject: [PATCH 7/7] Fix upload artifact for coveralls --- .github/workflows/test.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8a66ae8f..cd0a6cc5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -82,6 +82,7 @@ jobs: with: name: coverage-${{ matrix.python-version }} path: .coverage + include-hidden-files: true coveralls: if: ${{ github.event_name == 'pull_request' || github.repository == 'unioslo/mreg' }} @@ -99,9 +100,9 @@ jobs: - "3.12" steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Cache pip - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.cache/pip key: v1-pip-${{ runner.os }}-${{ matrix.python-version }}