Skip to content
This repository was archived by the owner on Sep 3, 2022. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion tools/cli/tests/end-to-end.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
# of the bundled CLI tool. This requires a GCP project in which the
# test will create, connect to, and delete Datalab instances.

import argparse
import random
import socket
import subprocess
Expand Down Expand Up @@ -232,4 +233,18 @@ def run_connection_test(self):


if __name__ == '__main__':
unittest.main()
parser = argparse.ArgumentParser()
parser.add_argument('--runs', type=int, default=1, choices=range(1, 100),
metavar='COUNT', dest='runs',
help='Number of times to run the test suite')
args = parser.parse_args()

failed_count, run_count = 0, 0
for _ in range(0, args.runs):
suite = unittest.TestLoader().loadTestsFromTestCase(TestEndToEnd)
result = unittest.TextTestRunner(buffer=True).run(suite)
run_count += 1
if not result.wasSuccessful():
failed_count += 1

print('Ran {} test runs with {} failing'.format(run_count, failed_count))