31 lines
1.4 KiB
Python
31 lines
1.4 KiB
Python
#!/usr/bin/env python3
|
|
"""Opt-in synthetic writes to the migrated, named Kingbase QA database only. No DDL or network devices."""
|
|
import argparse
|
|
import os
|
|
from pathlib import Path
|
|
import subprocess
|
|
import qa
|
|
|
|
def main():
|
|
parser = argparse.ArgumentParser(description=__doc__)
|
|
parser.add_argument('--approve-synthetic-qa-writes', action='store_true', required=True)
|
|
parser.add_argument('--config', type=Path, default=Path.home()/'.railwaysystem-qa.env')
|
|
args = parser.parse_args()
|
|
env = qa.environment(qa.load_config(args.config))
|
|
if qa.inspect(env, ['--require-migrated']):
|
|
raise SystemExit('QA schema preflight failed')
|
|
qa.private_directory()
|
|
directory = qa.RUNTIME/'round5v4'
|
|
directory.mkdir(mode=0o700, exist_ok=True)
|
|
env.update(ROUND5V4_KINGBASE_TESTS='1', ROUND5V4_LOG_DIR=str(directory))
|
|
command = ['mvn', '-o', '-q', '-f', 'RuoYi-Vue/pom.xml', '-pl', 'ruoyi-train', '-am',
|
|
'-Dtest=Round5v4KingbaseIntegrationTest', '-Dsurefire.failIfNoSpecifiedTests=false', 'test']
|
|
with open(directory/'kingbase-tests.log','w',opener=lambda p,f:os.open(p,f,0o600)) as log:
|
|
result = subprocess.run(command, cwd=qa.ROOT, env=env, stdout=log, stderr=subprocess.STDOUT)
|
|
print('KINGBASE_TEST_EXIT='+str(result.returncode))
|
|
print('PRIVATE_LOG='+str(directory/'kingbase-tests.log'))
|
|
return result.returncode
|
|
|
|
if __name__=='__main__':
|
|
raise SystemExit(main())
|