nvim-neotest / neotest

An extensible framework for interacting with tests within NeoVim.
MIT License
2.13k stars 105 forks source link

New Adapter: Julia #364

Open Qfl3x opened 5 months ago

Qfl3x commented 5 months ago

Hello, I'd like to create a Julia Test adapter. I'm kinda new so some help would be nice.

Running tests in Julia is simple for the most part, I'll try to describe it as thoroughly as possible;

We first need to find the root project, -> In Julia: No Project = No tests; Tests are essentially undefined for orphan scripts, tests will always try to find an environment to "containerize" and will fail if not found; While it is possible to test such scripts, it is a pain and is not recommended.

The project has a specific file structure: What matters to us is :

Tests are ran simply from a test/runtests.jl file, this file is then ran by the Test Runner; Some notes:

Some people also run their tests in an orphaned way, outside of functions and then just include the file in runtests.jl

The Package/Project tested via: julia --project -e "using Pkg; Pkg.test()" And yes, --project is usually quite smart and will probably find the project no matter where you are inside the file tree.