Skip to content

Commit

Permalink
Update tart to 0.35.2 to cached version (#774)
Browse files Browse the repository at this point in the history
We saw these releases get deleted - use re-hosted cached sha

Further, fix issue with disk attachment in this release
  • Loading branch information
jerrymarino authored Oct 12, 2023
1 parent bf647f1 commit 9805059
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
4 changes: 2 additions & 2 deletions rules/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
21 changes: 15 additions & 6 deletions tools/vmd/vmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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:
Expand All @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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")
Expand Down

0 comments on commit 9805059

Please sign in to comment.