From 25297013fb5134955c225db1272f4d4e284b08db Mon Sep 17 00:00:00 2001 From: Lova ANDRIARIMALALA <43842786+Xpirix@users.noreply.github.com> Date: Fri, 1 Dec 2023 13:55:40 +0300 Subject: [PATCH] Fix test error in GH actions. --- .github/workflows/test.yaml | 2 + dockerize/docker-compose.yml | 230 +++++++++--------- dockerize/docker/REQUIREMENTS.txt | 8 +- .../migrations/0004_merge_20231122_0223.py | 14 ++ 4 files changed, 139 insertions(+), 115 deletions(-) create mode 100644 qgis-app/plugins/migrations/0004_merge_20231122_0223.py diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index afc17f03..4cce243a 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -60,8 +60,10 @@ jobs: python manage.py makemigrations python manage.py migrate coverage run manage.py test + exit_code=$? coverage xml EOF + exit $exit_cod - name: Upload coverage to codecov uses: codecov/codecov-action@v2 diff --git a/dockerize/docker-compose.yml b/dockerize/docker-compose.yml index 2ee672fb..5380e3b1 100644 --- a/dockerize/docker-compose.yml +++ b/dockerize/docker-compose.yml @@ -1,117 +1,123 @@ -db: - container_name: qgis-plugins-db - image: kartoza/postgis:9.6-2.4 - environment: - - ALLOW_IP_RANGE=0.0.0.0/0 - - POSTGRES_USER=docker - - POSTGRES_PASS=docker - volumes: - - ./backups:/backups - restart: unless-stopped +version: "3.8" -web: - # Note you cannot scale if you use container_name - container_name: qgis-plugins-web - build: docker - hostname: uwsgi - environment: - - DATABASE_NAME=gis - - DATABASE_USERNAME=docker - - DATABASE_PASSWORD=docker - - DATABASE_HOST=db - - DJANGO_SETTINGS_MODULE=settings_docker - - VIRTUAL_HOST=plugins.kartoza.com - - VIRTUAL_PORT=8080 - - DEBUG=False - - RABBITMQ_HOST=rabbitmq - volumes: - - ../qgis-app:/home/web/django_project - - ./static:/home/web/static:rw - - ./static:/home/web/media:rw - links: - - db:db - - rabbitmq:rabbitmq - - worker:worker - restart: unless-stopped - user: root - command: uwsgi --ini /uwsgi.conf +volumes: + django-media-data: {} -devweb: - # Note you cannot scale if you use container_name - container_name: qgis-plugins-devweb - build: docker - hostname: uwsgi - environment: - - DATABASE_NAME=gis - - DATABASE_USERNAME=docker - - DATABASE_PASSWORD=docker - - DATABASE_HOST=db - - DJANGO_SETTINGS_MODULE=settings_docker - - VIRTUAL_HOST=plugins.kartoza.com - - VIRTUAL_PORT=8080 - - RABBITMQ_HOST=rabbitmq - volumes: - - ../qgis-app:/home/web/django_project - - ./static:/home/web/static:rw - - ./static:/home/web/media:rw - links: - - db:db - - rabbitmq:rabbitmq - - worker:worker - restart: unless-stopped - user: root - ports: - # for django test server - - "62202:8080" - # for ssh - - "62203:22" +services: + db: + container_name: qgis-plugins-db + image: kartoza/postgis:9.6-2.4 + environment: + - ALLOW_IP_RANGE=0.0.0.0/0 + - POSTGRES_USER=docker + - POSTGRES_PASS=docker + volumes: + - ./backups:/backups + restart: unless-stopped -rabbitmq: - image: library/rabbitmq:3.6 - hostname: rabbitmq - environment: - - RABBIT_PASSWORD=rabbit_test_password - - USER=rabbit_user - - RABBITMQ_NODENAME=rabbit - restart: unless-stopped + web: + # Note you cannot scale if you use container_name + container_name: qgis-plugins-web + build: docker + hostname: uwsgi + environment: + - DATABASE_NAME=gis + - DATABASE_USERNAME=docker + - DATABASE_PASSWORD=docker + - DATABASE_HOST=db + - DJANGO_SETTINGS_MODULE=settings_docker + - VIRTUAL_HOST=plugins.kartoza.com + - VIRTUAL_PORT=8080 + - DEBUG=False + - RABBITMQ_HOST=rabbitmq + volumes: + - ../qgis-app:/home/web/django_project + - ./static:/home/web/static:rw + - ./static:/home/web/media:rw + links: + - db:db + - rabbitmq:rabbitmq + - worker:worker + restart: unless-stopped + user: root + command: uwsgi --ini /uwsgi.conf -worker: - # Note you cannot scale if you use container_name - container_name: qgis-plugins-worker - build: docker - hostname: uwsgi - working_dir: /home/web/django_project - command: celery -A plugins worker -l info - environment: - - DATABASE_NAME=gis - - DATABASE_USERNAME=docker - - DATABASE_PASSWORD=docker - - DATABASE_HOST=db - - DJANGO_SETTINGS_MODULE=settings_docker - - VIRTUAL_HOST=plugins.kartoza.com - - VIRTUAL_PORT=8080 - - RABBITMQ_HOST=rabbitmq - volumes: - - ../qgis-app:/home/web/django_project - - ./static:/home/web/static:rw - - ./static:/home/web/media:rw - links: - - db:db - - rabbitmq:rabbitmq + devweb: + # Note you cannot scale if you use container_name + container_name: qgis-plugins-devweb + build: docker + hostname: uwsgi + environment: + - DATABASE_NAME=gis + - DATABASE_USERNAME=docker + - DATABASE_PASSWORD=docker + - DATABASE_HOST=db + - DJANGO_SETTINGS_MODULE=settings_docker + - VIRTUAL_HOST=plugins.kartoza.com + - VIRTUAL_PORT=8080 + - RABBITMQ_HOST=rabbitmq + volumes: + - ../qgis-app:/home/web/django_project + - ./static:/home/web/static:rw + - ./static:/home/web/media:rw + links: + - db:db + - rabbitmq:rabbitmq + - worker:worker + restart: unless-stopped + user: root + ports: + # for django test server + - "62202:8080" + # for ssh + - "62203:22" -nginx: - # Note you cannot scale if you use container_name - container_name: qgis-plugins-nginx - image: nginx - hostname: nginx - volumes: - - ./sites-enabled:/etc/nginx/conf.d:ro - # I dont use volumes_from as I want to use the ro modifier - - ./static:/home/web/static:ro - - ./static:/home/web/media:ro - - ./logs:/var/log/nginx - links: - - web:uwsgi - ports: - - "62201:8080" - restart: unless-stopped + rabbitmq: + image: library/rabbitmq:3.6 + hostname: rabbitmq + environment: + - RABBIT_PASSWORD=rabbit_test_password + - USER=rabbit_user + - RABBITMQ_NODENAME=rabbit + restart: unless-stopped + + worker: + # Note you cannot scale if you use container_name + container_name: qgis-plugins-worker + build: docker + hostname: uwsgi + working_dir: /home/web/django_project + command: celery -A plugins worker -l info + environment: + - DATABASE_NAME=gis + - DATABASE_USERNAME=docker + - DATABASE_PASSWORD=docker + - DATABASE_HOST=db + - DJANGO_SETTINGS_MODULE=settings_docker + - VIRTUAL_HOST=plugins.kartoza.com + - VIRTUAL_PORT=8080 + - RABBITMQ_HOST=rabbitmq + volumes: + - ../qgis-app:/home/web/django_project + - ./static:/home/web/static:rw + - ./static:/home/web/media:rw + links: + - db:db + - rabbitmq:rabbitmq + + nginx: + # Note you cannot scale if you use container_name + container_name: qgis-plugins-nginx + image: nginx + hostname: nginx + volumes: + - ./sites-enabled:/etc/nginx/conf.d:ro + # I dont use volumes_from as I want to use the ro modifier + - ./static:/home/web/static:ro + - ./static:/home/web/media:ro + - ./logs:/var/log/nginx + links: + - web:uwsgi + ports: + - "62201:8080" + restart: unless-stopped diff --git a/dockerize/docker/REQUIREMENTS.txt b/dockerize/docker/REQUIREMENTS.txt index 2b324a66..c4ef0466 100644 --- a/dockerize/docker/REQUIREMENTS.txt +++ b/dockerize/docker/REQUIREMENTS.txt @@ -1,7 +1,7 @@ django==2.2.25 django-auth-ldap python-ldap -django-taggit +django-taggit==2.0.0 django-tinymce==3.4.0 psycopg2 # Updates for Django 2 @@ -21,8 +21,10 @@ django-sortable-listview sorl-thumbnail django-extensions django-debug-toolbar==1.11.1 -whoosh -django-haystack +# Updates for Django 2 +git+https://github.com/Xpirix/whoosh.git +pickle5==0.0.12 +django-haystack==3.2.1 # Feedjack==0.9.18 # So use George's fork rather diff --git a/qgis-app/plugins/migrations/0004_merge_20231122_0223.py b/qgis-app/plugins/migrations/0004_merge_20231122_0223.py new file mode 100644 index 00000000..8251bc87 --- /dev/null +++ b/qgis-app/plugins/migrations/0004_merge_20231122_0223.py @@ -0,0 +1,14 @@ +# Generated by Django 2.2.25 on 2023-11-30 05:13 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('plugins', '0002_plugins_feedback'), + ('plugins', '0003_plugin_allow_update_name'), + ] + + operations = [ + ]