neovimhaskell / nvim-hs

Neovim API for Haskell plugins as well as the plugin provider
Other
267 stars 18 forks source link

The test is broken again! #14

Closed osa1 closed 9 years ago

osa1 commented 9 years ago

The test we fixed couple of days ago is broken again. I added a .travis.yml script, but I can't enable Travis since I'm not the owner of the repo. @saep can you enable it? In the meantime I'll be debugging this.

saep commented 9 years ago

I noticed that. Somehow neovim hangs after invoking the quit command for the test case where it reads in a file. The messages indicate that the process receives SIGTERM signals, but it dies not quit even then.

saep commented 9 years ago

Do you have a .swp file lingering around? I opened the test-file with nvim -u NONE test-files/hello and chose to delete it.

This means, that we should/could delete all swap-files inside test-files before running our tests. But it also shows that the code to kill the embedded neovim process does not kill neovim properly because the test-suite has never terminated for me. (see https://github.com/saep/nvim-hs/blob/master/test-suite/Neovim/EmbeddedRPCSpec.hs#L51-61)

osa1 commented 9 years ago

Good catch. Yeah I have the .swp file and indeed removing it is solving this problem. And yeah killing neovim is not working :)

For solving the .swp file problem, we can run nvim as nvim -n -u or we can delete .swp files before/after tests. Personally I think first one is a better solution.

osa1 commented 9 years ago

So now our only problem for passing tests is this:

> (hin, hout, h, c) <- embedVim
> runNeovim c () (vim_command "qa!")
> getProcessExitCode h
Just (ExitFailure (-6))
> (hin, hout, h, c) <- embedVim
> hClose hin
> getProcessExitCode h
Just ExitSuccess

For some reason if I run qa! in nvim --embed it's returning 6. I'm wondering if we have a documented way to close embedded vim.

saep commented 9 years ago

Closing the input-stream seems like a reasonable way to exit such a process. I pushed changes that close the handles hin and hout after running a test. Anyhow, the tests currently keep failing because cabal check complains about debug options (namely -ddump-splices). I tried getting around that by using a build flag, but it has been rejected this way as well. We have two objects for that in the short term, remove cabal check from the .travis.yml or remove the Template Haskell debugging option from the cabal file. Passing cabal check will become relevant once we actually create releases, and if we try to upload something that doesn't pass cabal check, we will be automatically forced to fix these issues if we want to upload a release. So, until we have an actual release, I'm in favor of removing cabal check from the .travis.yml.

osa1 commented 9 years ago

It's weird that cabal check is failing even after hiding -d in a flag. I'm OK with removing cabal check or -ddump-splices.

Alternative is to remove -ddump-splices and leave cabal check. We can then use cabal configure --ghc-options=-ddump-splices.

saep commented 9 years ago

Alternative is to remove -ddump-splices and leave cabal check. We can then use cabal configure --ghc-options=-ddump-splices.

Convenient enough for anyone who wants to work on the Template Haskell code. I think we can do this now and keep cabal check.

osa1 commented 9 years ago

About this return code when run vim_command "qa!", it turns out it may be a bug: https://github.com/neovim/neovim/issues/2648.