Skip to content

Commit

Permalink
seperated e2e tests into seperate try blocks for better error handlin…
Browse files Browse the repository at this point in the history
…g and fixed some bugs

Signed-off-by: Prakhar Singhal <[email protected]>
  • Loading branch information
prakhar479 committed Sep 1, 2024
1 parent 2d8ecd0 commit 2222b99
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions test/e2e/v1beta1/scripts/gh-actions/run-e2e-tune-api.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def objective(parameters):
"b": search.double(min=0.1, max=0.2)
}

# [4] Create Katib Experiment with 4 Trials and 2 CPUs per Trial.
# [3] Create Katib Experiment with 4 Trials and 2 CPUs per Trial.
# And Wait until Experiment reaches Succeeded condition.
katib_client.tune(
name=exp_name,
Expand Down Expand Up @@ -140,15 +140,26 @@ def objective(parameters):
client.CoreV1Api().patch_namespace(args.namespace, {'metadata': {'labels': namespace_labels}})

# Test with run_e2e_experiment_create_by_tune_default_metrics_collector
# and run_e2e_experiment_create_by_tune_custom_metrics_collector
exp_namespace = args.namespace
try:
exp_name = "tune-example-default-metrics-collector"
logging.info(f"Runnning E2E for Experiment created by tune: {exp_namespace}/{exp_name}")
run_e2e_experiment_create_by_tune_default_metrics_collector(katib_client, exp_name, exp_namespace)
logging.info("---------------------------------------------------------------")
logging.info(f"E2E is succeeded for Experiment created by tune: {exp_namespace}/{exp_name}")
except Exception as e:
logging.info("---------------------------------------------------------------")
logging.info(f"E2E is failed for Experiment created by tune: {exp_namespace}/{exp_name}")
raise e
finally:
# Delete the Experiment.
logging.info("---------------------------------------------------------------")
logging.info("---------------------------------------------------------------")
katib_client.delete_experiment(exp_name, exp_namespace)


# Test with run_e2e_experiment_create_by_tune_custom_metrics_collector
try:
exp_name = "tune-example-custom-metrics-collector"
logging.info(f"Runnning E2E for Experiment created by tune: {exp_namespace}/{exp_name}")
run_e2e_experiment_create_by_tune_custom_metrics_collector(katib_client, exp_name, exp_namespace)
Expand Down

0 comments on commit 2222b99

Please sign in to comment.