[Nightly Test] Add more metadata to test result (#21990)

Add a columns, error code, commit url, stable, session url, and runtime
This commit is contained in:
SangBin Cho 2022-02-01 15:33:30 +09:00 committed by GitHub
parent e3cf47d731
commit fd20cf3239
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 47 additions and 2 deletions

View file

@ -13,6 +13,11 @@ def handle_result(
artifacts: Dict,
last_logs: str,
team: str,
commit_url: str,
session_url: str,
runtime: float,
stable: bool,
return_code: int,
) -> Optional[str]:
if not status == "finished":

View file

@ -13,6 +13,11 @@ def handle_result(
artifacts: Dict,
last_logs: str,
team: str,
commit_url: str,
session_url: str,
runtime: float,
stable: bool,
return_code: int,
) -> Optional[str]:
assert test_suite == "long_running_tests"

View file

@ -13,6 +13,11 @@ def handle_result(
artifacts: Dict,
last_logs: str,
team: str,
commit_url: str,
session_url: str,
runtime: float,
stable: bool,
return_code: int,
) -> Optional[str]:
assert test_suite == "rllib_tests"

View file

@ -13,6 +13,11 @@ def handle_result(
artifacts: Dict,
last_logs: str,
team: str,
commit_url: str,
session_url: str,
runtime: float,
stable: bool,
return_code: int,
) -> Optional[str]:
assert test_suite == "tune_tests"

View file

@ -13,6 +13,11 @@ def handle_result(
artifacts: Dict,
last_logs: str,
team: str,
commit_url: str,
session_url: str,
runtime: float,
stable: bool,
return_code: int,
) -> Optional[str]:
assert test_suite == "xgboost_tests"

View file

@ -725,6 +725,11 @@ def report_result(
artifacts: Dict[Any, Any],
category: str,
team: str,
commit_url: str,
session_url: str,
runtime: float,
stable: bool,
return_code: int,
):
# session_url: str, commit_url: str,
# runtime: float, stable: bool, frequency: str, return_code: int):
@ -1626,10 +1631,11 @@ def run_test_config(
)
# Add these metadata here to avoid changing SQL schema.
is_stable = test_config.get("stable", True)
results["_runtime"] = runtime
results["_session_url"] = session_url
results["_commit_url"] = commit_url
results["_stable"] = test_config.get("stable", True)
results["_stable"] = is_stable
result_queue.put(
State(
"END",
@ -1639,6 +1645,10 @@ def run_test_config(
"last_logs": logs,
"results": results,
"artifacts": saved_artifacts,
"runtime": runtime,
"session_url": session_url,
"commit_url": commit_url,
"stable": is_stable,
},
)
)
@ -1956,11 +1966,12 @@ def run_test_config(
exit_code = ExitCode.UNKNOWN
# Add these metadata here to avoid changing SQL schema.
is_stable = test_config.get("stable", True)
results = {}
results["_runtime"] = runtime
results["_session_url"] = session_url
results["_commit_url"] = commit_url
results["_stable"] = test_config.get("stable", True)
results["_stable"] = is_stable
result_queue.put(
State(
"END",
@ -1970,6 +1981,10 @@ def run_test_config(
"last_logs": logs,
"results": results,
"exit_code": exit_code.value,
"runtime": runtime,
"session_url": session_url,
"commit_url": commit_url,
"stable": is_stable,
},
)
)
@ -2360,6 +2375,11 @@ def run_test(
artifacts=result.get("artifacts", {}),
category=category,
team=team,
commit_url=result.get("commit_url", ""),
session_url=result.get("session_url", ""),
runtime=result.get("runtime", -1),
stable=result.get("stable", True),
exit_code=result.get("exit_code", ExitCode.UNKNOWN),
)
if not has_errored(result):