Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .kokoro/presubmit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ fi
"${TOOL_DIR}/testutils/prepare_host.sh" -d "${REPO_DIR}" -u testrunner -g kokoro

# Run as different user without sudo privileges
sudo -u testrunner CREDENTIAL_SOURCE=gce "${TOOL_DIR}/testutils/runcvde2etests.sh"
sudo -u testrunner CREDENTIAL_SOURCE=gce "${TOOL_DIR}/testutils/runcvde2etests.sh" \
"${ANDROID_CUTTLEFISH_KOKORO_PRESUBMIT_SH_OPTIONAL_PASSTHROUGH_ARG_G}"
14 changes: 14 additions & 0 deletions .kokoro/presubmit_gpu.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
build_file: "android-cuttlefish/.kokoro/presubmit_gpu.sh"
env_vars {
key: "ANDROID_CUTTLEFISH_KOKORO_PRESUBMIT_SH_OPTIONAL_PASSTHROUGH_ARG_G"
value: "-g"
}

action {
define_artifacts {
regex: "*/*sponge_log.xml" # Actually a glob, not a regex
regex: "*/*sponge_log.log"
regex: "*/device_logs/**" # match all files regardless of directory depth
regex: "github/android-cuttlefish/*.deb"
}
}
10 changes: 10 additions & 0 deletions e2etests/cvd/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,14 @@ cvd_command_boot_test(
target = "aosp_cf_x86_64_only_phone-userdebug",
)

cvd_command_boot_test(
name = "this_test_will_fail",
branch = "aosp-android-latest-release",
cvd_command = [
"this_command_does_not_exist",
],
target = "aosp_cf_x86_64_only_phone-userdebug",
tags = ["requires_gpu"],
)

# TODO(b/329100411) test loading older branches
4 changes: 2 additions & 2 deletions e2etests/cvd/boot_tests.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def cvd_load_boot_test(name, env_file, size = "medium", credential_source = ""):
],
)

def cvd_command_boot_test(name, branch, target, cvd_command = [], credential_source = "", substitutions = ""):
def cvd_command_boot_test(name, branch, target, cvd_command = [], credential_source = "", substitutions = "", tags = []):
args = ["-b", branch, "-t", target]
if credential_source:
args += ["-c", credential_source]
Expand All @@ -47,5 +47,5 @@ def cvd_command_boot_test(name, branch, target, cvd_command = [], credential_sou
"exclusive",
"external",
"no-sandbox",
],
] + tags,
)
23 changes: 22 additions & 1 deletion tools/testutils/runcvde2etests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,23 @@ REPO_DIR="$(realpath "$(dirname "$0")/../..")"
OUTPUT_DIR="$(pwd)"
CREDENTIAL_SOURCE="${CREDENTIAL_SOURCE:-}"

bazel_test_tag_filter_arg="--test_tag_filters=-requires_gpu"
while getopts "g:" opt; do
case "${opt}" in
g)
bazel_test_tag_filter_arg=""
;;
*)
echo "Invalid option: -${opt}"
echo "Usage: $0 [-g]"
echo ""
echo "Options"
echo " -g include tests with the `requires_gpu` tag"
exit 1
;;
esac
done

function gather_test_results() {
# Don't immediately exit on error anymore
set +e
Expand Down Expand Up @@ -35,4 +52,8 @@ fi

# --zip_undeclared_test_outputs triggers the creation of the outputs.zip file
# everything written to $TEST_UNDECLARED_OUTPUTS_DIR is put into this zip
bazel test ${credential_arg} --zip_undeclared_test_outputs cvd/...
bazel test \
${bazel_test_tag_filter_arg} \
${credential_arg} \
--zip_undeclared_test_outputs \
cvd/...
Loading