-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add rudimentary frontend tests for all functionalities
Implements requested tests in issue #159. Backend and frontend tests now use their own dedicated aiida profile to avoid changes in the aiida database that might affect the tests. For that they have been moved to their own module folder. Frontend tests reuse ran aiida workgraph calculation to save time. CI tests have been splitted into three runs of pytest (see issue #225)
- Loading branch information
1 parent
fce96c4
commit a067792
Showing
7 changed files
with
286 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import pytest | ||
from fastapi.testclient import TestClient | ||
import os | ||
|
||
@pytest.fixture(scope="module", autouse=True) | ||
def aiida_profile(aiida_config, aiida_profile_factory): | ||
"""Create and load a profile with RabbitMQ as broker for backend tests.""" | ||
with aiida_profile_factory(aiida_config, broker_backend="core.rabbitmq") as profile: | ||
yield profile | ||
|
||
|
||
@pytest.fixture(scope="module") | ||
def set_backend_server_settings(aiida_profile): | ||
os.environ["AIIDA_WORKGRAPH_GUI_PROFILE"] = aiida_profile.name | ||
|
||
|
||
@pytest.fixture(scope="module") | ||
def client(set_backend_server_settings): | ||
from aiida_workgraph.web.backend.app.api import app | ||
|
||
return TestClient(app) |
20 changes: 2 additions & 18 deletions
20
tests/web/test_backend.py → tests/web/backend/test_backend.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.