aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/run_tests/run_interops.py
blob: 17083975d8c14110d858b42b85d38109a0c867f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import argparse
import xml.etree.cElementTree as ET
import jobset

argp = argparse.ArgumentParser(description='Run interop tests.')
argp.add_argument('-l', '--language',
                  default='c++')
args = argp.parse_args()

# build job
build_job = jobset.JobSpec(cmdline=['tools/run_tests/run_interops_build.sh', '%s' % args.language],
                           shortname='build',
                           timeout_seconds=30*60)

# test jobs, each test is a separate job to run in parallel
_TESTS = ['large_unary', 'empty_unary', 'ping_pong', 'client_streaming', 'server_streaming']
jobs = []
jobNumber = 0
for test in _TESTS:
  test_job = jobset.JobSpec(
        cmdline=['tools/run_tests/run_interops_test.sh', '%s' % args.language, '%s' % test], 
        shortname=test,
        timeout_seconds=15*60)
  jobs.append(test_job)
  jobNumber+=1

root = ET.Element('testsuites')
testsuite = ET.SubElement(root, 'testsuite', id='1', package='grpc', name='tests')

# always do the build of docker first, and then all the tests can run in parallel
jobset.run([build_job], maxjobs=1, xml_report=testsuite)
jobset.run(jobs, maxjobs=jobNumber, xml_report=testsuite)

tree = ET.ElementTree(root)
tree.write('report.xml', encoding='UTF-8')