v13axel / neotest-pest Goto Github PK
View Code? Open in Web Editor NEWNeotest adapter for Pest 2.0
License: MIT License
Neotest adapter for Pest 2.0
License: MIT License
Hey, so I just switched over from theutz's original version to this fork but now when I try to run my tests (using this keymap: vim.keymap.set("n", "<leader>t", "<cmd>lua require('neotest').run.run()<cr>")
), I get this error:
neotest-pest: ...s/nexxai/.local/share/nvim/lazy/neotest/lua/nio/init.lua:105: The coroutine failed with this message:
...l/share/nvim/lazy/neotest-pest/lua/neotest-pest/init.lua:161: No test output file found! Should have been at: storage/app/junit-20240301-014550
stack traceback:
[C]: in function 'error'
...l/share/nvim/lazy/neotest-pest/lua/neotest-pest/init.lua:161: in function 'results'
...al/share/nvim/lazy/neotest/lua/neotest/client/runner.lua:132: in function '_run_spec'
...al/share/nvim/lazy/neotest/lua/neotest/client/runner.lua:89: in function <...al/share/nvim/lazy/neotest/lua/neotest/client/runner.lua:88>
I don't think I did anything different, I just updated the name of the form in my test.lua
file:
test.lua
return {
{
"nvim-neotest/neotest",
dependencies = {
"V13Axel/neotest-pest", -- changed this from theutz/neotest-pest
},
config = function()
require("neotest").setup({
adapters = {
require("neotest-pest"),
},
})
end,
},
}
Anyone have any ideas as to what the problem might be? If I switch back to theutz
's version, everything works.
One thing I noticed is that the plugin checks for the existence of vendor/bin/sail
and if it's there, assumes Sail should be enabled. AFAIK, Sail is included with every Laravel app, whether you use it or not (it's in my vendor/bin
folder but I do not use it) and so that check may need to be more robust? Not sure if that has anything to do with this, just saw the note in the README that says:
Which kind of feels like it's applicable here. I tried manually setting sail_enabled = false
in the require("neotest-pest")
config options, but that didn't seem to have an effect.
Apologies for the somewhat light bug report, I've just setup this fork after finding in the other neotest-pest
repo - the setup went quite smoothly though when looking to run tests I'm getting a Docker is not running.
error. I'm a bit new to testing in Neovim so maybe this is outside the bounds of this plugin but any help would be appreciated!
Running tests through the artisan cli seems to work just fine. Also I see you've added support for Sail, in this particular instance I am running Herd as opposed to Sail for my dev environment.
Anyway, thanks much for taking on the maintenance burden of this plugin!
Ok, I'm still fairly new to Neovim so I'm not sure how to provide more details but happy to give anything that's missing here if you can explain how, but the gist of the situation is: I just started working on some PHP this evening (I haven't in maybe a week or two?) and when I went to run my usual keymap, Neotest does not run (at least visibly) but something happens in the background that Neovim ends up absolutely dog slow for about 30 seconds.
I'm not sure what could have happened and I definitely haven't been messing with my Neovim config for at least a month so aside from updating my plugins, I'm not sure what I could have done to break things.
I'm running Neovim 0.9.5 and here is the output from :checkhealth
. Nothing about it seems odd, but there's also nothing about neotest
in there so I'm not sure if that should alarming.
==============================================================================
floaterm: require("floaterm.health").check()
common ~
- Platform: Darwin
- Nvim: NVIM v0.9.5
- Plugin: fatal: not a git repository (or any of the parent directories): .git
terminal ~
- OK Terminal emulator is available
floating ~
- OK Floating window is available
==============================================================================
laravel: require("laravel.health").check()
Laravel ~
External Dependencies ~
- OK rg installed
Plugin Dependencies ~
- OK Null LS is installed
- OK luasnip is installed
- OK Nui is installed
- OK Telescope is installed
Environment ~
- OK Environment setup successful
- Name: local
- Condition:
- {
executable = { "php" }
}
- Commands:
- {}
Composer Dependencies ~
- OK Composer dependency `laravel/tinker` is installed
==============================================================================
lazy: require("lazy.health").check()
lazy.nvim ~
- OK Git installed
- OK no existing packages found by other package managers
- OK packer_compiled.lua not found
- WARNING {flash.nvim}: unknown key <vscode>
- WARNING {neo-tree.nvim}: overriding <config>
- WARNING {telescope-fzf-native.nvim}: overriding <config>
- WARNING {vim-projectionist}: unknown key <requires>
==============================================================================
lazyvim: require("lazyvim.health").check()
LazyVim ~
- OK Using Neovim >= 0.9.0
- OK `git` is installed
- OK `rg` is installed
- OK `fd` is installed
- OK `lazygit` is installed
==============================================================================
luasnip: require("luasnip.health").check()
luasnip ~
- OK jsregexp is installed
==============================================================================
mason: require("mason.health").check()
mason.nvim ~
- OK mason.nvim version v1.10.0
- OK PATH: prepend
- OK Providers:
mason.providers.registry-api
mason.providers.client
- OK neovim version >= 0.7.0
mason.nvim [Registries] ~
- OK Registry `github.com/mason-org/mason-registry version: 2024-05-04-smart-gaze` is installed.
mason.nvim [Core utils] ~
- OK unzip: `UnZip 6.00 of 20 April 2009, by Info-ZIP. Maintained by C. Spieler. Send`
- OK wget: `GNU Wget 1.24.5 built on darwin23.2.0.`
- OK curl: `curl 8.4.0 (x86_64-apple-darwin23.0) libcurl/8.4.0 (SecureTransport) LibreSSL/3.3.6 zlib/1.2.12 nghttp2/1.58.0`
- OK gzip: `Apple gzip 430.100.5`
- OK tar: `bsdtar 3.5.3 - libarchive 3.5.3 zlib/1.2.12 liblzma/5.4.3 bz2lib/1.0.8 `
- OK bash: `GNU bash, version 3.2.57(1)-release (arm64-apple-darwin23)`
- OK sh: `Ok`
mason.nvim [Languages] ~
- WARNING luarocks: not available
- ADVICE:
- spawn: luarocks failed with exit code - and signal -. luarocks is not executable
- OK Ruby: `ruby 2.6.10p210 (2022-04-12 revision 67958) [universal.arm64e-darwin23]`
- OK PHP: `PHP 8.3.6 (cli) (built: Apr 12 2024 00:13:56) (NTS)`
- OK Composer: `Composer version 2.7.1 2024-02-09 15:26:28`
- OK node: `v21.7.3`
- WARNING javac: not available
- ADVICE:
- spawn: javac failed with exit code 1 and signal 0. The operation couldn’t be completed. Unable to locate a Java Runtime.
Please visit http://www.java.com for information on installing Java.
- WARNING java: not available
- ADVICE:
- spawn: java failed with exit code 1 and signal 0. The operation couldn’t be completed. Unable to locate a Java Runtime.
Please visit http://www.java.com for information on installing Java.
- WARNING julia: not available
- ADVICE:
- spawn: julia failed with exit code - and signal -. julia is not executable
- OK python: `Python 3.12.3`
- OK RubyGem: `3.0.3.1`
- OK Go: `go version go1.22.2 darwin/arm64`
- OK npm: `10.5.0`
- OK cargo: `cargo 1.77.2`
- OK pip: `pip 24.0 from /opt/homebrew/lib/python3.12/site-packages/pip (python 3.12)`
- OK python venv: `Ok`
mason.nvim [GitHub] ~
- OK GitHub API rate limit. Used: 0. Remaining: 60. Limit: 60. Reset: Sat 4 May 21:36:06 2024.
Install and authenticate via gh-cli to increase rate limit.
==============================================================================
neoconf: require("neoconf.health").check()
neoconf.nvim ~
- OK **treesitter-nvim** is installed
- WARNING **TreeSitter jsonc** parser is not installed. Highlighting of jsonc files might be broken
- OK **neodev.nvim** is installed
- OK **lspconfig** is installed
- OK **lspconfig jsonls** is installed
- OK **lspconfig lua_ls** is installed
==============================================================================
noice: require("noice.health").check()
noice.nvim ~
- OK **Neovim** >= 0.8.0
- OK You're using a GUI that should work ok
- OK **vim.go.lazyredraw** is not enabled
- OK **nvim-notify** is installed
- OK **TreeSitter vim** parser is installed
- OK **TreeSitter regex** parser is installed
- OK **TreeSitter lua** parser is installed
- OK **TreeSitter bash** parser is installed
- OK **TreeSitter markdown** parser is installed
- OK **TreeSitter markdown_inline** parser is installed
- OK `vim.notify` is set to **Noice**
- OK `vim.lsp.handlers["textDocument/hover"]` is set to **Noice**
- OK `vim.lsp.handlers["textDocument/signatureHelp"]` is set to **Noice**
- OK `vim.lsp.handlers["window/showMessage"]` is set to **Noice**
- OK `vim.lsp.util.convert_input_to_markdown_lines` is set to **Noice**
- OK `vim.lsp.util.stylize_markdown` is set to **Noice**
- OK `cmp.entry.get_documentation` is set to **Noice**
==============================================================================
null-ls: require("null-ls.health").check()
- OK black: the command "black" is executable.
- OK prettier: the command "prettier" is executable.
- OK hadolint: the command "hadolint" is executable.
- OK markdownlint: the command "markdownlint" is executable.
- ERROR terraform_fmt: the command "terraform" is not executable.
- ERROR terraform_validate: the command "terraform" is not executable.
- ERROR fish_indent: the command "fish_indent" is not executable.
- ERROR fish: the command "fish" is not executable.
- OK stylua: the command "stylua" is executable.
- OK shfmt: the command "shfmt" is executable.
- ERROR gomodifytags: the source "gomodifytags" cannot be ran.
- ERROR impl: the source "impl" cannot be ran.
- ERROR goimports: the command "goimports" is not executable.
- ERROR gofumpt: the command "gofumpt" is not executable.
- Laravel_completion: cannot verify if the command is an executable.
- Laravel_Diagnostics: cannot verify if the command is an executable.
- Laravel_CodeAction: cannot verify if the command is an executable.
==============================================================================
nvim: require("nvim.health").check()
Configuration ~
- OK no issues found
Runtime ~
- OK $VIMRUNTIME: /opt/homebrew/Cellar/neovim/0.9.5/share/nvim/runtime
Performance ~
- OK Build type: Release
Remote Plugins ~
- OK Up to date
terminal ~
- key_backspace (kbs) terminfo entry: `key_backspace=^H`
- key_dc (kdch1) terminfo entry: `key_dc=\E[3~`
- $TERM_PROGRAM="tmux"
- $COLORTERM="truecolor"
tmux ~
- OK escape-time: 0
- OK focus-events: on
- $TERM: xterm-256color
- ERROR $TERM should be "screen-256color" or "tmux-256color" in tmux. Colors might look wrong.
- ADVICE:
- Set default-terminal in ~/.tmux.conf:
set-option -g default-terminal "screen-256color"
- https://github.com/neovim/neovim/wiki/Building-Neovim#optimized-builds
==============================================================================
nvim-treesitter: require("nvim-treesitter.health").check()
Installation ~
- OK `tree-sitter` found 0.22.5 (parser generator, only needed for :TSInstallFromGrammar)
- OK `node` found v21.7.3 (only needed for :TSInstallFromGrammar)
- OK `git` executable found.
- OK `cc` executable found. Selected from { vim.NIL, "cc", "gcc", "clang", "cl", "zig" }
Version: Apple clang version 15.0.0 (clang-1500.3.9.4)
- OK Neovim was compiled with tree-sitter runtime ABI version 14 (required >=13). Parsers must be compatible with runtime ABI.
OS Info:
{
machine = "arm64",
release = "23.4.0",
sysname = "Darwin",
version = "Darwin Kernel Version 23.4.0: Fri Mar 15 00:12:41 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T8103"
} ~
Parser/Features H L F I J
- bash ✓ ✓ ✓ . ✓
- c ✓ ✓ ✓ ✓ ✓
- html ✓ ✓ ✓ ✓ ✓
- javascript ✓ ✓ ✓ ✓ ✓
- json ✓ ✓ ✓ ✓ .
- lua ✓ ✓ ✓ ✓ ✓
- markdown ✓ . ✓ ✓ ✓
- markdown_inline ✓ . . . ✓
- php ✓ ✓ ✓ ✓ ✓
- python ✓ ✓ ✓ ✓ ✓
- query ✓ ✓ ✓ ✓ ✓
- regex ✓ . . . .
- tsx ✓ ✓ ✓ ✓ ✓
- typescript ✓ ✓ ✓ ✓ ✓
- vim ✓ ✓ ✓ . ✓
- vimdoc x . . . ✓
- vue ✓ . ✓ ✓ ✓
- yaml ✓ ✓ ✓ ✓ ✓
Legend: H[ighlight], L[ocals], F[olds], I[ndents], In[j]ections
+) multiple parsers found, only one will be used
x) errors found in the query, try to run :TSUpdate {lang} ~
The following errors have been detected: ~
- ERROR vimdoc(highlights): ...im/0.9.5/share/nvim/runtime/lua/vim/treesitter/query.lua:259: query: invalid node type at position 749 for language vimdoc
vimdoc(highlights) is concatenated from the following files:
| [ERROR]:"/Users/nexxai/.local/share/nvim/lazy/nvim-treesitter/queries/vimdoc/highlights.scm", failed to load: ...im/0.9.5/share/nvim/runtime/lua/vim/treesitter/query.lua:259: query: invalid node type at position 749 for language vimdoc
==============================================================================
phpactor: health#phpactor#check
Info ~
- Phpactor version: ac99b4d8 (3 days ago) Fix-one-more-missing-PHP_BINARY-2650
- PHP version: 8.2
- Filesystemsgit, simple, composer
- Working directory/Users/nexxai/code/flash
Diagnostics ~
- OK XDebug is disabled. XDebug has a negative effect on performance.
- OK Git detected - enables faster refactorings in your repository scope!
- OK Composer detected - Phpactor could work faster without an index
Config files (missing is not bad) ~
- WARNING /Users/nexxai/.config/phpactor/phpactor.json
- WARNING /Users/nexxai/.config/phpactor/phpactor.yml
- WARNING /Users/nexxai/code/flash/.phpactor.json
- WARNING /Users/nexxai/code/flash/.phpactor.yml
==============================================================================
provider: health#provider#check
Clipboard (optional) ~
- OK Clipboard tool found: pbcopy
Python 3 provider (optional) ~
- WARNING No Python executable found that can `import neovim`. Using the first available executable for diagnostics.
- WARNING Could not load Python 3:
/opt/homebrew/bin/python3 does not have the "neovim" module.
/opt/homebrew/bin/python3.12 does not have the "neovim" module.
/opt/homebrew/bin/python3.11 does not have the "neovim" module.
python3.10 not found in search path or not executable.
python3.9 not found in search path or not executable.
python3.8 not found in search path or not executable.
python3.7 not found in search path or not executable.
python not found in search path or not executable.
- ADVICE:
- See :help |provider-python| for more information.
- You may disable this provider (and warning) by adding `let g:loaded_python3_provider = 0` to your init.vim
- Executable: Not found
Python virtualenv ~
- OK no $VIRTUAL_ENV
Ruby provider (optional) ~
- Ruby: ruby 2.6.10p210 (2022-04-12 revision 67958) [universal.arm64e-darwin23]
- WARNING `neovim-ruby-host` not found.
- ADVICE:
- Run `gem install neovim` to ensure the neovim RubyGem is installed.
- Run `gem environment` to ensure the gem bin directory is in $PATH.
- If you are using rvm/rbenv/chruby, try "rehashing".
- See :help |g:ruby_host_prog| for non-standard gem installations.
- You may disable this provider (and warning) by adding `let g:loaded_ruby_provider = 0` to your init.vim
Node.js provider (optional) ~
- Node.js: v21.7.3
- WARNING Missing "neovim" npm (or yarn, pnpm) package.
- ADVICE:
- Run in shell: npm install -g neovim
- Run in shell (if you use yarn): yarn global add neovim
- Run in shell (if you use pnpm): pnpm install -g neovim
- You may disable this provider (and warning) by adding `let g:loaded_node_provider = 0` to your init.vim
Perl provider (optional) ~
- WARNING "Neovim::Ext" cpan module is not installed
- ADVICE:
- See :help |provider-perl| for more information.
- You may disable this provider (and warning) by adding `let g:loaded_perl_provider = 0` to your init.vim
==============================================================================
telescope: require("telescope.health").check()
Checking for required plugins ~
- OK plenary installed.
- OK nvim-treesitter installed.
Checking external dependencies ~
- OK rg: found ripgrep 14.1.0
- OK fd: found fd 9.0.0
===== Installed extensions ===== ~
Telescope Extension: `fzf` ~
- OK lib working as expected
- OK file_sorter correctly configured
- OK generic_sorter correctly configured
Telescope Extension: `laravel` ~
- No healthcheck provided
Telescope Extension: `notify` ~
- No healthcheck provided
Telescope Extension: `terraform` ~
- No healthcheck provided
Telescope Extension: `terraform_doc` ~
- No healthcheck provided
==============================================================================
vim.lsp: require("vim.lsp.health").check()
- LSP log level : WARN
- Log path: /Users/nexxai/.local/state/nvim/lsp.log
- Log size: 1829 KB
vim.lsp: Active Clients ~
- null-ls (id=1, root_dir=/Users/nexxai/code/flash)
- tailwindcss (id=2, root_dir=/Users/nexxai/code/flash)
- intelephense (id=3, root_dir=/Users/nexxai/code/flash)
==============================================================================
vim.treesitter: require("vim.treesitter.health").check()
- Nvim runtime ABI version: 14
- OK Parser: bash ABI: 14, path: /Users/nexxai/.local/share/nvim/lazy/nvim-treesitter/parser/bash.so
- OK Parser: html ABI: 14, path: /Users/nexxai/.local/share/nvim/lazy/nvim-treesitter/parser/html.so
- OK Parser: javascript ABI: 14, path: /Users/nexxai/.local/share/nvim/lazy/nvim-treesitter/parser/javascript.so
- OK Parser: json ABI: 14, path: /Users/nexxai/.local/share/nvim/lazy/nvim-treesitter/parser/json.so
- OK Parser: lua ABI: 14, path: /Users/nexxai/.local/share/nvim/lazy/nvim-treesitter/parser/lua.so
- OK Parser: markdown ABI: 14, path: /Users/nexxai/.local/share/nvim/lazy/nvim-treesitter/parser/markdown.so
- OK Parser: markdown_inline ABI: 14, path: /Users/nexxai/.local/share/nvim/lazy/nvim-treesitter/parser/markdown_inline.so
- OK Parser: php ABI: 14, path: /Users/nexxai/.local/share/nvim/lazy/nvim-treesitter/parser/php.so
- OK Parser: python ABI: 14, path: /Users/nexxai/.local/share/nvim/lazy/nvim-treesitter/parser/python.so
- OK Parser: query ABI: 14, path: /Users/nexxai/.local/share/nvim/lazy/nvim-treesitter/parser/query.so
- OK Parser: regex ABI: 14, path: /Users/nexxai/.local/share/nvim/lazy/nvim-treesitter/parser/regex.so
- OK Parser: tsx ABI: 14, path: /Users/nexxai/.local/share/nvim/lazy/nvim-treesitter/parser/tsx.so
- OK Parser: typescript ABI: 14, path: /Users/nexxai/.local/share/nvim/lazy/nvim-treesitter/parser/typescript.so
- OK Parser: vim ABI: 14, path: /Users/nexxai/.local/share/nvim/lazy/nvim-treesitter/parser/vim.so
- OK Parser: vue ABI: 14, path: /Users/nexxai/.local/share/nvim/lazy/nvim-treesitter/parser/vue.so
- OK Parser: yaml ABI: 14, path: /Users/nexxai/.local/share/nvim/lazy/nvim-treesitter/parser/yaml.so
- OK Parser: c ABI: 14, path: /opt/homebrew/Cellar/neovim/0.9.5/lib/nvim/parser/c.so
- OK Parser: lua ABI: 14, path: /opt/homebrew/Cellar/neovim/0.9.5/lib/nvim/parser/lua.so
- OK Parser: query ABI: 14, path: /opt/homebrew/Cellar/neovim/0.9.5/lib/nvim/parser/query.so
- OK Parser: vim ABI: 14, path: /opt/homebrew/Cellar/neovim/0.9.5/lib/nvim/parser/vim.so
- OK Parser: vimdoc ABI: 14, path: /opt/homebrew/Cellar/neovim/0.9.5/lib/nvim/parser/vimdoc.so
==============================================================================
vimtex: health#vimtex#check
VimTeX ~
- OK Vim version should have full support!
- WARNING bibtex is not executable!
- ADVICE:
- bibtex is required for cite completions.
- WARNING biber is not executable!
- ADVICE:
- Biber is often required so this may give unexpected problems.
- OK General viewer should work properly!
- ERROR |g:vimtex_compiler_method| (`latexmk`) is not executable!
This is my loading of neotest, maybe there's something obvious there, but I haven't changed anything in here in months.
vim.keymap.set("n", "<leader>t", "function() require('neotest').run.run() end")
vim.keymap.set("n", "<leader>tt", "function() require('neotest').run.run(vim.fn.expand('%')) end")
vim.keymap.set("n", "<leader>tf", function()
require("neotest").run.run({ suite = true })
end)
vim.keymap.set("n", "<leader>ts", "function() require('neotest').summary.open() end")
return {
{
"nvim-neotest/neotest",
dependencies = {
"V13Axel/neotest-pest",
"nvim-lua/plenary.nvim",
"antoinemadec/FixCursorHold.nvim",
"nvim-treesitter/nvim-treesitter",
},
config = function()
require("neotest").setup({
adapters = {
require("neotest-pest")({
pest_cmd = function()
return "vendor/bin/pest"
end,
sail_enabled = function()
return false
end,
}),
},
})
end,
},
}
If anyone could give me a hand, I would greatly appreciate it.
Hey, I just installed the latest version of AstroNvim (which does support neotest on its community packages using Lazy).
I just overwrote the plugin like this:
All of a sudden, it does not work properly and gives this output:
I've saw the issue #5 with similar problems, but those did not work for me.
can I at least get a hint of what could be causing that to pop up?
If a test has ->with(), it technically changes into multiple tests. As such, passes are detected as failures:
I'm guessing it's because the test ID(s) rely on the string passed to it()
or test()
, and expect that 1 it()
or test()
=== 1 test. When using datasets, that's not the case. Hrm.
Will need to chew on how to actually handle that in the context of this adapter.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.