Skip to content

Commit

Permalink
Add placeholders for various actions by DataScientist and Admin actors
Browse files Browse the repository at this point in the history
  • Loading branch information
itstauq committed Sep 18, 2024
1 parent 7ecd68e commit 7775496
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 18 deletions.
18 changes: 0 additions & 18 deletions tests/scenarios/bigquery/level_0_sim_test.py

This file was deleted.

96 changes: 96 additions & 0 deletions tests/scenarios/bigquery/level_2_sim_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# third party
from simtester import Actor
from simtester import action


class DataScientist(Actor):
cooldown_period = (1, 5)

def setup(self):
# TODO create a server, or connect to an existing one
# TODO register this test user on the server
self.logger.info(f"{self.name}: Setup complete")

def teardown(self):
# TODO In case of live server, delete the user and perform any cleanup
self.logger.info(f"{self.name}: Teardown complete")

@action
async def whoami(self):
self.logger.info(f"Actor {self.name} is running whoami")
# self.client.account()

@action
async def guest_register(self):
# TODO register a guest user
self.logger.info(f"Actor {self.name} is running guest_register")

@action
async def query_mock(self):
# TODO run a query on bigquery.test_query
self.logger.info(f"Actor {self.name} is running query_mock")

@action
async def submit_query(self):
# TODO submit a query to bigquery.submit_query
self.logger.info(f"Actor {self.name} is running submit_query")

@action
async def get_query_results(self):
# TODO get the results of a query using get_results
self.logger.info(f"Actor {self.name} is running get_query_results")


class Admin(Actor):
cooldown_period = (1, 5)

def setup(self):
# TODO create a server, or connect to an existing one
# server = make_server()
# admin = make_admin()
# self.root_client = admin.client(server)
# create_prebuilt_worker_image
# get_prebuilt_worker_image
# add_external_registry
self.logger.info(f"{self.name}: Setup complete")

def teardown(self):
self.logger.info(f"{self.name}: Teardown complete")

@action
async def approve_pending_requests(self):
self.logger.info(f"Actor {self.name} is running approve_pending_requests")

@action
async def reject_pending_requests(self):
self.logger.info(f"Actor {self.name} is running reject_pending_requests")

@action
async def create_worker_pool(self):
self.logger.info(f"Actor {self.name} is running create_worker_pool")

@action
async def remove_worker_pool(self):
self.logger.info(f"Actor {self.name} is running remove_worker_pool")

@action
async def disallow_guest_signup(self):
self.logger.info(f"Actor {self.name} is running disallow_guest_signup")

@action
async def allow_guest_signup(self):
self.logger.info(f"Actor {self.name} is running allow_guest_signup")

@action
async def create_endpoints(self):
# create_endpoints_query
# create_endpoints_schema
# create_endpoints_submit_query
self.logger.info(f"Actor {self.name} is running create_endpoints_query")

@action
async def remove_endpoints(self):
# remove_endpoints_query
# remove_endpoints_schema
# remove_endpoints_submit_query
self.logger.info(f"Actor {self.name} is running remove_endpoints_query")

0 comments on commit 7775496

Please sign in to comment.