Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for grid suggestion algorithm #628

Merged
merged 1 commit into from
Jun 4, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions test/e2e/v1alpha2/test-katib-manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,21 @@ def get_random_algo_suggestion(stub):
logger.error("Failed to get trial %s" % TEST_TRIAL, exc_info=True)
raise

def get_grid_algo_suggestion(stub):
try:
reply = stub.GetSuggestions(api_pb2.GetSuggestionsRequest(experiment_name=TEST_EXPERIMENT,
algorithm_name="grid",
request_number=1), 10)
trials = reply.trials

if len(trials) == 1 and trials[0].spec.experiment_name == TEST_EXPERIMENT:
logger.info("Get grid algorithm suggestion successfully")
else:
raise Exception()
except:
logger.error("Failed to get trial %s" % TEST_TRIAL, exc_info=True)
raise

def test():
with grpc.insecure_channel('127.0.0.1:6789') as channel:
stub = api_pb2_grpc.ManagerStub(channel)
Expand All @@ -119,6 +134,7 @@ def test():
register_trial(stub)
get_trial(stub)
get_random_algo_suggestion(stub)
get_grid_algo_suggestion(stub)
delete_experiment(stub)
try:
get_trial(stub)
Expand Down