From ec49eecced1c35ada45f9979e0d2af4e33d1bf1c Mon Sep 17 00:00:00 2001 From: kiblik Date: Tue, 4 Jun 2024 21:25:06 +0200 Subject: [PATCH] Use Postgres in rest-framework-tests (#9885) * Use Postgres in rest-framework-tests * Try opposite values --------- Co-authored-by: Cody Maffucci <46459665+Maffooch@users.noreply.github.com> --- .github/workflows/rest-framework-tests.yml | 10 +++++----- unittests/test_rest_framework.py | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/rest-framework-tests.yml b/.github/workflows/rest-framework-tests.yml index d50c837efbe..3f1779fe955 100644 --- a/.github/workflows/rest-framework-tests.yml +++ b/.github/workflows/rest-framework-tests.yml @@ -33,19 +33,19 @@ jobs: run: docker/setEnv.sh unit_tests_cicd # phased startup so we can use the exit code from unit test container - - name: Start MySQL - run: docker compose --env-file ./docker/environments/mysql-redis.env up -d mysql + - name: Start Postgres + run: docker compose --env-file ./docker/environments/postgres-redis.env up -d postgres # no celery or initializer needed for unit tests - name: Unit tests - run: docker compose --profile mysql-redis --env-file ./docker/environments/mysql-redis.env up --no-deps --exit-code-from uwsgi uwsgi + run: docker compose --profile postgres-redis --env-file ./docker/environments/postgres-redis.env up --no-deps --exit-code-from uwsgi uwsgi env: DJANGO_VERSION: ${{ matrix.os }} - name: Logs if: failure() - run: docker compose --profile mysql-redis --env-file ./docker/environments/mysql-redis.env logs --tail="2500" uwsgi + run: docker compose --profile postgres-redis --env-file ./docker/environments/postgres-redis.env logs --tail="2500" uwsgi - name: Shutdown if: always() - run: docker compose --profile mysql-redis --env-file ./docker/environments/mysql-redis.env down + run: docker compose --profile postgres-redis --env-file ./docker/environments/postgres-redis.env down diff --git a/unittests/test_rest_framework.py b/unittests/test_rest_framework.py index 823a10f3b59..32e527b8d97 100644 --- a/unittests/test_rest_framework.py +++ b/unittests/test_rest_framework.py @@ -1576,7 +1576,7 @@ def __init__(self, *args, **kwargs): self.permission_create = Permissions.Test_Add self.permission_update = Permissions.Test_Edit self.permission_delete = Permissions.Test_Delete - self.deleted_objects = 18 + self.deleted_objects = 5 BaseClass.RESTEndpointTest.__init__(self, *args, **kwargs) @@ -2676,7 +2676,7 @@ def __init__(self, *args, **kwargs): } self.update_fields = {'color': 'blue'} self.test_type = TestType.CONFIGURATION_PERMISSIONS - self.deleted_objects = 2 + self.deleted_objects = 1 BaseClass.RESTEndpointTest.__init__(self, *args, **kwargs)