nu: Improve m e2e

This commit is contained in:
2025-09-09 13:44:09 +02:00
parent 96f80a024a
commit 5b4f97982d

View File

@ -129,7 +129,9 @@ def "m e2e list" [
def "m e2e run" [ def "m e2e run" [
account: string account: string
vm: string
--skip: list<string> --skip: list<string>
--display (-d)
...tests ...tests
] { ] {
let commit = (git rev-parse HEAD | take 6 | decode) let commit = (git rev-parse HEAD | take 6 | decode)
@ -138,17 +140,28 @@ def "m e2e run" [
let dist = "../dist" let dist = "../dist"
print $"Looking in ($dist)" print $"Looking in ($dist)"
let pkgs = (ls $dist | where name =~ ".*\\.pkg") let pkg_ext = match (uname).kernel-name {
"Linux" => "rpm", # TODO: rpm
"Darwin" => "pkg",
_ => (panic "Unknown kernel"),
}
let target = match (uname).kernel-name {
"Linux" => "x86_64-unknown-linux-musl",
"Darwin" => "aarch64-apple-darwin",
_ => (panic "Unknown kernel"),
}
let pkgs = (ls $dist | where name =~ $".*\\.($pkg_ext)")
let pkgs = ($pkgs | where name =~ $commit) let pkgs = ($pkgs | where name =~ $commit)
if ($pkgs | is-empty) { if ($pkgs | is-empty) {
print "No .pkg for current commit found." print $"No .($pkg_ext) for current commit found."
print "Run ./build.sh" print "Run ./build.sh"
return return
} }
if ($pkgs | length) > 1 { if ($pkgs | length) > 1 {
print "Multiple .pkg:s for current commit found." print $"Multiple .($pkg_ext):s for current commit found."
print "Make sure there's only one" print "Make sure there's only one"
print ...$pkgs print ...$pkgs
return return
@ -159,16 +172,22 @@ def "m e2e run" [
print $"Using ($pkg)" print $"Using ($pkg)"
print "Building test utils" print "Building test utils"
cargo b --target aarch64-apple-darwin
let test_manager = $"($env.CARGO_TARGET_DIR)/aarch64-apple-darwin/debug/test-manager" cargo b --release --target $target -p test-runner -p connection-checker
cargo b -p test-manager
let test_manager = $"($env.CARGO_TARGET_DIR)/debug/test-manager"
let bin_dir = $"($env.CARGO_TARGET_DIR)/($target)/release/"
mut args = [ mut args = [
--vm macos15 --vm $vm
--account $account --account $account
--app-package $pkg --app-package $pkg
--runner-dir $bin_dir
] ]
if $display {
$args ++= [--display]
}
for s in $skip { for s in $skip {
$args ++= ["--skip" $s] $args ++= ["--skip" $s]
} }