-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test metrics, install missing tools to docker image
- Loading branch information
1 parent
2c771b4
commit a815130
Showing
4 changed files
with
35 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import datetime | ||
import lit.Test | ||
from lit.formats.shtest import ShTest | ||
from lit.Test import toMetricValue | ||
import lit.TestRunner | ||
|
||
from unittest.mock import patch | ||
|
||
class TimestampedTestFormat(ShTest): | ||
def __init__(self): | ||
super().__init__() | ||
|
||
def execute(self, test, lit_config): | ||
start_timestamp = datetime.datetime.now().strftime("%Y-%m-%dT%H:%M:%S%z") | ||
# Run the test | ||
result = lit.TestRunner.executeShTest(test, lit_config, True) | ||
end_timestamp = datetime.datetime.now().strftime("%Y-%m-%dT%H:%M:%S%z") | ||
result.addMetric("start_timestamp", toMetricValue(start_timestamp)) | ||
result.addMetric("end_timestamp", toMetricValue(end_timestamp)) | ||
|
||
return result | ||
|