arkitekt-next 0.24.0__py3-none-any.whl → 0.25.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of arkitekt-next might be problematic. Click here for more details.
- arkitekt_next/pytest/__init__.py +1 -0
- arkitekt_next/pytest/fixtures.py +86 -0
- {arkitekt_next-0.24.0.dist-info → arkitekt_next-0.25.0.dist-info}/METADATA +1 -1
- {arkitekt_next-0.24.0.dist-info → arkitekt_next-0.25.0.dist-info}/RECORD +7 -5
- {arkitekt_next-0.24.0.dist-info → arkitekt_next-0.25.0.dist-info}/entry_points.txt +3 -0
- {arkitekt_next-0.24.0.dist-info → arkitekt_next-0.25.0.dist-info}/WHEEL +0 -0
- {arkitekt_next-0.24.0.dist-info → arkitekt_next-0.25.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .fixtures import *
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
from typing import Generator
|
|
2
|
+
import pytest
|
|
3
|
+
from arkitekt_next.cli.main import cli
|
|
4
|
+
from click.testing import CliRunner
|
|
5
|
+
from arkitekt_server.create import temp_server, ArkitektServerConfig
|
|
6
|
+
from dokker import Deployment
|
|
7
|
+
from dataclasses import dataclass
|
|
8
|
+
from arkitekt_next.app import App
|
|
9
|
+
from fakts_next.grants.remote import FaktsEndpoint
|
|
10
|
+
from arkitekt_next import easy
|
|
11
|
+
from dokker import local
|
|
12
|
+
|
|
13
|
+
from arkitekt_next.service_registry import get_default_service_registry
|
|
14
|
+
import pytest
|
|
15
|
+
|
|
16
|
+
def pytest_addoption(parser: pytest.Parser) -> None:
|
|
17
|
+
"""Register custom command line options for pytest."""
|
|
18
|
+
parser.addoption(
|
|
19
|
+
"--test-against",
|
|
20
|
+
action="store",
|
|
21
|
+
default="temp",
|
|
22
|
+
help="Base URL of the Arkitekt server to use in tests",
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
@pytest.fixture(scope="session")
|
|
27
|
+
def running_server(request: pytest.FixtureRequest) -> Generator[Deployment, None, None]:
|
|
28
|
+
""" Generates a local Arkitekt server deployment for testing purposes. """
|
|
29
|
+
|
|
30
|
+
if not request.config.getoption("--test-against") == "temp":
|
|
31
|
+
raise ValueError("Invalid test environment specified. Currently only 'temp' is supported.")
|
|
32
|
+
|
|
33
|
+
config = ArkitektServerConfig()
|
|
34
|
+
|
|
35
|
+
with temp_server() as temp_path:
|
|
36
|
+
|
|
37
|
+
setup = local(temp_path / "docker-compose.yaml")
|
|
38
|
+
|
|
39
|
+
setup.add_health_check(
|
|
40
|
+
url=lambda spec: f"http://localhost:{spec.find_service('gateway').get_port_for_internal(80).published}/lok/ht",
|
|
41
|
+
service="lok",
|
|
42
|
+
timeout=5,
|
|
43
|
+
max_retries=10,
|
|
44
|
+
)
|
|
45
|
+
with setup as setup:
|
|
46
|
+
setup.down()
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
setup.up()
|
|
50
|
+
|
|
51
|
+
setup.check_health()
|
|
52
|
+
yield setup
|
|
53
|
+
setup.down()
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
@dataclass
|
|
58
|
+
class EasyApp:
|
|
59
|
+
"""Dataclass to hold the Arkitekt server deployment."""
|
|
60
|
+
deployment: Deployment
|
|
61
|
+
app: App
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
@pytest.fixture(scope="session")
|
|
65
|
+
def test_app(running_server: Deployment) -> Generator[EasyApp, None, None]:
|
|
66
|
+
"""Fixture to ensure the Arkitekt server is running."""
|
|
67
|
+
|
|
68
|
+
async def device_code_hook(endpoint: FaktsEndpoint, device_code: str):
|
|
69
|
+
|
|
70
|
+
await running_server.arun(
|
|
71
|
+
"lok", f"uv run python manage.py validatecode {device_code} --user demo --org arkitektio"
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
registry = get_default_service_registry()
|
|
76
|
+
|
|
77
|
+
assert registry, "Service registry must be initialized"
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
with easy(url=f"http://localhost:{running_server.spec.find_service('gateway').get_port_for_internal(80).published}", device_code_hook=device_code_hook) as app:
|
|
82
|
+
|
|
83
|
+
yield EasyApp(
|
|
84
|
+
deployment=running_server,
|
|
85
|
+
app=app
|
|
86
|
+
)
|
|
@@ -78,6 +78,8 @@ arkitekt_next/cli/schemas/unlok.schema.graphql,sha256=fXR846snIBIqkuQ-PlYnSkQjkF
|
|
|
78
78
|
arkitekt_next/cli/templates/filter.py,sha256=xHlQGNASvIK9F4tM2ROHruwKreu_45wdQ1Wz2oKU8y0,656
|
|
79
79
|
arkitekt_next/cli/templates/simple.py,sha256=rWaprO7Ue9AUq10oI5c3G8MxF5rsAz_FsYo-4rfuZCA,1281
|
|
80
80
|
arkitekt_next/cli/versions/v1.yaml,sha256=rv2-F6FQbTZi_H6pSE_csdICdtKBObDdoo_asOFi43Y,12
|
|
81
|
+
arkitekt_next/pytest/__init__.py,sha256=u7poU1nWozV3RXSHbHE9aH2wzOFZA6yXST4jhGxLUiI,23
|
|
82
|
+
arkitekt_next/pytest/fixtures.py,sha256=9lKGkcExID-3w3kGTQsRXork3VHHCt_-nn_9Vu4Nf7Y,2695
|
|
81
83
|
arkitekt_next/qt/__init__.py,sha256=MeKBI1aYsHt6yDFfYyppj-LM8Nn5URNl2pJlXrdzjzc,443
|
|
82
84
|
arkitekt_next/qt/builders.py,sha256=5VcoXwylQdAiGpPgxCYoBw2gMd0BxtGacdponA_yS7I,6281
|
|
83
85
|
arkitekt_next/qt/magic_bar.py,sha256=WhC3PIuaARGFtmHdk0_6l7C6gXX12g4aN8eWIptLtZE,17550
|
|
@@ -93,8 +95,8 @@ arkitekt_next/qt/assets/light/green pulse.gif,sha256=cUd2F3Qlvjb7SnsU-LjGgeLTa8K
|
|
|
93
95
|
arkitekt_next/qt/assets/light/orange pulse.gif,sha256=0gDvrRed0mzZZPHB4tP6vptx7myUCAa_hEVGdjRhNy8,94769
|
|
94
96
|
arkitekt_next/qt/assets/light/pink pulse.gif,sha256=rxd6ZTHSIG9JZuuHhi3jiSB_JYFBZpy7OWUeZETlhQ4,107513
|
|
95
97
|
arkitekt_next/qt/assets/light/red pulse.gif,sha256=U7WLbZvSl5e-Ob5RmawtlC0Rh9VVHxkjDbGjj7NYVUo,108749
|
|
96
|
-
arkitekt_next-0.
|
|
97
|
-
arkitekt_next-0.
|
|
98
|
-
arkitekt_next-0.
|
|
99
|
-
arkitekt_next-0.
|
|
100
|
-
arkitekt_next-0.
|
|
98
|
+
arkitekt_next-0.25.0.dist-info/METADATA,sha256=OQVBKIBHRzroIaI_ufBU4BXOGIk1M5_0WTzxjUIqMP0,5783
|
|
99
|
+
arkitekt_next-0.25.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
100
|
+
arkitekt_next-0.25.0.dist-info/entry_points.txt,sha256=XNyC6m0CUi3QA5PZ_HBP2ZJfS6sL0oc79TBIYP8VMDM,110
|
|
101
|
+
arkitekt_next-0.25.0.dist-info/licenses/LICENSE,sha256=YZ2oRjC248t-GpoEyw7J13vwKYNG6zhYMaEAix6EzF0,1089
|
|
102
|
+
arkitekt_next-0.25.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|