From 98050591d9de54c235a36ff149260f4bd2c0d7e8 Mon Sep 17 00:00:00 2001 From: Jerry Marino Date: Thu, 12 Oct 2023 12:09:13 -0700 Subject: [PATCH] Update tart to 0.35.2 to cached version (#774) We saw these releases get deleted - use re-hosted cached sha Further, fix issue with disk attachment in this release --- rules/repositories.bzl | 4 ++-- tools/vmd/vmd.sh | 21 +++++++++++++++------ 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/rules/repositories.bzl b/rules/repositories.bzl index ec0d2fc51..702cc7609 100644 --- a/rules/repositories.bzl +++ b/rules/repositories.bzl @@ -197,8 +197,8 @@ def _rules_ios_tool_dependencies(): _maybe( http_file, name = "tart", - urls = ["https://github.com/cirruslabs/tart/releases/download/0.14.0/tart"], - sha256 = "2c61526aa07ade30ab6534b0fdc0a0edeb56ec2084dadee587e53c46e3a8edc3", + urls = ["https://github.com/bazel-ios/tart/releases/download/0.35.2/tart"], + sha256 = "7b9f4f37054483e565c760525b7e9e9097053c361dc16306583bb2981a29a6ec", ) _maybe( diff --git a/tools/vmd/vmd.sh b/tools/vmd/vmd.sh index d97e104cb..ab9f76960 100755 --- a/tools/vmd/vmd.sh +++ b/tools/vmd/vmd.sh @@ -11,17 +11,19 @@ This program runs a command in a VM with tart for iOS testing -p|--port - [Optional] - a port to forward +-d|--disk - [Optional] - attach a disk to tart ( passthrough ) + -e|--entrypoint - [Optional] The entrypoint to run. -This entrypoint supplements the arvg invocation if provided, you need to do all the work handled here ( like running from .runfiles, untarring --upload, etc +This entrypoint supplements the arvg invocation if provided, you need to do all the work handled here ( like running from .runfiles, untarring --upload, etc --u|--upload - [Optional] Upload data to the runner +-u|--upload - [Optional] Upload data to the runner Examples of this are a .xctest bundle and xctestrunner python code -z|--no-ephemeral [Optional] By default the VMs are thrown away, turn that off Consider this an implementation of rules_ios for now. A segment of this program can be added to tart directly -e.g https://github.com/cirruslabs/tart/issues/150 +e.g https://github.com/cirruslabs/tart/issues/150 EOL } @@ -36,7 +38,7 @@ run_vm() { if test $EPHEMERAL -eq 1; then # By default we make these ephemeral - # Assign the VM name to the work_dir + # Assign the VM name to the work_dir TMP_VM="${VM_NAME}-$(basename $VM_TMPDIR)" # This VM is required to be already pulled locally. The VMs are massive: @@ -51,7 +53,8 @@ run_vm() { fi # Spinup tart in the background - tart run $run_vm_name --no-graphics &2>> $VM_TMPDIR/tart.log & + tart run ${TART_RUN_ARGS[@]} \ + $run_vm_name --no-graphics &2>> $VM_TMPDIR/tart.log & # Save the PID of tart echo $(expr $! - 1) > $VM_TMPDIR/tart.pid @@ -86,7 +89,7 @@ run_vm() { local VM_CMD=/tmp/cmd.sh sshpass -p admin scp -o StrictHostKeyChecking=no -o ConnectTimeout=30 $VM_TMPDIR/cmd.sh admin@${IP}:$VM_CMD - + ## Upload test inputs if they provide it if [[ ! -z "$RUNNER_UPLOAD" ]]; then sshpass -p admin scp -o StrictHostKeyChecking=no -o ConnectTimeout=30 $RUNNER_UPLOAD admin@${IP}:RUNNER_UPLOAD.tar @@ -125,6 +128,7 @@ main() { # distingush from the users CLI arguments BREAK_PARSE=0 POSITIONAL_ARGS=() + TART_RUN_ARGS=() while [[ $# -gt 0 ]]; do case $1 in -e|--entrypoint) @@ -151,6 +155,11 @@ main() { EPHEMERAL=0 shift ;; + -d|--disk) + TART_RUN_ARGS+=("--disk=$2") + shift + shift + ;; --) if test $BREAK_PARSE -eq 1; then POSITIONAL_ARGS+=("$1")