[release] prettier output of release test results and artifacts (#18337)

This commit is contained in:
Kai Fricke 2021-09-03 14:00:55 +01:00 committed by GitHub
parent 9a8ca6a69d
commit 6aa8a4eddc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -523,6 +523,28 @@ def report_result(test_suite: str, test_name: str, status: str, logs: str,
)
def log_results_and_artifacts(result: Dict):
results = result.get("results", {})
if results:
msg = "Observed the following results:\n\n"
for key, val in results.items():
msg += f" {key} = {val}\n"
else:
msg = "Did not find any results."
logger.info(msg)
artifacts = result.get("artifacts", {})
if artifacts:
msg = "Saved the following artifacts:\n\n"
for key, val in artifacts.items():
msg += f" {key} = {val}\n"
else:
msg = "Did not find any artifacts."
logger.info(msg)
def _cleanup_session(sdk: AnyscaleSDK, session_id: str):
if session_id:
# Just trigger a request. No need to wait until session shutdown.
@ -1695,6 +1717,8 @@ def run_test_config(
logger.info(f"Final results: {result}")
log_results_and_artifacts(result)
shutil.rmtree(temp_dir)
return result