zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
50.79k stars 3.15k forks source link

Running benchmark tests in Go fails #12693

Open CocoaPriest opened 5 months ago

CocoaPriest commented 5 months ago

Check for existing issues

Describe the bug / provide steps to reproduce it

Running benchmark tests in Go fails. Regular tests work as expected. Hint: I think it may be related to the fact I'm using Fish shell.

fish: Expected a variable name after this $.
go test $ZED_CUSTOM_GO_PACKAGE -benchmem -run=^$ -bench ^$ZED_SYMBOL$
                                               ^

⏵ Task `go test ./iteration -bench BenchmarkRepeat` finished with non-zero error code: 127
⏵ Command: '/usr/local/bin/fish -i -c `go test ./iteration -benchmem -run=^$ -bench ^BenchmarkRepeat$`'

Environment

Zed: v0.138.4 (Zed) OS: macOS 14.4.1 Memory: 32 GiB Architecture: aarch64

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

No response

osiewicz commented 5 months ago

Yep, that's just due to fish being incompatible with that syntax.

notpeter commented 3 weeks ago

The issue is here: https://github.com/zed-industries/zed/blob/7c72929f0ba3ade5fde3e7b090dcd2685ae243e3/crates/languages/src/go.rs#L533-L539

I wonder whether it would be sufficient to replace -run=^$" with -run='^$'" (untested).