Skip to content

Commit

Permalink
Add tests for grid suggestion (#628)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnugeorge authored and k8s-ci-robot committed Jun 4, 2019
1 parent e70d56b commit 03fb85e
Showing 1 changed file with 16 additions and 0 deletions.
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

0 comments on commit 03fb85e

Please sign in to comment.