forked from archtechx/tenancy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest
executable file
·26 lines (19 loc) · 1.01 KB
/
test
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
#!/usr/bin/env python3
from os import system
import argparse
system('docker-compose up -d')
parser = argparse.ArgumentParser()
parser.add_argument("--variants", default='1,2',
help="Comma-separated values. Which test variants should be run.")
args, other = parser.parse_known_args()
variants = args.variants.split(',')
for variant in variants:
filename_base = "phpunit_var_" + variant
with open('phpunit.xml', 'r') as inp, open(filename_base + '.xml', 'w') as out:
out.write(inp.read().replace('"STANCL_TENANCY_TEST_VARIANT" value="1"',
'"STANCL_TENANCY_TEST_VARIANT" value="%s"' % variant))
print("Test variant: %s\n" % variant)
system('docker-compose exec test vendor/bin/phpunit --configuration "%s" --coverage-php %s %s'
% (filename_base + '.xml', 'coverage/' + filename_base + '.cov', ' '.join(other)))
# todo delete folder contents first?
system("docker-compose exec test vendor/bin/phpcov merge --clover clover.xml coverage/")