clap-rs / clap

A full featured, fast Command Line Argument Parser for Rust
docs.rs/clap
Apache License 2.0
13.64k stars 1.02k forks source link

fix: Don't silently ignore complete tests when missing installed shells on CI #5551

Open tesuji opened 1 week ago

tesuji commented 1 week ago

They was not run on CI, so they're siliencely falling for a long time.

Close #5540.

epage commented 6 days ago

Maybe we should deny this lint on CI.

This will happen naturally. We have a CI job that denys all warnings except deprecations. It uses a pinned version of Rust which gets updating through an automated PR process. When the lint hits stable, we'll start blocking on it automatically.

epage commented 6 days ago

I went ahead and merged some items separately so this PR can better focus on the messy case of completions

shannmu commented 3 days ago

I think that there is a related issue https://github.com/clap-rs/clap/issues/5540.

tesuji commented 2 days ago

Setting TERM=dumbin completest-pty doesn't to work properly. I guess we could try TERM=xterm or something more modern.

 thread 'fish::complete' panicked at clap_complete/tests/testsuite/fish.rs:159:5:

--- Expected
++++ actual:   In-memory
   1      - % exhaustive 
   2      - action  complete            (Register shell completions for this program)  hint  pacman  value
   3      - alias   help  (Print this message or the help of the given subcommand(s))  last  quote   ∅
        1 + % exhaustive ∅

thread 'zsh::complete' panicked at clap_complete/tests/testsuite/zsh.rs:163:5:

---- expected: tests/testsuite/zsh.rs:156:20
++++ actual:   In-memory
   1      - % exhaustive
        1 + % exhaustive                                                                                                           
   2    2 | complete                                           -- Register shell completions for this program                     
   3    3 | help                                               -- Print this message or the help of the given subcommand(s)       
   4      - pacman    action  alias  value  quote  hint  last  --                                                                 ∅
        4 + pacman    action  alias  value  quote  hint  last  --                                                                 
        5 + % exhaustive ∅
tesuji commented 2 days ago

The test passed with TERM=xterm. I guess we forced to only support running completest on xterm compatible terminals.