Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inlyne: update test to remove expect dependency #202603

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 15 additions & 18 deletions Formula/i/inlyne.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
depends_on "pkgconf" => :build
depends_on "rust" => :build

uses_from_macos "expect" => :test

on_linux do
depends_on "libxkbcommon"
depends_on "wayland"
Expand All @@ -34,7 +32,7 @@
zsh_completion.install "completions/_inlyne"
end

test do

Check failure on line 35 in Formula/i/inlyne.rb

View workflow job for this annotation

GitHub Actions / macOS 13-x86_64

`brew test --verbose inlyne` failed on macOS Ventura (13)!

"2025-01-03T03:40:23.940799Z INFO wgpu_core::hub: Dropping Global \n" + "2025-01-03T03:40:23.940949Z TRACE winit::platform_impl::platform::window: Locked shared state in `fullscreen` \n" + "2025-01-03T03:40:23.940959Z TRACE winit::platform_impl::platform::window: Unlocked shared state in `fullscreen` \n" + "2025-01-03T03:40:23.940987Z TRACE winit::platform_impl::platform::window_delegate: Triggered `windowWillClose:` \n" + "2025-01-03T03:40:23.941013Z TRACE winit::platform_impl::platform::window_delegate: Completed `windowWillClose:` \n" + "Error: Failed to find an appropriate adapter\n" ::error::inlyne: failed An exception occurred within a child process: Errno::ESRCH: No such process /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/i/inlyne.rb:49:in `kill' /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/i/inlyne.rb:49:in `block (2 levels) in <class:Inlyne>' /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/3.3.6/lib/ruby/3.3.0/open3.rb:540:in `popen_run' /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/3.3.6/lib/ruby/3.3.0/open3.rb:522:in `popen2e' /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/i/inlyne.rb:45:in `block in <class:Inlyne>' /usr/local/Homebrew/Library/Homebrew/formula.rb:2903:in `block (3 levels) in run_test' /usr/local/Homebrew/Library/Homebrew/extend/kernel.rb:539:in `with_env' /usr/local/Homebrew/Library/Homebrew/formula.rb:2902:in `block (2 levels) in run_test' /usr/local/Homebrew/Library/Homebrew/formula.rb:1215:in `with_logging' /usr/local/Homebrew/Library/Homebrew/formula.rb:2901:in `block in run_test' /usr/local/Homebrew/Library/Homebrew/mktemp.rb:90:in `block in run' /usr/local/Homebrew/Library/Homebrew/mktemp.rb:90:in `chdir' /usr/local/Homebrew/Library/Homebrew/mktemp.rb:90:in `run' /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11710/lib/types/private/methods/call_validation.rb:278:in `bind_call' /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11710/lib/types/private/methods/call_validation.rb:278:in `validate_call' /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11710/lib/types/private/methods/_methods.rb:277:in `block in _on_method_added' /usr/local/Homebrew/Library/Homebrew/formula.rb:3230:in `mktemp' /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11710/lib/types/private/methods/call_validation.rb:278:in `bind_call' /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11710/lib/types/private/methods/call_validation.rb:278:in `validate_call' /usr/local/Homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11710/lib/types/private/methods/_methods.rb:277:in `block in _on_method_added' /usr/local/Homebrew/Library/Homebrew/formula.rb:2895:in `run_test' /usr/local/Homebrew/Library/Homebrew/test.rb:48:in `block in <main>' /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/3.3.6/lib/ruby/3.3.0/timeout.rb:186:in `block in timeout' /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/3.3.6/lib/ruby/3.3.0/timeout.rb:41:in `handle_timeout' /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/3.3.6/lib/ruby/3.3.0/timeout.rb:195:in `timeout' /usr/local/Homebrew/Library/Homebrew/test.rb:54:in `<main>'
assert_match version.to_s, shell_output("#{bin}/inlyne --version")

# Fails in Linux CI with
Expand All @@ -42,22 +40,21 @@
return if OS.linux? && ENV["HOMEBREW_GITHUB_ACTIONS"]

test_markdown = testpath/"test.md"
test_markdown.write <<~EOS
test_markdown.write <<~MARKDOWN
_lorem_ **ipsum** dolor **sit** _amet_
EOS

script = (testpath/"test.exp")
script.write <<~EOS
#!/usr/bin/env expect -f
set timeout 2

spawn #{bin}/inlyne #{test_markdown}

send -- "q\r"

expect eof
EOS

system "expect", "-f", "test.exp"
MARKDOWN

ENV["INLYNE_LOG"] = "trace" # "inlyne=debug,cosmic_text=trace"
ENV["NO_COLOR"] = "1"

Open3.popen2e(bin/"inlyne", test_markdown) do |_stdin, stdout_and_stderr, wait_thread|
sleep 5
output = stdout_and_stderr.read
pp output
Process.kill "TERM", wait_thread.pid
assert_match "Line LTR: 'lorem ipsum dolor sit amet'", output
assert_match(/style: Italic,.*\n.*Run \[\]: 'lorem'/, output)
refute_match "ERROR", output
end
end
end
Loading