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

[WIP] Include tests for cluster_name in listRecommendations API #987

Closed
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -102,34 +102,34 @@ def main(argv):

reco_json_dir = results_dir + "/reco_jsons" + "_iter" + str(i)
os.mkdir(reco_json_dir)
for res_num in range(num_res):
for exp_num in range(num_exps):
# create the experiment and post it
create_exp_json_file = exp_json_dir + "/create_exp_" + str(exp_num) + ".json"
create_experiment(create_exp_json_file)
# Obtain the experiment name
json_data = json.load(open(create_exp_json_file))

experiment_name = json_data[0]['experiment_name']
print(f"experiment_name = {experiment_name}")

json_file = result_json_dir + "/result_" + str(exp_num) + "_" + str(res_num) + ".json"

update_results(json_file)

# Obtain the monitoring end time
json_data = json.load(open(json_file))
interval_end_time = json_data[0]['interval_end_time']

# sleep for a while before fetching recommendations for the experiments
#time.sleep(1)

# Fetch the recommendations for all the experiments
latest = None
reco = update_recommendations(experiment_name, latest, interval_end_time)
filename = reco_json_dir + '/update_reco_' + str(res_num) + '_' + str(exp_num) + '.json'
write_json_data_to_file(filename, reco.json())

for exp_num in range(num_exps):
# create the experiment and post it
create_exp_json_file = exp_json_dir + "/create_exp_" + str(exp_num) + ".json"
create_experiment(create_exp_json_file)

# Obtain the experiment name
json_data = json.load(open(create_exp_json_file))

experiment_name = json_data[0]['experiment_name']
print(f"experiment_name = {experiment_name}")

json_file = result_json_dir + "/result_" + str(exp_num) + ".json"

update_results(json_file)

# Obtain the monitoring end time
json_data = json.load(open(json_file))
interval_end_time = json_data[num_res-1]['interval_end_time']

# sleep for a while before fetching recommendations for the experiments
#time.sleep(1)

# Fetch the recommendations for all the experiments
latest = None
reco = update_recommendations(experiment_name, latest, interval_end_time)
filename = reco_json_dir + '/update_reco_' + str(exp_num) + '.json'
write_json_data_to_file(filename, reco.json())

# Fetch listExperiments
list_exp_json_file_before = list_exp_json_dir + "/list_exp_json_before_" + str(i) + ".json"
Expand Down
Loading
Loading