From 8bb4227fa96b1f1d167f1c449ca862fd3ddb467e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89loi=20Rivard?= Date: Fri, 17 May 2024 10:14:30 +0200 Subject: [PATCH] tests: run development server on port 8000 (#1125) Instead of running the dev server on port 8080 inside docker and expose it externally on port 9090. --- Makefile | 8 ++++---- docker-compose-dev-with-volumes.yml | 2 +- docker-compose-full-dev-with-volumes-test.yml | 2 +- docker-compose-full-dev-with-volumes.yml | 2 +- dockerfile-dev-with-volumes/README.adoc | 2 +- dockerfile-dev-with-volumes/pa11y-ci/config.json | 10 +++++----- .../pa11y-ci/config_mobile.json | 10 +++++----- .../pod-back/my-entrypoint-back.sh | 2 +- .../pod-encode/my-entrypoint-encode.sh | 2 +- .../pod-transcript/my-entrypoint-transcript.sh | 2 +- .../pod-xapi/my-entrypoint-xapi.sh | 2 +- dockerfile-dev-with-volumes/pod/my-entrypoint.sh | 2 +- pod/custom/settings_local_docker_full_test.py | 2 +- pod/live/tests/test_models.py | 2 +- pod/main/fixtures/initial_data.json | 4 ++-- 15 files changed, 27 insertions(+), 27 deletions(-) diff --git a/Makefile b/Makefile index c542406ed0..4e6aec51f3 100755 --- a/Makefile +++ b/Makefile @@ -12,16 +12,16 @@ help: # Démarre le serveur de test start: - (sleep 15 ; open http://localhost:9090) & - python3 manage.py runserver localhost:9090 --insecure + (sleep 15 ; open http://localhost:8000) & + python3 manage.py runserver localhost:8000 --insecure # --insecure let serve static files even when DEBUG=False # Démarre le serveur de test en https auto-signé starts: # nécessite les django-extensions # cf https://timonweb.com/django/https-django-development-server-ssl-certificate/ - (sleep 15 ; open https://localhost:9090) & - python3 manage.py runserver_plus localhost:9090 --cert-file cert.pem --key-file key.pem + (sleep 15 ; open https://localhost:8000) & + python3 manage.py runserver_plus localhost:8000 --cert-file cert.pem --key-file key.pem # Première installation de pod (BDD SQLite intégrée) install: diff --git a/docker-compose-dev-with-volumes.yml b/docker-compose-dev-with-volumes.yml index 1b58c29537..36934b3b59 100755 --- a/docker-compose-dev-with-volumes.yml +++ b/docker-compose-dev-with-volumes.yml @@ -18,7 +18,7 @@ services: env_file: - ./.env.dev ports: - - 9090:8080 + - 8000:8000 volumes: *pod-volumes elasticsearch: diff --git a/docker-compose-full-dev-with-volumes-test.yml b/docker-compose-full-dev-with-volumes-test.yml index 607ef863ea..7a369f8e99 100755 --- a/docker-compose-full-dev-with-volumes-test.yml +++ b/docker-compose-full-dev-with-volumes-test.yml @@ -18,7 +18,7 @@ services: env_file: - ./.env.dev ports: - - 9090:8080 + - 8000:8000 volumes: *pod-volumes pod-encode: diff --git a/docker-compose-full-dev-with-volumes.yml b/docker-compose-full-dev-with-volumes.yml index 76c28915c8..b6992bfefe 100755 --- a/docker-compose-full-dev-with-volumes.yml +++ b/docker-compose-full-dev-with-volumes.yml @@ -18,7 +18,7 @@ services: env_file: - ./.env.dev ports: - - 9090:8080 + - 8000:8000 volumes: *pod-volumes pod-encode: diff --git a/dockerfile-dev-with-volumes/README.adoc b/dockerfile-dev-with-volumes/README.adoc index 54290a9bd6..5625e5d806 100755 --- a/dockerfile-dev-with-volumes/README.adoc +++ b/dockerfile-dev-with-volumes/README.adoc @@ -148,7 +148,7 @@ Vous devriez obtenir ce message une fois esup-pod lancé ---- $ pod-dev-with-volumes | Superuser created successfully. ---- -L'application esup-pod est dès lors disponible via cette URL : localhost:9090 +L'application esup-pod est dès lors disponible via cette URL : localhost:8000 === Arrêt de la stack $ CTRL+C dans la fenetre depuis laquelle l'application esup-pod a été lancée diff --git a/dockerfile-dev-with-volumes/pa11y-ci/config.json b/dockerfile-dev-with-volumes/pa11y-ci/config.json index b0772eb470..1d64e38181 100644 --- a/dockerfile-dev-with-volumes/pa11y-ci/config.json +++ b/dockerfile-dev-with-volumes/pa11y-ci/config.json @@ -18,10 +18,10 @@ ] }, "urls": [ - "http://pod-back:8080/", - "http://pod-back:8080/accounts/login", - "http://pod-back:8080/videos", - "http://pod-back:8080/video/0001-video-test/", - "http://pod-back:8080/live/events/" + "http://pod-back:8000/", + "http://pod-back:8000/accounts/login", + "http://pod-back:8000/videos", + "http://pod-back:8000/video/0001-video-test/", + "http://pod-back:8000/live/events/" ] } diff --git a/dockerfile-dev-with-volumes/pa11y-ci/config_mobile.json b/dockerfile-dev-with-volumes/pa11y-ci/config_mobile.json index 3a39f4e972..507e032b44 100644 --- a/dockerfile-dev-with-volumes/pa11y-ci/config_mobile.json +++ b/dockerfile-dev-with-volumes/pa11y-ci/config_mobile.json @@ -19,10 +19,10 @@ ] }, "urls": [ - "http://pod-back:8080/", - "http://pod-back:8080/accounts/login", - "http://pod-back:8080/videos", - "http://pod-back:8080/video/0001-video-test/", - "http://pod-back:8080/live/events/" + "http://pod-back:8000/", + "http://pod-back:8000/accounts/login", + "http://pod-back:8000/videos", + "http://pod-back:8000/video/0001-video-test/", + "http://pod-back:8000/live/events/" ] } diff --git a/dockerfile-dev-with-volumes/pod-back/my-entrypoint-back.sh b/dockerfile-dev-with-volumes/pod-back/my-entrypoint-back.sh index 67d58b7229..7a23c3061f 100644 --- a/dockerfile-dev-with-volumes/pod-back/my-entrypoint-back.sh +++ b/dockerfile-dev-with-volumes/pod-back/my-entrypoint-back.sh @@ -25,5 +25,5 @@ fi # Le serveur de développement permet de tester vos futures modifications facilement. # N'hésitez pas à lancer le serveur de développement pour vérifier vos modifications au fur et à mesure. # À ce niveau, vous devriez avoir le site en français et en anglais et voir l'ensemble de la page d'accueil. -python3 manage.py runserver 0.0.0.0:8080 --insecure +python3 manage.py runserver 0.0.0.0:8000 --insecure sleep infinity diff --git a/dockerfile-dev-with-volumes/pod-encode/my-entrypoint-encode.sh b/dockerfile-dev-with-volumes/pod-encode/my-entrypoint-encode.sh index df727a4b14..a776115a05 100644 --- a/dockerfile-dev-with-volumes/pod-encode/my-entrypoint-encode.sh +++ b/dockerfile-dev-with-volumes/pod-encode/my-entrypoint-encode.sh @@ -1,6 +1,6 @@ #!/bin/sh echo "Launching commands into pod-dev" -until nc -z pod-back 8080; do echo waiting for pod-back; sleep 10; done; +until nc -z pod-back 8000; do echo waiting for pod-back; sleep 10; done; # Serveur d'encodage celery -A pod.video_encode_transcript.encoding_tasks worker -l INFO -Q encoding --concurrency 1 -n encode sleep infinity diff --git a/dockerfile-dev-with-volumes/pod-transcript/my-entrypoint-transcript.sh b/dockerfile-dev-with-volumes/pod-transcript/my-entrypoint-transcript.sh index cdb2b1fe78..08db3ae978 100644 --- a/dockerfile-dev-with-volumes/pod-transcript/my-entrypoint-transcript.sh +++ b/dockerfile-dev-with-volumes/pod-transcript/my-entrypoint-transcript.sh @@ -1,6 +1,6 @@ #!/bin/sh echo "Launching commands into pod-dev" -until nc -z pod-back 8080; do echo waiting for pod-back; sleep 10; done; +until nc -z pod-back 8000; do echo waiting for pod-back; sleep 10; done; # Serveur d'encodage celery -A pod.video_encode_transcript.transcripting_tasks worker -l INFO -Q transcripting --concurrency 1 -n transcript sleep infinity diff --git a/dockerfile-dev-with-volumes/pod-xapi/my-entrypoint-xapi.sh b/dockerfile-dev-with-volumes/pod-xapi/my-entrypoint-xapi.sh index 964472a521..f41937b01e 100644 --- a/dockerfile-dev-with-volumes/pod-xapi/my-entrypoint-xapi.sh +++ b/dockerfile-dev-with-volumes/pod-xapi/my-entrypoint-xapi.sh @@ -1,6 +1,6 @@ #!/bin/sh echo "Launching commands into pod-dev" -until nc -z pod-back 8080; do echo waiting for pod-back; sleep 10; done; +until nc -z pod-back 8000; do echo waiting for pod-back; sleep 10; done; # Serveur xAPI celery -A pod.xapi.xapi_tasks worker -l INFO -Q xapi --concurrency 1 -n xapi sleep infinity diff --git a/dockerfile-dev-with-volumes/pod/my-entrypoint.sh b/dockerfile-dev-with-volumes/pod/my-entrypoint.sh index 67d58b7229..7a23c3061f 100644 --- a/dockerfile-dev-with-volumes/pod/my-entrypoint.sh +++ b/dockerfile-dev-with-volumes/pod/my-entrypoint.sh @@ -25,5 +25,5 @@ fi # Le serveur de développement permet de tester vos futures modifications facilement. # N'hésitez pas à lancer le serveur de développement pour vérifier vos modifications au fur et à mesure. # À ce niveau, vous devriez avoir le site en français et en anglais et voir l'ensemble de la page d'accueil. -python3 manage.py runserver 0.0.0.0:8080 --insecure +python3 manage.py runserver 0.0.0.0:8000 --insecure sleep infinity diff --git a/pod/custom/settings_local_docker_full_test.py b/pod/custom/settings_local_docker_full_test.py index f381222919..986ca7681a 100644 --- a/pod/custom/settings_local_docker_full_test.py +++ b/pod/custom/settings_local_docker_full_test.py @@ -60,7 +60,7 @@ # If DOCKER_ENV = full: activate encoding, transcription and remote xapi USE_REMOTE_ENCODING_TRANSCODING = True ENCODING_TRANSCODING_CELERY_BROKER_URL = 'redis://redis:6379/7' -POD_API_URL = "http://pod-back:8080/rest" +POD_API_URL = "http://pod-back:8000/rest" POD_API_TOKEN = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" USE_TRANSCRIPTION = True diff --git a/pod/live/tests/test_models.py b/pod/live/tests/test_models.py index d8ff270818..4b9ef785ec 100644 --- a/pod/live/tests/test_models.py +++ b/pod/live/tests/test_models.py @@ -290,7 +290,7 @@ def test_attributs(self): event.id = None self.assertEqual(event.__str__(), "None") self.assertEqual(event.get_thumbnail_card(), "/static/img/default-event.svg") - self.assertEqual(event.get_full_url(), "//localhost:9090/live/event/0001-event1/") + self.assertEqual(event.get_full_url(), "//localhost:8000/live/event/0001-event1/") print(" ---> test_attributs of EventTestCase: OK!") def test_add_thumbnail(self): diff --git a/pod/main/fixtures/initial_data.json b/pod/main/fixtures/initial_data.json index 788135ac49..7c66cd5217 100644 --- a/pod/main/fixtures/initial_data.json +++ b/pod/main/fixtures/initial_data.json @@ -3,8 +3,8 @@ "model": "sites.site", "pk": 1, "fields": { - "domain": "localhost:9090", - "name": "localhost:9090" + "domain": "localhost:8000", + "name": "localhost:8000" } }, {