6
0
mirror of https://github.com/ChristianLight/tutor.git synced 2025-01-09 16:36:29 +00:00

feat: set EDXAPP_TEST_MONGO_HOST=mongodb in openedx-dev (#1083)

Currently, we are asking devs to set this env var manually before they run tests.
We may as well save them some keystrokes by setting it in the dev image
programmatically.
This commit is contained in:
Kyle McCormick 2024-08-27 14:19:26 -04:00 committed by GitHub
parent eccb4d182e
commit 6cdedddd22
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 1 deletions

View File

@ -0,0 +1 @@
[Improvement] Set `EDXAPP_TEST_MONGO_HOST` env var in the openedx-dev image so that it no longer needs to be set by hand when running edx-platform unit tests (by @kdmccormick).

View File

@ -151,7 +151,6 @@ Then, run unit tests with ``pytest`` commands::
# Run tests on common apps
unset DJANGO_SETTINGS_MODULE
unset SERVICE_VARIANT
export EDXAPP_TEST_MONGO_HOST=mongodb
pytest common
pytest openedx
pytest xmodule

View File

@ -275,6 +275,10 @@ RUN pip install -e "/mnt/{{ name }}"
# Add ipdb as default PYTHONBREAKPOINT
ENV PYTHONBREAKPOINT=ipdb.set_trace
# Point unit tests at the MongoDB container
ENV EDXAPP_TEST_MONGO_HOST={{ MONGODB_HOST }}
ENV EDXAPP_TEST_MONGO_PORT_NUM={{ MONGODB_PORT }}
# Recompile static assets: in development mode all static assets are stored in edx-platform,
# and the location of these files is stored in webpack-stats.json. If we don't recompile
# static assets, then production assets will be served instead.