[Release Test] Change release test db reporter report_time to report_timestamp_ms (#22844)

This's easier to sort and compare timestamp and avoid timezone issue.
This commit is contained in:
Jiajun Yao 2022-03-07 04:54:19 -08:00 committed by GitHub
parent 5ebc32d7c2
commit 1b5efb588e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,4 +1,4 @@
import datetime
import time
import json
import boto3
from botocore.config import Config
@ -16,10 +16,9 @@ class DBReporter(Reporter):
def report_result(self, test: Test, result: Result):
logger.info("Persisting result to the databricks delta lake...")
now = datetime.datetime.utcnow()
result_json = {
"_table": "release_test_result",
"report_time": now.strftime("%Y-%m-%d %H:%M:%S"),
"report_timestamp_ms": int(time.time() * 1000),
"status": result.status or "",
"results": result.results or {},
"name": test.get("name", ""),