Hash :
e43d3591
Author :
Date :
2024-11-01T16:23:27
Tests: allow choosing Chromium/our test runner + screen checks
Chromium test runner (build/android/test_runner.py) is currently the
default runner for most suites. One exception is angle_trace_tests where
we're always using our scripts instead (android_helper.py etc).
We do that by setting android_test_runner_script to our runner for that
angle_test instance.
This CL supports setting android_test_runner_script to our script but
then choose whether to run with the Chromium runner or android_helper
depending on the command-line arg (--angle-test-runner)
This CL also adds a check for the screen state which will be performed
regardless of the runner. This is to have a fast and clean failure when
the device wasn't properly initialized by the infra (see bug).
The check is based on the output of `dumpsys deviceidle | grep mScreen`
(this is the most generic check I found, I previously used nfc but that
depends on nfc and turns out the output is device-dependent)
This CL enables this mode for angle_end2end_tests. Bots will continue to
run with Chromium runner as before (but with the added screen checks).
Locally, we will now be able to switch to our scripts directly:
out/Android/angle_end2end_tests \
--gtest_filter='*ClearTextureEXT2DMSStencil*' \
--angle-test-runner
Now when running end2end tests locally (regardless of the runner) with
a locked device screen, we'll see the following error right away
instead of sporadic failures or stuckness during execution:
Exception: Unexpected device screen state: ['mScreenOn=false', 'mScreenLocked=true']; expected: ['mScreenOn=true', 'mScreenLocked=false']
The plan is to enable this mode for all suites, after which the current
local script run_angle_android_test.py will no longer be needed.
Bug: b/344849382
Change-Id: I77e7733804ab37e2f3d26bf3574a52a9553e4274
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5985232
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Commit-Queue: Roman Lavrov <romanl@google.com>
#! /usr/bin/env python3
#
# Copyright 2022 The ANGLE Project Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# run_angle_android_test.py:
# Runs ANGLE tests using android_helper wrapper. Example:
# (cd out/Android; ../../src/tests/run_angle_android_test.py \
# --suite=angle_trace_tests --filter='*among_us' \
# --verbose --fixed-test-time-with-warmup=10)
import argparse
import logging
import os
import pathlib
import sys
import angle_android_test_runner
def main():
parser = argparse.ArgumentParser()
angle_android_test_runner.AddCommonParserArgs(parser)
args, extra_args = parser.parse_known_args()
return angle_android_test_runner.RunWithAngleTestRunner(args, extra_args)
if __name__ == '__main__':
sys.exit(main())