Skip to content

Commit 51af1dd

Browse files
🐛 Fix e2e tests compatibility (#173)
* update workflow before publishing python package fix dependency issue and bump version point to website in project description fix broken dependency improve doc add github token to download artifacts ensure only read-access @wvangeit yet another attempt at downloading artifacts make sure to use repo that ran the trigger wf another attempt at fixing change owner allow publishing to testpypi also when pr minor change revert minor (but breaking) change minor fix add debug messages another debug message hopefully the final version final fix minor fix move master and tag to individual jobs add debug messages add python script for determining semantic version minor changes minor changes improve error handling and add version file to artifacts check if release minor fix ensure to enter venv also when tagging source venv in publishin workflow ensure only master add script for testing 'pure' semver adapt workflows to new python script minor change attempt to evaluate expressions correctly several fixes to fix tests ensure repo is checked out in publish workflow several small fixes cleanup debug minor cleanup mionr changes add debug message minor change minor change yet another try minor change minor change minor change mionr change minor changes correct workflow run id cosmetic change avoid using gh change to a single job for publishing minor cleanup swap loops in clean up jobs correction get correct versions of github workflow files update a couple of other files update a few more tests update yet another file yet another file * fix conftest.py * use version
1 parent 5ba31db commit 51af1dd

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

clients/python/test/e2e/conftest.py

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,15 @@
1515
import pytest
1616
from httpx import AsyncClient, BasicAuth
1717
from numpy import random
18-
from osparc._models import ConfigurationModel
18+
from packaging.version import Version
1919
from pydantic import ByteSize
2020

21+
try:
22+
from osparc._models import ConfigurationModel
23+
except ImportError:
24+
pass
25+
26+
2127
_KB: ByteSize = ByteSize(1024) # in bytes
2228
_MB: ByteSize = ByteSize(_KB * 1024) # in bytes
2329
_GB: ByteSize = ByteSize(_MB * 1024) # in bytes
@@ -96,12 +102,21 @@ def api_client() -> Iterable[osparc.ApiClient]:
96102

97103
@pytest.fixture
98104
def async_client() -> Iterable[AsyncClient]:
99-
configuration = ConfigurationModel()
105+
if Version(osparc.__version__) >= Version("8.0.0"):
106+
configuration = ConfigurationModel()
107+
host = configuration.OSPARC_API_HOST.rstrip("/")
108+
username = configuration.OSPARC_API_KEY
109+
password = configuration.OSPARC_API_SECRET
110+
else:
111+
host = os.environ.get("OSPARC_API_HOST")
112+
username = os.environ.get("OSPARC_API_KEY")
113+
password = os.environ.get("OSPARC_API_SECRET")
114+
assert host and username and password
100115
yield AsyncClient(
101-
base_url=f"{configuration.OSPARC_API_HOST}".rstrip("/"),
116+
base_url=host,
102117
auth=BasicAuth(
103-
username=configuration.OSPARC_API_KEY,
104-
password=configuration.OSPARC_API_SECRET,
118+
username=username,
119+
password=password,
105120
),
106121
) # type: ignore
107122

0 commit comments

Comments
 (0)