Skip to content

Commit 353beec

Browse files
committed
fix: enhance VM runner detection and add diagnostic logging for clarity
1 parent 20e4f2c commit 353beec

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

tests/e2e/deploy-vm.sh

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,20 @@ if ! nix build .#ci-target-vm --out-link "$VM_STATE-link" --show-trace 2>&1; the
5858
lc_fail "deploy-vm/build-vm" "nix build of ci-target-vm failed"
5959
fi
6060

61-
VM_RUNNER="$(find "$VM_STATE-link/bin" -maxdepth 1 -type f -name 'run-*-vm' | head -n1)"
62-
[[ -x "$VM_RUNNER" ]] || lc_fail "deploy-vm/build-vm" "no runnable VM script under $VM_STATE-link/bin"
61+
# qemu-vm.nix produces `bin/run-<hostname>-vm` as a SYMLINK (not a regular
62+
# file), so `find -type f` would miss it. `-L` makes find follow symlinks
63+
# and treat the target as the entry's type, after which `-type f` matches
64+
# the underlying script. Diagnostic listing is emitted so failures are
65+
# self-explanatory in the workflow log.
66+
if ! VM_RUNNER="$(find -L "$VM_STATE-link/bin" -maxdepth 1 -type f -name 'run-*-vm' 2>/dev/null | head -n1)" || [[ -z "$VM_RUNNER" ]]; then
67+
lc_info "deploy-vm/build-vm: contents of $VM_STATE-link"
68+
ls -la "$VM_STATE-link/" 2>&1 | sed 's/^/ /' || true
69+
lc_info "deploy-vm/build-vm: contents of $VM_STATE-link/bin"
70+
ls -la "$VM_STATE-link/bin/" 2>&1 | sed 's/^/ /' || true
71+
lc_fail "deploy-vm/build-vm" "no run-*-vm script under $VM_STATE-link/bin"
72+
fi
73+
74+
[[ -x "$VM_RUNNER" ]] || lc_fail "deploy-vm/build-vm" "VM runner '$VM_RUNNER' is not executable"
6375
lc_info "deploy-vm/build-vm: runner = $VM_RUNNER"
6476
lc_ok "deploy-vm/build-vm"
6577

0 commit comments

Comments
 (0)