Skip to content

Commit

Permalink
docs: general cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrikaverpil committed Jun 29, 2024
1 parent 5dbd763 commit ba45b9e
Showing 1 changed file with 27 additions and 51 deletions.
78 changes: 27 additions & 51 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,70 +1,46 @@
# neotest-golang

A Neotest adapter for running Go tests.
Reliable Neotest adapter for running Go tests in Neovim.

<img width="1528" alt="neotest-golang" src="https://github.com/fredrikaverpil/neotest-golang/assets/994357/4f6e1fa6-2274-42e6-ba94-9a205061e5de">

## ⭐️ Features

- Supports all [Neotest usage](https://github.com/nvim-neotest/neotest#usage).
- Integrates with [nvim-dap-go](https://github.com/leoluz/nvim-dap-go) for
debugging of tests using delve.
- Supports table tests and nested test functions (based on AST/tree-sitter
detection).
- DAP support with [nvim-dap-go](https://github.com/leoluz/nvim-dap-go)
integration for debugging of tests using
[delve](https://github.com/go-delve/delve).
- Monorepo support (detect, run and debug tests in sub-projects).
- Inline diagnostics.
- Custom `go test` argument support.
- Works great with
[andythigpen/nvim-coverage](https://github.com/andythigpen/nvim-coverage) for
displaying coverage in the sign column (per-Go package, or per-test basis).
- Monorepo support (detect, run and debug tests in sub-projects).
- Supports table tests (relies on treesitter AST detection).
- Supports nested test functions.

## 🚧 Work in progress

This Neotest adapter is under heavy development and I'm dogfooding myself with
this project on a daily basis, as full-time Go developer.

My next focus areas:

- [ ] Refactoring, polish and the addition of tests.
- [ ] Documentation around expanding new syntax support for table tests via AST
parsing.
- [ ] Add debug logging:
[neotest#422](https://github.com/nvim-neotest/neotest/discussions/422)
- [ ] Investigate ways to speed up test execution when executing tests in a
file.

## 🏓 Background
<details>
<summary>Why a second Neotest adapter for Go? 🤔</summary>

I've been using Neovim and Neotest with
[neotest-go](https://github.com/nvim-neotest/neotest-go) but I have stumbled
upon many problems which seem difficult to solve in the neotest-go codebase.
While using [neotest-go](https://github.com/nvim-neotest/neotest-go) I stumbled
upon many problems which seemed difficult to solve in that codebase.

I have full respect for the time and efforts put in by the developer(s) of
neotest-go. I do not aim in any way to diminish their needs or efforts.

However, I would like to see if, by building a Go adapter for Neotest from
scratch, if I can mitigate the issues I have found with neotest-go.

### Neotest-go issues mitigated in neotest-golang

- Test Output in JSON, making it difficult to read:
[neotest-go#52](https://github.com/nvim-neotest/neotest-go/issues/52)
- "Run nearest" runs all tests:
[neotest-go#83](https://github.com/nvim-neotest/neotest-go/issues/83)
- Running test suite doesn't work:
[neotest-go#89](https://github.com/nvim-neotest/neotest-go/issues/89)
- Diagnostics for table tests on the line of failure:
[neotest-go#75](https://github.com/nvim-neotest/neotest-go/issues/75)
- Support for Nested Subtests:
[neotest-go#74](https://github.com/nvim-neotest/neotest-go/issues/74)
- DAP support:
[neotest-go#12](https://github.com/nvim-neotest/neotest-go/issues/12)

### Upstream/dependency issues found during development

- Test output is printed undesirably:
[neotest#391](https://github.com/nvim-neotest/neotest/issues/391). This is
currently mitigated in neotest-golang by reading the neotest-written test
output file on disk, parsing it and then erasing its contents.
neotest-go. I do not aim in any way to diminish their needs or efforts. However,
I wanted to see if I could fix these issues by diving into the 🕳️🐇 of Neotest
and building my own adapter. Below is a list of neotest-go issues which are not
present in neotest-golang (this project):

| Neotest-go issue | URL |
| -------------------------------------------------- | --------------------------------------------------------------------- |
| Test Output in JSON, making it difficult to read | [neotest-go#52](https://github.com/nvim-neotest/neotest-go/issues/52) |
| "Run nearest" runs all tests | [neotest-go#83](https://github.com/nvim-neotest/neotest-go/issues/83) |
| Running test suite doesn't work | [neotest-go#89](https://github.com/nvim-neotest/neotest-go/issues/89) |
| Diagnostics for table tests on the line of failure | [neotest-go#75](https://github.com/nvim-neotest/neotest-go/issues/75) |
| Support for Nested Subtests | [neotest-go#74](https://github.com/nvim-neotest/neotest-go/issues/74) |
| DAP support | [neotest-go#12](https://github.com/nvim-neotest/neotest-go/issues/12) |

</details>

## 🥸 Installation

Expand Down

0 comments on commit ba45b9e

Please sign in to comment.