Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions .github/workflows/engine_pr_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ jobs:
sleep 5 # wait for 5 seconds before check again
done
pytest -xs --doctest-modules --disable-warnings --color=yes openquake/commands openquake/engine
pytest -v openquake/server/tests/test_public_mode.py
# -v 2 also logs the test names
./openquake/server/manage.py test -v 2 tests.test_public_mode

server_read_only_mode:
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -139,7 +140,8 @@ jobs:
run: |
source ~/openquake/bin/activate
oq engine --upgrade-db
pytest -v openquake/server/tests/test_read_only_mode.py
# -v 2 also logs the test names
./openquake/server/manage.py test -v 2 tests.test_read_only_mode

server_aelo_mode:
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -172,7 +174,8 @@ jobs:
./openquake/server/manage.py migrate
./openquake/server/manage.py loaddata openquake/server/fixtures/0001_cookie_consent_required_plus_hide_cookie_bar.json
./openquake/server/manage.py collectstatic --noinput
pytest -v openquake/server/tests/test_aelo_mode.py
# -v 2 also logs the test names
./openquake/server/manage.py test -v 2 tests.test_aelo_mode

server_aristotle_mode:
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -212,4 +215,5 @@ jobs:
oq engine --upgrade-db
./openquake/server/manage.py migrate
touch ~/webui-access.log
pytest -v openquake/server/tests/test_aristotle_mode.py
# -v 2 also logs the test names
./openquake/server/manage.py test -v 2 tests.test_aristotle_mode
6 changes: 4 additions & 2 deletions .github/workflows/macos_intel_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,16 @@ jobs:
run: |
source ~/openquake/bin/activate
cd ~/work/oq-engine/oq-engine
OQ_APPLICATION_MODE=PUBLIC pytest -v openquake/server/tests/test_public_mode.py
# -v 2 also logs the test names
OQ_APPLICATION_MODE=PUBLIC ./openquake/server/manage.py test -v 2 tests.test_public_mode

- name: Run tests for the engine server in read-only mode to test installation
if: always()
run: |
source ~/openquake/bin/activate
cd ~/work/oq-engine/oq-engine
OQ_APPLICATION_MODE=READ_ONLY pytest -v openquake/server/tests/test_read_only_mode.py
# -v 2 also logs the test names
OQ_APPLICATION_MODE=READ_ONLY ./openquake/server/manage.py test -v 2 tests.test_read_only_mode

# NOTE: we shouldn't need to install the engine in AELO mode on mac
# - name: Run tests for the engine server in aelo mode to test installation
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/macos_m1_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,15 @@ jobs:
run: |
source ~/openquake/bin/activate
cd /Users/runner/runner-isolation/actions-runner/_work/oq-engine/oq-engine/
OQ_APPLICATION_MODE=PUBLIC pytest -v openquake/server/tests/test_public_mode.py
# -v 2 also logs the test names
OQ_APPLICATION_MODE=PUBLIC ./openquake/server/manage.py test -v 2 tests.test_public_mode

- name: Run tests for the engine server in read-only mode to test installation
if: always()
run: |
source ~/openquake/bin/activate
cd /Users/runner/runner-isolation/actions-runner/_work/oq-engine/oq-engine/
OQ_APPLICATION_MODE=READ_ONLY pytest -v openquake/server/tests/test_read_only_mode.py
OQ_APPLICATION_MODE=READ_ONLY ./openquake/server/manage.py test -v 2 tests.test_read_only_mode

# NB: the demos are tested on linux; there is no reason a demo should
# not run on macos, so we can avoid running them
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/windows_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ jobs:
sleep 10
cd D:\a\oq-engine\oq-engine
$Env:OQ_APPLICATION_MODE='PUBLIC'
pytest -v openquake\server\tests\test_public_mode.py
# -v 2 also logs the test names
python .\openquake\server\manage.py test -v 2 tests.test_public_mode

- name: Run tests for the engine server in read-only mode to test installation
if: always() && env.to_run == 0
Expand All @@ -133,7 +134,8 @@ jobs:
sleep 10
cd D:\a\oq-engine\oq-engine
$Env:OQ_APPLICATION_MODE='READ_ONLY'
pytest -v openquake\server\tests\test_read_only_mode.py
# -v 2 also logs the test names
python .\openquake\server\manage.py test -v 2 tests.test_read_only_mode

- name: Run all demos
if: env.to_run == 0
Expand Down
30 changes: 0 additions & 30 deletions conftest.py

This file was deleted.

2 changes: 1 addition & 1 deletion openquake/server/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
WEBUI_USER = 'openquake'

TEST = 'test' in sys.argv or any('pytest' in arg for arg in sys.argv)
TEST = 'test' in sys.argv

INSTALLED_APPS = ('openquake.server.db',)

Expand Down
1 change: 0 additions & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@
markers =
slow: a slow test
addopts = --tb short
DJANGO_SETTINGS_MODULE = openquake.server.settings
1 change: 0 additions & 1 deletion requirements-py310-linux64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,3 @@ https://wheelhouse.openquake.org/v3/py/zipp-3.17.0-py3-none-any.whl
https://wheelhouse.openquake.org/v3/py/pluggy-1.5.0-py3-none-any.whl
https://wheelhouse.openquake.org/v3/py/pytest-8.3.3-py3-none-any.whl
https://wheelhouse.openquake.org/v3/py/django_appconf-1.0.6-py3-none-any.whl
https://wheelhouse.openquake.org/v3/py/pytest_django-4.9.0-py3-none-any.whl
1 change: 0 additions & 1 deletion requirements-py310-macos_arm64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,3 @@ https://wheelhouse.openquake.org/v3/py/zipp-3.17.0-py3-none-any.whl
https://wheelhouse.openquake.org/v3/py/pluggy-1.5.0-py3-none-any.whl
https://wheelhouse.openquake.org/v3/py/pytest-8.3.3-py3-none-any.whl
https://wheelhouse.openquake.org/v3/py/django_appconf-1.0.6-py3-none-any.whl
https://wheelhouse.openquake.org/v3/py/pytest_django-4.9.0-py3-none-any.whl
1 change: 0 additions & 1 deletion requirements-py310-macos_x86_64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,3 @@ https://wheelhouse.openquake.org/v3/py/zipp-3.17.0-py3-none-any.whl
https://wheelhouse.openquake.org/v3/py/pluggy-1.5.0-py3-none-any.whl
https://wheelhouse.openquake.org/v3/py/pytest-8.3.3-py3-none-any.whl
https://wheelhouse.openquake.org/v3/py/django_appconf-1.0.6-py3-none-any.whl
https://wheelhouse.openquake.org/v3/py/pytest_django-4.9.0-py3-none-any.whl
1 change: 0 additions & 1 deletion requirements-py310-win64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,3 @@ https://wheelhouse.openquake.org/v3/py/zipp-3.17.0-py3-none-any.whl
https://wheelhouse.openquake.org/v3/py/pluggy-1.5.0-py3-none-any.whl
https://wheelhouse.openquake.org/v3/py/pytest-8.3.3-py3-none-any.whl
https://wheelhouse.openquake.org/v3/py/django_appconf-1.0.6-py3-none-any.whl
https://wheelhouse.openquake.org/v3/py/pytest_django-4.9.0-py3-none-any.whl
1 change: 0 additions & 1 deletion requirements-py311-linux64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,3 @@ https://wheelhouse.openquake.org/v3/py/zipp-3.17.0-py3-none-any.whl
https://wheelhouse.openquake.org/v3/py/pluggy-1.5.0-py3-none-any.whl
https://wheelhouse.openquake.org/v3/py/pytest-8.3.3-py3-none-any.whl
https://wheelhouse.openquake.org/v3/py/django_appconf-1.0.6-py3-none-any.whl
https://wheelhouse.openquake.org/v3/py/pytest_django-4.9.0-py3-none-any.whl
1 change: 0 additions & 1 deletion requirements-py311-macos_arm64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,3 @@ https://wheelhouse.openquake.org/v3/py/zipp-3.17.0-py3-none-any.whl
https://wheelhouse.openquake.org/v3/py/pluggy-1.5.0-py3-none-any.whl
https://wheelhouse.openquake.org/v3/py/pytest-8.3.3-py3-none-any.whl
https://wheelhouse.openquake.org/v3/py/django_appconf-1.0.6-py3-none-any.whl
https://wheelhouse.openquake.org/v3/py/pytest_django-4.9.0-py3-none-any.whl
1 change: 0 additions & 1 deletion requirements-py311-macos_x86_64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,3 @@ https://wheelhouse.openquake.org/v3/py/zipp-3.17.0-py3-none-any.whl
https://wheelhouse.openquake.org/v3/py/pluggy-1.5.0-py3-none-any.whl
https://wheelhouse.openquake.org/v3/py/pytest-8.3.3-py3-none-any.whl
https://wheelhouse.openquake.org/v3/py/django_appconf-1.0.6-py3-none-any.whl
https://wheelhouse.openquake.org/v3/py/pytest_django-4.9.0-py3-none-any.whl
1 change: 0 additions & 1 deletion requirements-py311-win64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,3 @@ https://wheelhouse.openquake.org/v3/py/zipp-3.17.0-py3-none-any.whl
https://wheelhouse.openquake.org/v3/py/pluggy-1.5.0-py3-none-any.whl
https://wheelhouse.openquake.org/v3/py/pytest-8.3.3-py3-none-any.whl
https://wheelhouse.openquake.org/v3/py/django_appconf-1.0.6-py3-none-any.whl
https://wheelhouse.openquake.org/v3/py/pytest_django-4.9.0-py3-none-any.whl
1 change: 0 additions & 1 deletion requirements-py312-linux64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,3 @@ https://wheelhouse.openquake.org/v3/py/zipp-3.17.0-py3-none-any.whl
https://wheelhouse.openquake.org/v3/py/pluggy-1.5.0-py3-none-any.whl
https://wheelhouse.openquake.org/v3/py/pytest-8.3.3-py3-none-any.whl
https://wheelhouse.openquake.org/v3/py/django_appconf-1.0.6-py3-none-any.whl
https://wheelhouse.openquake.org/v3/py/pytest_django-4.9.0-py3-none-any.whl
1 change: 0 additions & 1 deletion requirements-py312-macos_arm64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,3 @@ https://wheelhouse.openquake.org/v3/py/zipp-3.17.0-py3-none-any.whl
https://wheelhouse.openquake.org/v3/py/pluggy-1.5.0-py3-none-any.whl
https://wheelhouse.openquake.org/v3/py/pytest-8.3.3-py3-none-any.whl
https://wheelhouse.openquake.org/v3/py/django_appconf-1.0.6-py3-none-any.whl
https://wheelhouse.openquake.org/v3/py/pytest_django-4.9.0-py3-none-any.whl
1 change: 0 additions & 1 deletion requirements-py312-macos_x86_64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,3 @@ https://wheelhouse.openquake.org/v3/py/zipp-3.17.0-py3-none-any.whl
https://wheelhouse.openquake.org/v3/py/pluggy-1.5.0-py3-none-any.whl
https://wheelhouse.openquake.org/v3/py/pytest-8.3.3-py3-none-any.whl
https://wheelhouse.openquake.org/v3/py/django_appconf-1.0.6-py3-none-any.whl
https://wheelhouse.openquake.org/v3/py/pytest_django-4.9.0-py3-none-any.whl
1 change: 0 additions & 1 deletion requirements-py312-win64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,3 @@ https://wheelhouse.openquake.org/v3/py/zipp-3.17.0-py3-none-any.whl
https://wheelhouse.openquake.org/v3/py/pluggy-1.5.0-py3-none-any.whl
https://wheelhouse.openquake.org/v3/py/pytest-8.3.3-py3-none-any.whl
https://wheelhouse.openquake.org/v3/py/django_appconf-1.0.6-py3-none-any.whl
https://wheelhouse.openquake.org/v3/py/pytest_django-4.9.0-py3-none-any.whl