Skip to content

Commit

Permalink
Merge pull request #2703 from sunilkumarn417/ci
Browse files Browse the repository at this point in the history
Pass run config to test case
  • Loading branch information
mergify[bot] authored Jul 5, 2023
2 parents 27385fb + 29749fd commit cbc647b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,10 @@ def fetch_test_details(var) -> dict:

# Initialize test return code
rc = 0

run_config = {
"log_dir": run_dir,
"run_id": run_id,
}
for test in tests:
test = test.get("test")
tc = fetch_test_details(test)
Expand All @@ -676,7 +679,7 @@ def fetch_test_details(var) -> dict:
test_names.append(unique_test_name)

tc["log-link"] = log.configure_logger(unique_test_name, run_dir)

run_config.update({"test_name": unique_test_name, "log_link": tc["log-link"]})
mod_file_name = os.path.splitext(test_file)[0]
test_mod = importlib.import_module(mod_file_name)
print("\nRunning test: {test_name}".format(test_name=tc["name"]))
Expand Down Expand Up @@ -772,6 +775,7 @@ def fetch_test_details(var) -> dict:
test_data=ceph_test_data,
ceph_cluster_dict=ceph_cluster_dict,
clients=clients,
run_config=run_config,
)
except BaseException as be: # noqa
log.exception(be)
Expand All @@ -781,6 +785,10 @@ def fetch_test_details(var) -> dict:
if store:
store_cluster_state(ceph_cluster_dict, ceph_clusters_file)

# Artifacts from test appended to comments
if config.get("artifacts"):
tc["comments"] += f"\n{config['artifacts']}"

if rc != 0:
break

Expand Down

0 comments on commit cbc647b

Please sign in to comment.