Skip to content

Commit

Permalink
working on low-side ds workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
khoaguin committed Sep 19, 2024
1 parent e48b05d commit c3c1ddb
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 33 deletions.
2 changes: 1 addition & 1 deletion tests/scenarios/bigquery/helpers/fixtures_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def make_user(
email: str | None = None,
password: str | None = None,
role: ServiceRole = ServiceRole.DATA_SCIENTIST,
):
) -> TestUser:
fake = Faker()
if name is None:
name = fake.name()
Expand Down
28 changes: 0 additions & 28 deletions tests/scenarios/bigquery/level_0_basic_test.py

This file was deleted.

25 changes: 21 additions & 4 deletions tests/scenarios/bigquery/level_0_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
from helpers.api import create_endpoints_query
from helpers.api import create_endpoints_schema
from helpers.api import create_endpoints_submit_query
from helpers.api import run_api_path
from helpers.api import set_endpoint_settings
from helpers.asserts import result_is
from helpers.events import Event
from helpers.events import EventManager
from helpers.events import Scenario
Expand All @@ -21,6 +23,7 @@
from helpers.workers import create_prebuilt_worker_image
from helpers.workers import create_worker_pool
from helpers.workers import get_prebuilt_worker_image
from level_2_basic_test import query_sql
import pytest
from unsync import unsync

Expand Down Expand Up @@ -72,9 +75,23 @@ async def user_low_side_activity(_, events, user, after=None):
guest_user_setup_flow(user.email)

# login_user
user_client = user.client()

# submit_code
# request_approval
test_query_path = "bigquery.test_query"
await result_is(
events,
lambda: len(run_api_path(user_client, test_query_path, sql_query=query_sql()))
== 10000,
matches=True,
after=[
Event.QUERY_ENDPOINT_CONFIGURED,
Event.USERS_CREATED_CHECKED,
Event.ADMIN_SYNC_HIGH_TO_LOW,
],
register=Event.USERS_CAN_QUERY_MOCK,
)

# loop: wait for approval

Expand Down Expand Up @@ -236,7 +253,7 @@ async def admin_low_side_activity(_, events):


@unsync_
async def admin_create_api_endpoint(
async def admin_create_sync_api_endpoints(
_,
events,
admin_client_high,
Expand Down Expand Up @@ -323,7 +340,7 @@ async def admin_high_side_activity(_, events):
events,
)

admin_create_api_endpoint(
admin_create_sync_api_endpoints(
_,
events,
admin_client_high,
Expand Down Expand Up @@ -356,11 +373,11 @@ async def test_level_0_k8s(request):
events.add_scenario(scenario)
events.monitor()

# start admin activity on high side
# start admin activity on low side
admin_low_side_activity(request, events)

# todo
# admin_high_side_activity(request, events)
admin_high_side_activity(request, events)

# todo - only start syncing after the root user created other admin users
# root_sync_activity(request, events, after=Event.USER_ADMIN_CREATED)
Expand Down

0 comments on commit c3c1ddb

Please sign in to comment.