Commit 7c51743b authored by Jiaqi Han's avatar Jiaqi Han Committed by Chromium LUCI CQ

Improve junit test classpaths decision

The classpaths written by build/android/gyp/create_java_binary_script.py
are relative paths to the current working directory, this CL removes the
duplication part for the concatenation of source root and the relative
paths.

Merge-With: eureka-internal/494461

Bug: None
Test: CQ
Change-Id: I434e2807c86909c86dad9c5ebd528b8fbe56b041
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2582411
Commit-Queue: Jiaqi Han <jiaqih@google.com>
Reviewed-by: default avatarbenjamin joyce <bjoyce@chromium.org>
Cr-Commit-Position: refs/heads/master@{#835851}
parent a7e7e296
......@@ -280,8 +280,10 @@ def _GetTestClasses(file_path):
# Bots write the classpath indexed from src.
if not os.path.exists(test_jar_path):
if test_jar.startswith('src' + os.path.sep):
test_jar_path = os.path.join(constants.DIR_SOURCE_ROOT, test_jar[4:])
src_relpath = os.path.relpath(constants.DIR_SOURCE_ROOT) + os.path.sep
if test_jar.startswith(src_relpath):
test_jar_path = os.path.join(constants.DIR_SOURCE_ROOT,
test_jar[len(src_relpath):])
test_classes += _GetTestClassesFromJar(test_jar_path)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment