Procházet zdrojové kódy

additional tools for tests

UwU před 1 měsícem
rodič
revize
b0f061adb8
2 změnil soubory, kde provedl 14 přidání a 7 odebrání
  1. 9 5
      tools/linuxvm/release_check.sh
  2. 5 2
      tools/linuxvm/update_check.sh

+ 9 - 5
tools/linuxvm/release_check.sh

@@ -10,6 +10,7 @@
 #   --app path       we_manager's dist/linux-unpacked or a .deb; without it the we_manager checks are skipped
 #   --engine-tarball the candidate's portable tarball, served to we_manager as the new engine release (update_check.sh)
 #   --no-overlay     run on the VM's disk as it is (a VM without a golden disk is run like this anyway)
+#   --wem-only       only we_manager's checks (clean install, update and downgrade, install/launch): boot, candidate, then wem.txt
 #   --quick          for daily runs: the engine level groups (video, automute) only on profiles with FULL_ENGINE=1, the hotswap
 #                    cycle only its first 3 swaps elsewhere; the release candidate gets the full run
 # A profile (profiles/<vm>.sh) sets: VM, SCREEN (as --screen-root names it), SHOT_CMD (command with $SHOT_FILE, or
@@ -18,7 +19,7 @@
 # gets the VM name; prints PASS/FAIL lines).
 HERE=$(cd "$(dirname "$0")" && pwd)
 LINUXVM=${LINUXVM:-$HOME/.local/share/linuxvm}
-vms=() candidate="" app="" overlay=1 tarball="" quick=0
+vms=() candidate="" app="" overlay=1 tarball="" quick=0 wemonly=0
 while [ $# -gt 0 ]; do
     case $1 in
     --vm) vms+=("$2"); shift ;;
@@ -27,6 +28,7 @@ while [ $# -gt 0 ]; do
     --engine-tarball) tarball=$2; shift ;;
     --no-overlay) overlay=0 ;;
     --quick) quick=1 ;;
+    --wem-only) wemonly=1 ;;
     *) sed -n '2,20p' "$0"; exit 2 ;;
     esac
     shift
@@ -171,7 +173,9 @@ for VM in "${vms[@]}"; do
             tmark boot
             first_only="" CYCLE_UPTO=""
             if [ $quick = 1 ] && [ "${FULL_ENGINE:-0}" != 1 ]; then first_only="wallpapers behavior cycle transition multi windowbg"; CYCLE_UPTO=3; fi
-            ONLY="$first_only" run_checks > "$report/$VM/checks.txt" 2>&1
+            if [ $wemonly = 1 ]; then : > "$report/$VM/checks.txt"; else
+                ONLY="$first_only" run_checks > "$report/$VM/checks.txt" 2>&1
+            fi
             CYCLE_UPTO=""
             tmark checks
             fatal=0
@@ -228,7 +232,7 @@ for VM in "${vms[@]}"; do
                 RETRY_WALLPAPERS="" CYCLE_UPTO=""
             fi
             [ -f "$report/$VM/checks-retry.txt" ] && tmark retry
-            if [ $fatal = 0 ] && [ "${POINTER:-1}" = 1 ]; then
+            if [ $fatal = 0 ] && [ $wemonly = 0 ] && [ "${POINTER:-1}" = 1 ]; then
                 POINTER_DOCK_XY=${POINTER_DOCK_XY:-} "$HERE/pointer_check.sh" "$VM" "$SCREEN" "$report/$VM/shots" > "$report/$VM/pointer.txt" 2>&1
                 if grep -q '^FAIL' "$report/$VM/pointer.txt"; then
                     cp "$report/$VM/pointer.txt" "$report/$VM/pointer-first.txt"
@@ -237,7 +241,7 @@ for VM in "${vms[@]}"; do
                 grep -E '^(PASS|FAIL|SKIP)' "$report/$VM/pointer.txt" >> "$report/$VM/checks.txt"
             fi
             tmark pointer
-            if [ $fatal = 0 ] && [ "${ICONS:-1}" = 1 ]; then
+            if [ $fatal = 0 ] && [ $wemonly = 0 ] && [ "${ICONS:-1}" = 1 ]; then
                 sshv "pkill -f '[l]inux-wallpaperengine' 2>/dev/null; true"; sleep 3
                 "$HERE/desktop_icons_check.sh" "$VM" "$SCREEN" > "$report/$VM/icons.txt" 2>&1
                 if grep -q '^FAIL' "$report/$VM/icons.txt"; then
@@ -257,7 +261,7 @@ for VM in "${vms[@]}"; do
                 } > "$report/$VM/wem.txt" 2>&1
             fi
             tmark wem
-            [ $fatal = 0 ] && [ -n "$EXTRA" ] && $EXTRA "$VM" > "$report/$VM/extra.txt" 2>&1
+            [ $fatal = 0 ] && [ $wemonly = 0 ] && [ -n "$EXTRA" ] && $EXTRA "$VM" > "$report/$VM/extra.txt" 2>&1
             tmark extra
             sshv "cat /tmp/lwe-test/engine-*.log 2>/dev/null | tail -n 200" > "$report/$VM/engine-tail.log" 2>&1
         fi

+ 5 - 2
tools/linuxvm/update_check.sh

@@ -49,7 +49,8 @@ sleep 3
 kill -0 $fake 2>/dev/null || { cat "$work/fake.log"; echo "fake_github did not start (port 443?)"; exit 2; }
 
 sshv 'mkdir -p ~/wem'
-if [ -d "$app" ] && ! sshv "test -x ~/wem/$(basename "$app")/we-manager"; then   # the app is not on the VM yet: copy it like wem_check.sh
+if [ -d "$app" ]; then   # always the candidate: a golden disk keeps an older build, and clean_install_check.sh skips read-only systems
+    sshv 'pkill -f "[w]e-manager" 2>/dev/null; for _ in $(seq 20); do pgrep -f "[w]e-manager" >/dev/null || break; sleep 1; done; rm -rf ~/wem/'"$(basename "$app")"'; true'
     tar -C "$(dirname "$app")" -cf - "$(basename "$app")" | ssh -i "$HOME/.local/share/linuxvm/id_ed25519" -p "$(cat "$HOME/.local/share/linuxvm/vms/$vm/port")" \
         -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=ERROR lab@127.0.0.1 'mkdir -p ~/wem && tar -C ~/wem -xf -'
 fi
@@ -97,7 +98,9 @@ r=$(val "window.electronAPI.updates.versions('engine').then(v => v.map(x => x.ta
 if [[ $r == *"$engine_tag"* && $r == *"$engine_old"* && $r != *libnode* ]]; then pass "engine versions listed without the libnode release ($r)"; else fail "engine versions: '$r'"; fi
 if [ -f "$deb" ]; then
     r=$(val "window.electronAPI.updates.versions('app').then(v => v.map(x => x.tag).join(' '))")
-    [ "$r" = "v0.9.9 v0.9.7" ] && pass "app versions listed newest first ($r)" || fail "app versions: '$r'"
+    want="v0.9.9 v0.9.7"
+    [ "$kind" = deb ] || want=""
+    [ "$r" = "$want" ] && pass "app versions for a '$kind' install: '$r'" || fail "app versions: '$r', wanted '$want'"
 fi
 
 if [ "$kind" = deb ]; then