From a69274141737e7976f2d64fbfd498a2d75ff4d37 Mon Sep 17 00:00:00 2001 From: tligui_y Date: Sat, 16 Aug 2025 14:34:49 +0200 Subject: [PATCH] Update action.yml --- action.yml | 46 ++++++++++++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/action.yml b/action.yml index 0fc78bc..7f4aefe 100644 --- a/action.yml +++ b/action.yml @@ -170,39 +170,49 @@ runs: echo "▶️ Running tests inside tmux session (with D-Bus)" echo "▶️ Running tests inside tmux session (with D-Bus)" >> "$LOG_FILE" - # Start DBus before tmux - DBUS_INFO=$(dbus-launch) - eval "$DBUS_INFO" - export DBUS_SESSION_BUS_ADDRESS - - ./start-notification-service.sh - tmux new-session -d -s test-session " - export DBUS_SESSION_BUS_ADDRESS=\"$DBUS_SESSION_BUS_ADDRESS\" - pixi run pytest -s \"$TEST_PATH\" $PYTEST_ARGS + TMUX_TTY=\$(tmux list-panes -t test-session -F '#{pane_tty}'); + export TMUX_TTY; + + dbus-run-session -- bash -c ' + ./start-notification-service.sh & + SERVICE_PID=\$! + sleep 2 + + gdbus introspect --session \ + --dest org.freedesktop.Notifications \ + --object-path /org/freedesktop/Notifications \ + || exit 1 + + pixi run pytest -s \"$TEST_PATH\" $PYTEST_ARGS + kill \$SERVICE_PID + ' tmux wait-for -S done " >> outputs/full-output.log 2>&1 sleep 1 tmux wait-for done - kill $(cat /tmp/notify-service.pid) else - # Version sans tmux echo "▶️ Running tests (with D-Bus)" echo "▶️ Running tests (with D-Bus)" >> "$LOG_FILE" - - eval "$(dbus-launch --sh-syntax)" - export DBUS_SESSION_BUS_ADDRESS="$DBUS_SESSION_BUS_ADDRESS" - ./start-notification-service.sh - sleep 1 # Attendre que le service soit prêt + dbus-run-session -- bash -c " + ./start-notification-service.sh & + SERVICE_PID=\$! + sleep 2 - pixi run pytest -s "$TEST_PATH" $PYTEST_ARGS + gdbus introspect --session \ + --dest org.freedesktop.Notifications \ + --object-path /org/freedesktop/Notifications \ + || exit 1 - kill $(cat /tmp/notify-service.pid) + pixi run pytest -s \"$TEST_PATH\" $PYTEST_ARGS + kill \$SERVICE_PID + " fi >> outputs/full-output.log 2>&1 + echo "▶️ END" cat outputs/full-output.log