-
-
Notifications
You must be signed in to change notification settings - Fork 388
Run plugins' test suites with server in the same process #1628
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
8832014
Run plugins' test suites with server in the same process
berberman 90c5187
Use async
berberman 39569a7
Update CI
berberman 847b4fc
Add rts options
berberman 478fa77
Sleep 0.5s after running a session
berberman 88d340a
Update CI
berberman c711388
Don't use withAsync
berberman b40d923
Add timeout
berberman e1e57d0
Cancel the server action when timeout
berberman e2d93ef
Fix cwd
berberman ecc89c0
Close input stream manually, add a lock
berberman ee3df16
cleanup
berberman 47c936d
tactics plugin
berberman b354ac4
Remove sleep
berberman dcf22de
Merge branch 'master' of github.com:haskell/haskell-language-server i…
berberman 8119d1a
Merge branch 'master' into plugin-tests2
berberman 5e09950
Merge branch 'master' into plugin-tests2
berberman 57e87e5
Merge branch 'master' into plugin-tests2
jneira bd16a94
Merge branch 'master' into plugin-tests2
berberman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,48 @@ | ||
cabal-version: 2.4 | ||
name: hls-brittany-plugin | ||
version: 1.0.0.0 | ||
synopsis: Integration with the Brittany code formatter | ||
description: Please see the README on GitHub at <https://github.com/haskell/haskell-language-server#readme> | ||
license: Apache-2.0 | ||
license-file: LICENSE | ||
author: The Haskell IDE Team | ||
copyright: The Haskell IDE Team | ||
maintainer: [email protected] | ||
category: Development | ||
build-type: Simple | ||
cabal-version: 2.4 | ||
name: hls-brittany-plugin | ||
version: 1.0.0.0 | ||
synopsis: Integration with the Brittany code formatter | ||
description: | ||
Please see the README on GitHub at <https://github.com/haskell/haskell-language-server#readme> | ||
|
||
license: Apache-2.0 | ||
license-file: LICENSE | ||
author: The Haskell IDE Team | ||
copyright: The Haskell IDE Team | ||
maintainer: [email protected] | ||
category: Development | ||
build-type: Simple | ||
extra-source-files: | ||
LICENSE | ||
test/testdata/**/*.hs | ||
|
||
library | ||
exposed-modules: Ide.Plugin.Brittany | ||
hs-source-dirs: src | ||
build-depends: base >=4.12 && <5 | ||
, brittany >= 0.13.1.0 | ||
, filepath | ||
, ghc | ||
, ghc-boot-th | ||
, ghcide ^>= 1.1.0.0 | ||
, lsp-types | ||
, hls-plugin-api >= 1.0 && < 1.2 | ||
, lens | ||
, text | ||
, transformers | ||
build-depends: | ||
, base >=4.12 && <5 | ||
, brittany >=0.13.1.0 | ||
, filepath | ||
, ghc | ||
, ghc-boot-th | ||
, ghcide ^>=1.1.0.0 | ||
, hls-plugin-api >=1.0 && <1.2 | ||
, lens | ||
, lsp-types | ||
, text | ||
, transformers | ||
|
||
default-language: Haskell2010 | ||
|
||
executable test-server | ||
default-language: Haskell2010 | ||
build-depends: | ||
, base | ||
, data-default | ||
, ghcide | ||
, hls-brittany-plugin | ||
, hls-plugin-api | ||
, shake | ||
main-is: Server.hs | ||
hs-source-dirs: test | ||
ghc-options: -threaded | ||
|
||
test-suite tests | ||
type: exitcode-stdio-1.0 | ||
default-language: Haskell2010 | ||
build-tool-depends: | ||
hls-brittany-plugin:test-server -any, | ||
hs-source-dirs: test | ||
main-is: Main.hs | ||
type: exitcode-stdio-1.0 | ||
default-language: Haskell2010 | ||
hs-source-dirs: test | ||
main-is: Main.hs | ||
ghc-options: -threaded -rtsopts -with-rtsopts=-N | ||
build-depends: | ||
, base | ||
, bytestring | ||
, hls-brittany-plugin | ||
, text | ||
, hls-test-utils | ||
, text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean that we can no longer use
LSP_TEST_LOG_STDERR=1
to get more info about a failing test, since silencing stderr is now hard coded?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
//cc @berberman
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I attempted this for all the ghcide testsuite, I installed a logger that sends output to the LSP channel.
https://github.com/haskell/haskell-language-server/pull/1752/files?file-filters%5B%5D=.hs&file-filters%5B%5D=.project#diff-46837fe41900682e7ad33f73eee0194cde2e864e3aebd7775d412660b61029fcR1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could probably check for the environment variable manually and pretend that it was lsp-test that did it, to minimize disturbance of people's workflows.
(Here's lsp-test's code for it: https://github.com/haskell/lsp/blob/e707cbf5ca7077f70884ae0d2a8d016aa30ced5a/lsp-test/src/Language/LSP/Test.hs#L267-L275)
That way the current uses, like in ci doesn't have to change. Regardless of what we do, it should probably be documented together with the
LSP_TEST_LOG_MESSAGES
env variable in the contributing section, which it is currently not.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree, pr's welcome!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, output from lsp server is completely removed in test suites which use this function since that change, because there were too many logs were printed not through the logger, but were directly written to stderr, messing up testing status. So setting environment variable LSP_TEST_LOG_MESSAGES actually won't work. However, this function is a temporary workaround, and we should cleanup such code in server.