From 0238bc369837e3a4730221933b3d869d8fe25ee0 Mon Sep 17 00:00:00 2001 From: James McKinney <26463+jpmckinney@users.noreply.github.com> Date: Mon, 7 Oct 2024 18:45:28 -0400 Subject: [PATCH 1/4] chore: Fix open file errors in tests --- tests/lib/test_common.py | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/tests/lib/test_common.py b/tests/lib/test_common.py index 2a45fd6..32510d5 100644 --- a/tests/lib/test_common.py +++ b/tests/lib/test_common.py @@ -1183,18 +1183,23 @@ def common_fixtures(filename): def test_get_field_coverage_oc4ids(): # Compare the actual json output, to ensure order is the same - assert ( - json.dumps( - get_field_coverage( - schema_obj_from_str( - open(common_fixtures("oc4ids_project-schema_0__9__2.json")).read() + with open( + common_fixtures("oc4ids_example_coverage.json") + ) as schema_file_with_coverage, open( + common_fixtures("oc4ids_project-schema_0__9__2.json") + ) as schema_file, open( + common_fixtures("oc4ids_example.json") + ) as data_file: + assert ( + json.dumps( + get_field_coverage( + schema_obj_from_str(schema_file.read()), + json.load(data_file)["projects"], ), - json.load(open(common_fixtures("oc4ids_example.json")))["projects"], - ), - indent=2, + indent=2, + ) + == schema_file_with_coverage.read() ) - == open(common_fixtures("oc4ids_example_coverage.json")).read() - ) @pytest.mark.parametrize( From 833e5cfd91d360f927436a54cd0abccbf6b256a3 Mon Sep 17 00:00:00 2001 From: James McKinney <26463+jpmckinney@users.noreply.github.com> Date: Mon, 7 Oct 2024 23:06:14 -0400 Subject: [PATCH 2/4] ci: Update path to Django settings in cove-ocds and cove-oc4ids --- .github/workflows/integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 25cde07..1399c98 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -48,7 +48,7 @@ jobs: - name: Test cove instance run: | cd cove-${{ matrix.cove }} - DJANGO_SETTINGS_MODULE=cove_project.settings py.test + DJANGO_SETTINGS_MODULE=core.settings py.test - name: Test cove lib instance run: | From f2e7ba2e877014fc70031abd09990a6724e417c1 Mon Sep 17 00:00:00 2001 From: James McKinney <26463+jpmckinney@users.noreply.github.com> Date: Tue, 8 Oct 2024 23:05:38 -0400 Subject: [PATCH 3/4] ci: Run collectstatic to satisfy ManifestStaticFilesStorage --- .github/workflows/integration.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 1399c98..8b51276 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -48,6 +48,7 @@ jobs: - name: Test cove instance run: | cd cove-${{ matrix.cove }} + ./manage.py collectstatic --noinput -v2 DJANGO_SETTINGS_MODULE=core.settings py.test - name: Test cove lib instance From 873a8c5093785bf3905360d16068ebd769f8a03d Mon Sep 17 00:00:00 2001 From: James McKinney <26463+jpmckinney@users.noreply.github.com> Date: Wed, 9 Oct 2024 14:29:05 -0400 Subject: [PATCH 4/4] ci: Upgrade integration tests to Python 3.11 --- .github/workflows/integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 8b51276..2b222bb 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -10,7 +10,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: '3.10' + python-version: '3.11' cache: pip cache-dependency-path: '**/requirements*.txt' - name: InstallCommon