ivaaaan / smug

Session manager and task runner for tmux. Start your development environment within one command.
MIT License
712 stars 29 forks source link

`detach` mode seems not working with 0.3.5 release #129

Open chenrui333 opened 1 month ago

chenrui333 commented 1 month ago

👋 while bumping smug to 0.3.5 release, seeing some regression test issue with the detached mode

  ==> /opt/homebrew/Cellar/smug/0.3.5/bin/smug start --file /private/tmp/smug-test-20241011-9211-e5yqxb/test.yml --detach
  Starting a new session...
  1049h1h25h1000l1002l1003l1006l1005l2004h25h1006l1000l1002l1003lcq25lbrew@Sequoia-arm64 ~ % 

full build log, https://github.com/Homebrew/homebrew-core/actions/runs/11295405800/job/31418666575?pr=193749

relates to https://github.com/Homebrew/homebrew-core/pull/193749

ivaaaan commented 1 month ago

Hey. I think the problem is that the path is not correct. This patch should fix it

  test do
    (testpath/".config/smug/test.yml").write <<~EOF
      session: homebrew-test-session
      root: .
      windows:
        - name: test
    EOF

    assert_equal(version, shell_output(bin/"smug").lines.first.split("Version").last.chomp)

    with_env(TERM: "screen-256color") do
-      system bin/"smug", "start", "--file", testpath/"test.yml", "--detach"
+      system bin/"smug", "start", "--file", testpath/".config/smug/test.yml", "--detach"
    end

    assert_empty shell_output("tmux has-session -t homebrew-test-session")
    system "tmux", "kill-session", "-t", "homebrew-test-session"
  end
chenrui333 commented 3 weeks ago

@ivaaaan sorry about the delay, and thanks for the pointer, I am gonna retry the PR now. 🙏

chenrui333 commented 3 weeks ago

still the same error

==> Testing smug
/opt/homebrew/Library/Homebrew/test.rb (Formulary::FromPathLoader): loading /opt/homebrew/Library/Taps/homebrew/homebrew-core/Formula/s/smug.rb
==> /opt/homebrew/Cellar/smug/0.3.5/bin/smug
==> /opt/homebrew/Cellar/smug/0.3.5/bin/smug start --file /private/tmp/smug-test-20241030-8346-biw54d/.config/smug/test.yml --detach
Starting a new session...
[exited]
==> tmux has-session -t homebrew-test-session
no server running on /private/tmp/tmux-501/default

/opt/homebrew/Library/Homebrew/ignorable.rb:27:in `block in raise'
Minitest::Assertion: Expected: 0
  Actual: 1
chenrui333 commented 1 week ago

cc @ivaaaan

ivaaaan commented 5 days ago

The error is different now that. I couldn't reproduce this with the test config on my machine. Help would be appreciated, I don't know much details on how homebrew runs its tests.