Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xavier Thompson
slapos
Commits
2446782a
Commit
2446782a
authored
Aug 04, 2023
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
software/end-to-end-testing: Report test durations
parent
1b0fa5b9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
3 deletions
+19
-3
software/end-to-end-testing/buildout.hash.cfg
software/end-to-end-testing/buildout.hash.cfg
+1
-1
software/end-to-end-testing/runTestSuite.in
software/end-to-end-testing/runTestSuite.in
+18
-2
No files found.
software/end-to-end-testing/buildout.hash.cfg
View file @
2446782a
...
...
@@ -4,4 +4,4 @@ md5sum = 562e123cefa9e39cbc78300e4643f7b3
[runTestSuite.in]
filename = runTestSuite.in
md5sum =
524531d759d4e517a993246b4e3f6a27
md5sum =
69a9c2ab0279d7152baddf96e46c93d4
software/end-to-end-testing/runTestSuite.in
View file @
2446782a
...
...
@@ -13,6 +13,19 @@ import erp5.util.taskdistribution
import slapos.client
class EndToEndResult(unittest.TextTestResult):
def __init__(self, stream, descriptions, verbosity):
self.durations = []
super().__init__(stream, descriptions, verbosity)
def startTest(self, test):
self._startTime = time.perf_counter()
def stopTest(self, test):
stopTime = time.perf_counter()
self.durations.append((test, stopTime - self._startTime))
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--test_suite')
...
...
@@ -41,16 +54,19 @@ def main():
project_title = args.project_title,
)
runner = unittest.TextTestRunner()
runner = unittest.TextTestRunner(
resultclass=EndToEndResult
)
result = runner.run(suite)
errors = dict(result.errors)
failures = dict(result.failures)
skipped = dict(result.skipped)
# TODO: unexpected successes and expected failures
durations = dict(result.durations)
print(errors)
print(failures)
print(skipped)
print(durations)
for t in all_tests:
kind = [errors, failures, skipped]
...
...
@@ -72,7 +88,7 @@ def main():
error_count = count[0],
failure_count = count[1],
skip_count = count[2],
duration =
0
,
duration =
durations[t]
,
command = '',
stdout = output,
stderr = '',
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment