diff --git a/action.yml b/action.yml index 5e70a92..4e60b69 100644 --- a/action.yml +++ b/action.yml @@ -167,39 +167,38 @@ runs: set +e if [ "${{ inputs.use_tmux_test }}" = "true" ]; then - echo "▶️ Running tests inside tmux session (with D-Bus)" - echo "▶️ Running tests inside tmux session (with D-Bus)" >> "$LOG_FILE" + echo "▶️ Running tests inside tmux session" - tmux new-session -d -s test-session " - TMUX_TTY=\$(tmux list-panes -t test-session -F '#{pane_tty}'); - export TMUX_TTY; - # Run pytest inside a fresh D-Bus session with Xvfb + notification-daemon - dbus-run-session -- bash -lc ' - ./start-notification-service.sh & - sleep 1 - gdbus introspect --session --dest org.freedesktop.Notifications --object-path /org/freedesktop/Notifications || echo 'Service not running' - pixi run pytest -s \"$TEST_PATH\" $PYTEST_ARGS - ' >> outputs/full-output.log 2>&1; - tmux wait-for -S done - " + tmux new-session -d -s test-session " + TMUX_TTY=\$(tmux list-panes -t test-session -F '#{pane_tty}'); + export TMUX_TTY; - sleep 1 - tmux wait-for done + # Lancer le service DBus fake + ./start-notification-service.sh >> outputs/full-output.log 2>&1 & + SERVICE_PID=\$! + + sleep 2 + + pixi run pytest -s $TEST_PATH $PYTEST_ARGS >> outputs/full-output.log 2>&1 + + kill \$SERVICE_PID + " + tmux wait-for test-session else - echo "▶️ Running tests (with D-Bus)" - echo "▶️ Running tests (with D-Bus)" >> "$LOG_FILE" + echo "▶️ Running tests normally" - dbus-run-session -- bash -lc ' - ./start-notification-service.sh & - SERVICE_PID=$! - sleep 1 - 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 - ' >> outputs/full-output.log 2>&1 + ./start-notification-service.sh >> outputs/full-output.log 2>&1 & + SERVICE_PID=$! + + sleep 2 + + pixi run pytest -s $TEST_PATH $PYTEST_ARGS >> outputs/full-output.log 2>&1 + + kill $SERVICE_PID fi + echo "▶️ END" cat outputs/full-output.log