aboutsummaryrefslogtreecommitdiffstats
path: root/build/scripts/unpacking_jtest_runner.py
diff options
context:
space:
mode:
authorakastornov <akastornov@yandex-team.ru>2022-02-10 16:46:03 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:03 +0300
commit3a2de774d91ca8d7325aaf81c200b1d2047725e6 (patch)
tree5674a780ce03a8bbd794733a19c7a70d587e4a14 /build/scripts/unpacking_jtest_runner.py
parent7bd11ff35e97544d119e43447e3e865f2588ee7f (diff)
downloadydb-3a2de774d91ca8d7325aaf81c200b1d2047725e6.tar.gz
Restoring authorship annotation for <akastornov@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'build/scripts/unpacking_jtest_runner.py')
-rw-r--r--build/scripts/unpacking_jtest_runner.py56
1 files changed, 28 insertions, 28 deletions
diff --git a/build/scripts/unpacking_jtest_runner.py b/build/scripts/unpacking_jtest_runner.py
index 9730dcd711..8b23e3ed26 100644
--- a/build/scripts/unpacking_jtest_runner.py
+++ b/build/scripts/unpacking_jtest_runner.py
@@ -3,25 +3,25 @@ import json
import optparse
import os
import sys
-import subprocess
+import subprocess
import time
import zipfile
import platform
-
-# This script changes test run classpath by unpacking tests.jar -> tests-dir. The goal
-# is to launch tests with the same classpath as maven does.
-
-
-def parse_args():
- parser = optparse.OptionParser()
- parser.disable_interspersed_args()
+
+# This script changes test run classpath by unpacking tests.jar -> tests-dir. The goal
+# is to launch tests with the same classpath as maven does.
+
+
+def parse_args():
+ parser = optparse.OptionParser()
+ parser.disable_interspersed_args()
parser.add_option('--trace-file')
- parser.add_option('--jar-binary')
- parser.add_option('--tests-jar-path')
+ parser.add_option('--jar-binary')
+ parser.add_option('--tests-jar-path')
parser.add_option('--classpath-option-type', choices=('manifest', 'command_file', 'list'), default='manifest')
- return parser.parse_args()
-
-
+ return parser.parse_args()
+
+
# temporary, for jdk8/jdk9+ compatibility
def fix_cmd(cmd):
if not cmd:
@@ -88,18 +88,18 @@ def make_command_file_from_cp(class_path, out):
cp_file.write(os.pathsep.join(class_path))
-def main():
+def main():
s = time.time()
- opts, args = parse_args()
-
- # unpack tests jar
- try:
+ opts, args = parse_args()
+
+ # unpack tests jar
+ try:
build_root = args[args.index('--build-root') + 1]
dest = os.path.join(build_root, 'test-classes')
- except Exception:
+ except Exception:
build_root = ''
- dest = os.path.abspath('test-classes')
-
+ dest = os.path.abspath('test-classes')
+
extract_jars(dest, opts.tests_jar_path)
metrics = {
@@ -107,7 +107,7 @@ def main():
}
s = time.time()
- # fix java classpath
+ # fix java classpath
cp_idx = args.index('-classpath')
if args[cp_idx + 1].startswith('@'):
real_name = args[cp_idx + 1][1:]
@@ -137,12 +137,12 @@ def main():
if opts.trace_file:
dump_chunk_event({'metrics': metrics}, opts.trace_file)
- # run java cmd
+ # run java cmd
if platform.system() == 'Windows':
sys.exit(subprocess.Popen(args).wait())
else:
os.execv(args[0], args)
-
-
-if __name__ == '__main__':
- main()
+
+
+if __name__ == '__main__':
+ main()