From c5cd8385bf717548d4b41cc432959754a4b587a2 Mon Sep 17 00:00:00 2001 From: Yutong Zhang Date: Fri, 3 Jan 2025 14:35:08 +0800 Subject: [PATCH] test log --- .../impacted_area_testing/calculate_instance_number.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.azure-pipelines/impacted_area_testing/calculate_instance_number.py b/.azure-pipelines/impacted_area_testing/calculate_instance_number.py index d6a13644d2a..fb8a5fb6292 100644 --- a/.azure-pipelines/impacted_area_testing/calculate_instance_number.py +++ b/.azure-pipelines/impacted_area_testing/calculate_instance_number.py @@ -86,6 +86,7 @@ def main(scripts, topology, branch): # As baseline test is the universal set of PR test # we get the historical running time of one script here # We get recent 5 test plans and calculate the average running time + logging.info(script) query = "V2TestCases " \ "| join kind=inner" \ "(TestPlans " \ @@ -97,9 +98,9 @@ def main(scripts, topology, branch): f"| where FilePath == '{script}' " \ "| where Result !in ('failure', 'error') " \ "| summarize ActualCount = count(), TotalRuntime = sum(Runtime)" - logging.info(query) try: response = client.execute("SonicTestData", query) + logging.info(response) except Exception as e: raise Exception("Query results from Kusto fails, error {}".format(e)) @@ -118,6 +119,7 @@ def main(scripts, topology, branch): total_running_time += average_running_time scripts_running_time[script] = average_running_time + logging.info(scripts_running_time) # Total running time is calculated by seconds, divide by 60 to get minutes # For one instance, we plan to assign 90 minutes to run test scripts # Obtain the number of instances by rounding up the calculation.