|
| 1 | +# The `func-test` test suite. |
| 2 | + |
| 3 | +This is the integration test suite for cross-plugin and cross-package features. |
| 4 | + |
| 5 | +Add integration tests to `func-test` only if they satisfy one or more of the following conditions: |
| 6 | + |
| 7 | +* It tests the interaction between more than one plugin. |
| 8 | + * For example, plugin A provides a Diagnostic that plugin B requires to provide a CodeAction. |
| 9 | + * However, it is also valid, and often preferable, to depend on the required plugin directly in plugin B's test suite. |
| 10 | +* It tests HLS specific LSP code. |
| 11 | + * For example, we test that config changes are appropriately propagated. |
| 12 | + * Note, this is slightly debatable, since the test could also be part of `ghcide`. |
| 13 | + * Non HLS specific LSP code may exist in HLS temporarily, but any LSP extensions should be upstreamed to `lsp`. |
| 14 | +* It tests features of the `haskell-language-server-wrapper` executable. |
| 15 | + * For example, argument parsing. |
| 16 | +* It tests features of the `haskell-language-server` executable. |
| 17 | + * For example, argument parsing. |
| 18 | +* It tests features provided by `hls-plugin-api` that require an integration test (i.e. a unit test doesn't suffice). |
| 19 | + * Example: Testing the Logger setup. |
| 20 | + |
| 21 | +If you think that a test that currently lives in `func-test` does not meet the conditions above, open a ticket for discussion or try to move the test to a better location. |
| 22 | + |
| 23 | +Note: `func-test` is a historical test suite. It was originally written for Haskell IDE Engine, which was merged with the `ghcide` project. |
| 24 | +The integration test-suite `func-test` (back then `unit-test` existed as well) was used to test all kinds of features provided by Haskell IDE Engine (HIE). |
| 25 | +When `ghcide` and HIE merged together, the integration test suite was vastly copied. |
| 26 | +HLS moved to a plugin-based architecture, which mainly entails that plugin tests are isolated in the respective plugin's test suite. |
| 27 | +Over time, `func-test` started to bit rot and wasn't maintained properly any more, since all new tests were added to the plugin or `ghcide` test suites. |
0 commit comments