-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Endpoint tests with Sumo data #710
Open
HansKallekleiv
wants to merge
14
commits into
main
Choose a base branch
from
integration-tests
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+303
−88
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
eebfca3
Endpoint tests
HansKallekleiv 1ddd468
Merge branch 'main' of github.com:equinor/webviz
HansKallekleiv 895a4d5
fix
HansKallekleiv a881dde
bandit
HansKallekleiv 3dd2558
bandit
HansKallekleiv edcc7ed
fix deps
HansKallekleiv 43ed018
wip
HansKallekleiv 855764f
wip
HansKallekleiv bd5bfd8
wip
HansKallekleiv bed3b38
wip
HansKallekleiv 079f848
wip
HansKallekleiv 5047146
wip
HansKallekleiv b9bc5bd
wip
HansKallekleiv 8900f80
bump
HansKallekleiv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: integration | ||
|
||
on: | ||
push: | ||
pull_request: | ||
branches: | ||
- main | ||
release: | ||
types: | ||
- published | ||
# workflow_dispatch: | ||
# schedule: | ||
# - cron: "48 4 * * *" | ||
|
||
jobs: | ||
sumo_prod: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
id-token: write | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: 🤖 Get shared key from Sumo | ||
working-directory: ./backend_py/primary | ||
env: | ||
SHARED_KEY_SUMO_PROD: ${{ secrets.SHARED_KEY_DROGON_READ_PROD }} | ||
run: | | ||
if [ ${#SHARED_KEY_SUMO_PROD} -eq 0 ]; then | ||
echo "Error: SHARED_KEY_SUMO_PROD is empty. Stopping the action." | ||
exit 1 | ||
fi | ||
mkdir ~/.sumo | ||
echo $SHARED_KEY_SUMO_PROD > ~/.sumo/9e5443dd-3431-4690-9617-31eed61cb55a.sharedkey | ||
|
||
- name: 🐍 Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.11" | ||
cache: pip | ||
|
||
- name: 📦 Install poetry and dependencies | ||
working-directory: ./backend_py/primary | ||
run: | | ||
pip install --upgrade pip | ||
pip install poetry | ||
poetry config virtualenvs.create false | ||
poetry lock --check --no-update # Check lock file is consistent with pyproject.toml | ||
poetry install --with dev | ||
|
||
- name: 🤖 Run tests | ||
working-directory: ./backend_py/primary | ||
env: | ||
WEBVIZ_CLIENT_SECRET: 0 | ||
WEBVIZ_SMDA_SUBSCRIPTION_KEY: 0 | ||
WEBVIZ_SMDA_RESOURCE_SCOPE: 0 | ||
WEBVIZ_VDS_HOST_ADDRESS: 0 | ||
WEBVIZ_ENTERPRISE_SUBSCRIPTION_KEY: 0 | ||
WEBVIZ_SSDL_RESOURCE_SCOPE: 0 | ||
WEBVIZ_SUMU_ENV: prod | ||
run: | | ||
pytest -s --timeout=300 ./tests/integration |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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,27 @@ | ||
from typing import List, Sequence | ||
|
||
from pydantic import BaseModel | ||
|
||
|
||
class FieldInfo(BaseModel): | ||
field_identifier: str | ||
|
||
|
||
class CaseInfo(BaseModel): | ||
uuid: str | ||
name: str | ||
status: str | ||
user: str | ||
|
||
|
||
class EnsembleInfo(BaseModel): | ||
name: str | ||
realization_count: int | ||
|
||
|
||
class EnsembleDetails(BaseModel): | ||
name: str | ||
field_identifier: str | ||
case_name: str | ||
case_uuid: str | ||
realizations: Sequence[int] |
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,43 @@ | ||
import os | ||
from dataclasses import dataclass | ||
|
||
import pytest | ||
|
||
from primary.services.utils.authenticated_user import AuthenticatedUser, AccessTokens | ||
|
||
|
||
@dataclass | ||
class SumoTestEnsemble: | ||
field_identifier: str | ||
case_uuid: str | ||
case_name: str | ||
ensemble_name: str | ||
|
||
|
||
@pytest.fixture(name="sumo_test_ensemble_ahm", scope="session") | ||
def fixture_sumo_test_ensemble_ahm() -> SumoTestEnsemble: | ||
return SumoTestEnsemble( | ||
field_identifier="DROGON", | ||
case_name="webviz_ahm_case", | ||
case_uuid="485041ce-ad72-48a3-ac8c-484c0ed95cf8", | ||
ensemble_name="iter-0", | ||
) | ||
|
||
|
||
@pytest.fixture(name="sumo_test_ensemble_design", scope="session") | ||
def fixture_sumo_test_ensemble_design() -> SumoTestEnsemble: | ||
return SumoTestEnsemble( | ||
field_identifier="DROGON", | ||
case_name="01_drogon_design", | ||
case_uuid="b89873c8-6f4d-40e5-978c-afc47beb2a26", | ||
ensemble_name="iter-0", | ||
) | ||
|
||
|
||
@pytest.fixture(name="test_user", scope="session") | ||
def fixture_test_user() -> AuthenticatedUser: | ||
token = "DUMMY_TOKEN_FOR_TESTING" | ||
tokens = AccessTokens( | ||
sumo_access_token=token, graph_access_token=None, smda_access_token=None, ssdl_access_token=None | ||
) | ||
return AuthenticatedUser(user_id="test_user", username="test_user", access_tokens=tokens) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is test-folder excluded now?