Skip to content

Commit

Permalink
test log
Browse files Browse the repository at this point in the history
  • Loading branch information
yutongzhang-microsoft committed Jan 3, 2025
1 parent 22b5bb7 commit c5cd838
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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 " \
Expand All @@ -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))

Expand All @@ -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.
Expand Down

0 comments on commit c5cd838

Please sign in to comment.