-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[tests/scenario] l0 and l2 bigquery tests work with python servers
- Loading branch information
Showing
4 changed files
with
60 additions
and
24 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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
# stdlib | ||
import asyncio | ||
from enum import auto | ||
import os | ||
import random | ||
|
||
# third party | ||
|
@@ -9,6 +10,7 @@ | |
|
||
# syft absolute | ||
import syft as sy | ||
from syft.orchestra import DeploymentType | ||
from syft.service.request.request import RequestStatus | ||
|
||
# relative | ||
|
@@ -368,16 +370,31 @@ async def sim_l0_scenario(ctx: SimulatorContext): | |
for _ in range(NUM_USERS) | ||
] | ||
|
||
deployment_type = os.environ.get("ORCHESTRA_DEPLOYMENT_TYPE", DeploymentType.PYTHON) | ||
ctx.logger.info(f"Deployment type: {deployment_type}") | ||
|
||
server_url_high = "http://localhost:8080" | ||
launch_server(ctx, server_url_high, "syft-high") | ||
if deployment_type == DeploymentType.PYTHON: | ||
server_high = launch_server( | ||
ctx=ctx, | ||
server_url=server_url_high, | ||
server_name="syft-high", | ||
server_side_type="high", | ||
) | ||
admin_auth_high = dict( # noqa: C408 | ||
url=server_url_high, | ||
email="[email protected]", | ||
password="changethis", | ||
) | ||
|
||
server_url_low = "http://localhost:8081" | ||
launch_server(ctx, server_url_low, "syft-low") | ||
if deployment_type == DeploymentType.PYTHON: | ||
server_low = launch_server( | ||
ctx=ctx, | ||
server_url=server_url_low, | ||
server_name="syft-low", | ||
server_side_type="low", | ||
) | ||
admin_auth_low = dict( # noqa: C408 | ||
url=server_url_low, | ||
email="[email protected]", | ||
|
@@ -395,6 +412,10 @@ async def sim_l0_scenario(ctx: SimulatorContext): | |
*[user_low_side_flow(ctx, server_url_low, user) for user in users], | ||
) | ||
|
||
if deployment_type == DeploymentType.PYTHON: | ||
server_high.land() | ||
server_low.land() | ||
|
||
|
||
@pytest.mark.asyncio | ||
async def test_l0_scenario(request): | ||
|
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 |
---|---|---|
@@ -1,8 +1,6 @@ | ||
# RUN: just reset-high && pytest -s tests/scenariosv2/l2_test.py | ||
## .logs files will be created in pwd | ||
|
||
# stdlib | ||
import asyncio | ||
import os | ||
import random | ||
|
||
# third party | ||
|
@@ -11,6 +9,7 @@ | |
|
||
# syft absolute | ||
import syft as sy | ||
from syft.orchestra import DeploymentType | ||
|
||
# relative | ||
from .flows.user_bigquery_api import bq_submit_query | ||
|
@@ -124,7 +123,11 @@ async def sim_l2_scenario(ctx: SimulatorContext): | |
] | ||
|
||
server_url = "http://localhost:8080" | ||
launch_server(ctx, server_url, "syft-high") | ||
deployment_type = os.environ.get("ORCHESTRA_DEPLOYMENT_TYPE", DeploymentType.PYTHON) | ||
ctx.logger.info(f"Deployment type: {deployment_type}") | ||
if deployment_type == DeploymentType.PYTHON: | ||
server = launch_server(ctx, server_url, "syft-high") | ||
|
||
admin_auth = { | ||
"url": server_url, | ||
"email": "[email protected]", | ||
|
@@ -136,6 +139,9 @@ async def sim_l2_scenario(ctx: SimulatorContext): | |
*[user_flow(ctx, server_url, user) for user in users], | ||
) | ||
|
||
if deployment_type == DeploymentType.PYTHON: | ||
server.land() | ||
|
||
|
||
@pytest.mark.asyncio | ||
async def test_l2_scenario(request): | ||
|