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

Cannot load quickfixlist with tests results #162

Open
eruizc-dev opened this issue May 25, 2021 · 1 comment
Open

Cannot load quickfixlist with tests results #162

eruizc-dev opened this issue May 25, 2021 · 1 comment

Comments

@eruizc-dev
Copy link
Contributor

eruizc-dev commented May 25, 2021

TLDR:

The way failed tests are notified makes it hard to load them into quickfixlist.

Description

I use vim-dispatch to run tests, which runs a makefile and loads output to quickfixlist. The problem is that Plenary seems to prepend 3 dots (...) to long paths creating a non-valid path for quickfixlist to follow.

As you can see in the following quickfixlist, it's filled with invalid paths and noise

  • Resulting quickfixlist:
|| ========================================	
|| Testing: 	/home/eruizc/repos/eruizc-dev/rubberduck-nvim/lua/spec/rubberduck/utils/file_spec.lua	
|| �[31mFail�[0m	||	file read returns file contents	
.../rubberduck-nvim/lua/spec/rubberduck/utils/file_spec.lua|23| Expected objects to be equal.
||             Passed in:
||             (string) 'adsf'
||             Expected:
||             (string) ''
||             
||             stack traceback:
.../rubberduck-nvim/lua/spec/rubberduck/utils/file_spec.lua|23| in function <.../rubberduck-nvim/lua/spec/rubberduck/utils/file_spec.lua:18>
||             	
|| �[32mSuccess�[0m	||	file read excepts on unexisting file	
|| �[32mSuccess�[0m	||	file read excepts on unreadable file	
|| �[32mSuccess�[0m	||	file read reads correctly when content is empty	
|| �[32mSuccess�[0m	||	file read reads correctly when content is 'nil'	
|| �[32mSuccess�[0m	||	file read reads correctly when content is 'null'	
|| �[32mSuccess�[0m	||	file read reads correctly when content is '0'	
|| 	
|| �[32mSuccess: �[0m	6	
|| �[31mFailed : �[0m	1	
|| �[31mErrors : �[0m	0	
|| ========================================	
|| Tests Failed. Exit: 1	
  • This is my makefile:
test:
	nvim --headless -c "PlenaryBustedDirectory ."

It may be related to issue #73, but one is for human readability and this one is for parsing

Repro steps

  1. Install plenary.nvim and vim-dispatch
  2. Create a lua project with a makefile like the previously mentioned (or you can also clone mine)
  3. Run :Make command
  4. See the resulting quickfixlist with :copen
@tjdevries
Copy link
Member

We should add a different output format maybe that is JSON or something and you could just put in qflist programmatically

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants