Skip to content

Commit b8160a9

Browse files
authored
Add a fixed adb binary to our browser tests (#8963)
This was tested and verified by manually building and deploying to the MH lab. Bug: 483488213
1 parent ecd396d commit b8160a9

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

cobalt/testing/browser_tests/tools/Dockerfile

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ FROM ubuntu@sha256:c7eb020043d8fc2ae0793fb35a37bff1cf33f156d4d4b12ccc7f3ef8706c3
44
# Install base utilities, Android test dependencies (adb, netcat),
55
# and Linux test dependencies (GUI/X11 libraries).
66
RUN apt-get update && apt-get install -y \
7-
adb \
7+
unzip \
88
netcat-openbsd \
99
python3 \
1010
ca-certificates \
@@ -22,6 +22,7 @@ RUN apt-get update && apt-get install -y \
2222
libxrandr2 \
2323
libgbm1 \
2424
socat \
25+
iproute2 \
2526
usbutils \
2627
&& apt-get clean && rm -rf /var/lib/apt/lists/*
2728

@@ -32,4 +33,13 @@ WORKDIR /opt/cobalt_browsertests
3233
# Expects cobalt_browsertests_artifacts.tar.gz to be in the build context.
3334
ADD cobalt_browsertests_artifacts.tar.gz .
3435

36+
# Extract platform-tools if available
37+
ENV PATH="/opt/platform-tools:${PATH}"
38+
RUN ls
39+
RUN if [ -f ./tools/platform-tools.zip ]; then \
40+
unzip ./tools/platform-tools.zip -d /opt && rm ./tools/platform-tools.zip; \
41+
else \
42+
echo "No platform-tools found, skipping..."; \
43+
fi
44+
3545
ENTRYPOINT ["python3", "run_tests.py"]

cobalt/testing/browser_tests/tools/collect_test_artifacts.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,12 @@ def main():
128128
choices=['xz', 'gz', 'zstd'],
129129
default='gz',
130130
help='The compression algorithm to use.')
131+
parser.add_argument(
132+
'--adb_platform_tools',
133+
type=str,
134+
default=('cobalt/testing/browser_tests/tools/'
135+
'platform-tools_r33.0.1-linux.zip'),
136+
help='The zip file to incorporate into the tarball.')
131137
args = parser.parse_args()
132138

133139
if args.output_dir:
@@ -157,6 +163,12 @@ def main():
157163
build_dir)
158164
continue
159165

166+
adb_platform_tools = args.adb_platform_tools
167+
if is_android and adb_platform_tools:
168+
copy_if_needed(adb_platform_tools,
169+
os.path.join(stage_dir, 'tools/platform-tools.zip'),
170+
copied_sources)
171+
160172
test_runner_rel = get_test_runner(build_dir, is_android)
161173
logging.info('Processing build directory: %s', build_dir)
162174

Binary file not shown.

0 commit comments

Comments
 (0)