bisect-kit: Find internal checkout in platform/
Per the attached bug, we are moving the bisect-kit/internal repo.
Previously it was checked out at the nested location
chromium/src/platform/bisect-kit/internal/. Now it is instead found at
chromium/src/platform/bisect-kit-internal/.
The only place that this is referenced in bisect-kit/ code is in
bisect-kit/bisect_kit/__init__.py, which searches bisect-kit/ for
`internal`. With this CL, it will instead search the parent dir
(src/platform/) for the `bisect-kit-internal/` dir.
BUG=b:323959706
TEST=./run_tests.sh -- This gave me 3 failures, but those tests are also
failing on HEAD.
TEST=./run_formatters.sh
TEST=Manual:
Open a Python debugger (pdb). Run:
from bisect_kit import cros_util
cros_util.get_autotest_shadow_config()
1. On HEAD, this should print the longer string specified in
`internal/internal.py`.
2. If we remove the nested `bisect-kit/internal/` dir (but still
on HEAD), it should now print the shorter string specified in
`bisect_kit/cros_util.py()`, since the internal plugin is not
found in its normal location.
3. If we add a checkout of the internal repo at
`src/platform/bisect-kit-internal/` (but bisect-kit is still on
HEAD), it should still print the shorter string from
`cros_util.py`.
4. Finally, if we apply this CL, it should now find the internal
checkout at the new location, and thus print the longer string
specified in `bisect-kit-internal/internal.py`.
Cq-Depend: chrome-internal:7107697
Change-Id: I98f753b9c883005632e25766d9289e23751c5d64
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/bisect-kit/+/5399156
Tested-by: Greg Edelston <gredelston@google.com>
Reviewed-by: Zheng-Jie Chang <zjchang@chromium.org>
Commit-Queue: Zheng-Jie Chang <zjchang@chromium.org>
Auto-Submit: Greg Edelston <gredelston@google.com>
Reviewed-by: George Engelbrecht <engeg@google.com>
diff --git a/bisect_kit/__init__.py b/bisect_kit/__init__.py
index 85efba2..9220299 100644
--- a/bisect_kit/__init__.py
+++ b/bisect_kit/__init__.py
@@ -7,11 +7,12 @@
BISECT_KIT_ROOT = pathlib.Path(__file__).resolve().parent.parent
+PLATFORM_ROOT = BISECT_KIT_ROOT.parent
# grpc, buildbucket protobuf modules
sys.path.append(str(BISECT_KIT_ROOT / 'third_party'))
# plugins
-sys.path.append(str(BISECT_KIT_ROOT / 'internal'))
+sys.path.append(str(PLATFORM_ROOT / 'bisect-kit-internal'))
try: