]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/vim-lsp-ale/test/README.md

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Merge commit 'd49e95aa7ba744f0a7f544aca43afdb6aab41f24' as '.vim/bundle/asyncomplete...
[etc/vim.git] / .vim / bundle / vim-lsp-ale / test / README.md
1 Tests
2 =====
3
4 ## Directory structure
5
6 - [`test/unit`](./unit): Unit tests
7   - [`test/unit/test.vimspec`](./unit/test.vimspec): Unit test cases
8   - [`test/unit/runtime`](./unit/runtime): Runtime directory loaded on running unit tests. They mocks several external APIs like `ale#*` or `lsp#*`
9 - [`test/integ`](./integ): Integration tests
10   - [`test/integ/test.vimspec`](./integ/test.vimspec): Integration test cases
11   - [`test/integ/deps`](./integ/deps): Dependant plugins
12
13 ## Unit tests
14
15 Unit tests confirm vim-lsp-ale works as intended.
16
17 ### Prerequisites
18
19 Unit tests can be run with no dependency because they mock every external API.
20
21 [vim-themis](https://github.com/thinca/vim-themis) is used as test runner.
22
23 By default, it runs tests with `vim` command. When running tests with Neovim, set `THEMIS_VIM=nvim` environment variable.
24
25 ### Run unit tests
26
27 ```sh
28 cd path/to/vim-lsp-ale
29 git clone https://github.com/thinca/vim-themis.git
30
31 # Run tests with Vim
32 ./vim-themis/bin/themis ./test/unit/
33
34 # Run tests with NeoVim
35 THEMIS_VIM=nvim ./vim-themis/bin/themis ./test/unit/
36 ```
37
38 ### Measure unit test coverage
39
40 [covimerage](https://github.com/Vimjas/covimerage) is used to measure test coverage. Install it by `pip install covimerage`.
41
42 Set a file path to `THEMIS_PROFILE` environment variable and run unit tests. Vim will store the profile data to the file.
43 `covimerage` command will convert the profile data into coverage data for `coverage` command provided by Python.
44
45 ```sh
46 cd path/to/vim-lsp-ale
47 git clone https://github.com/thinca/vim-themis.git
48
49 # Run test case with $THEMIS_PROFILE environment variable
50 THEMIS_PROFILE=profile.txt ./vim-themis/bin/themis ./test/unit
51
52 # Store coverage data at .coverage_covimerage converted from the profile data
53 covimerage write_coverage profile.txt
54
55 # Show coverage report by `coverage` command
56 coverage report
57 ```
58
59 ## Integration tests
60
61 Integration tests confirm integrity among vim-lsp, ALE, vim-lsp-ale and a language server.
62
63 ### Prerequisites
64
65 Integration tests require all dependencies are installed in [deps](./integ/deps) directory.
66
67 ```sh
68 cd path/to/vim-lsp-ale
69 git clone https://github.com/prabirshrestha/vim-lsp.git test/integ/deps/vim-lsp
70 git clone https://github.com/dense-analysis/ale.git test/integ/deps/ale
71 ```
72
73 [rust-analyzer](https://rust-analyzer.github.io/) is used as language server to run integration tests.
74 Download the binary following [the instruction](https://rust-analyzer.github.io/manual.html#rust-analyzer-language-server-binary)
75 and put the binary in `$PATH` directory.
76
77 And [vim-themis](https://github.com/thinca/vim-themis) is used as test runner.
78
79 Note that integration tests were not confirmed on Windows.
80
81 ### Run integration tests
82
83 ```sh
84 cd path/to/vim-lsp-ale
85 git clone https://github.com/thinca/vim-themis.git
86 ./vim-themis/bin/themis ./test/integ/
87 ```
88
89 ### Log files
90
91 When some integration tests fail, the following log files would be useful to investigate the failure.
92
93 - `test/integ/integ_messages.txt`: Messages in `:message` area while running the tests
94 - `test/integ/lsp-log.txt`: Log information of vim-lsp. It records communications between vim-lsp and a language server
95
96 ## CI
97
98 Tests are run continuously on GitHub Actions.
99
100 https://github.com/rhysd/vim-lsp-ale/actions?query=workflow%3ACI
101
102 - Unit tests are run on Linux, macOS and Windows with Vim and Neovim
103 - Integration tests are run on Linux with Vim and Neovim