Skip to content
This repository was archived by the owner on Jan 2, 2021. It is now read-only.

Enable test suite in Windows, marking failing tests as broken - #821

Merged
jneira merged 16 commits into
haskell:masterfrom
jneira:win-tests
Oct 2, 2020
Merged

jneira merged 16 commits into
haskell:masterfrom
jneira:win-tests

Conversation

@jneira

@jneira jneira commented Sep 19, 2020 •

Copy link
Copy Markdown
Member
  • Failing tests are marked with knownBrokenInWindows until they get fixed: see #474
  • Enable test suite in azure
  • It needs a lsp-test hackage release with the fix to avoid hangs in windows (/cc @bubba)

@jneira
jneira requested a review from pepeiborra September 19, 2020 10:07
@jneira jneira changed the title Enable test suite in window, marking failing tests as broken Enable test suite in Windows, marking failing tests as broken Sep 19, 2020

@ndmitchell ndmitchell left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! Would be good to have a ticket tracking the disabled windows tests, so we don't forget them.

Comment thread test/exe/Main.hs Outdated
)
]

pluginParsedResultTests :: TestTree

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth linting about trailing whitespace on lines? Such additional noise in diffs is a pain.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to install the vscode plugin that make it honour the already existing .editorconfig, it removed the existing trailing whitespace

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, super annoying VS Code doesn't do that by default :(

@jneira

jneira commented Sep 19, 2020

Copy link
Copy Markdown
Member Author

yeah, the plan is tracking them in #474

@lukel97

lukel97 commented Sep 19, 2020

Copy link
Copy Markdown
Collaborator

Will make an LSP-test release tonight

@lukel97

lukel97 commented Sep 19, 2020

Copy link
Copy Markdown
Collaborator

lsp-test-0.11.0.6 should be up on hackage now!

@jneira

jneira commented Sep 24, 2020

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Pull request contains merge conflicts.

@jneira

jneira commented Sep 26, 2020 •

Copy link
Copy Markdown
Member Author

In my azure ci, both ghc-8.4.4 (now removed) and ghc-8.6.5 are green for windows and only left 3 failing tests:

  • ghc-8.8.4
2020-09-25T18:21:50.4680024Z   cpp
2020-09-25T18:22:51.5209024Z     cpp-error:                                                                                            FAIL
2020-09-25T18:22:51.5270656Z       Exception: Timed out waiting to receive a message from the server.
2020-09-25T18:22:51.5293862Z       Last message received:
2020-09-25T18:22:51.5308328Z       {
2020-09-25T18:22:51.5399613Z           "tag": "NotLogMessage",
2020-09-25T18:22:51.5402640Z           "contents": {
2020-09-25T18:22:51.5432870Z               "jsonrpc": "2.0",
2020-09-25T18:22:51.5433659Z               "params": {
2020-09-25T18:22:51.5434367Z                   "type": 4,
2020-09-25T18:22:51.5434949Z                   "message": "finish: InitialLoad (took 0.00s)"
2020-09-25T18:22:51.5435548Z               },
2020-09-25T18:22:51.5436241Z               "method": "window/logMessage"
2020-09-25T18:22:51.5436783Z           }
2020-09-25T18:22:51.5437210Z       }
  • ghc-8.10.1
2020-09-29T07:43:19.9957651Z   simple plugin:                                                                                          FAIL (1.85s)
2020-09-29T07:43:19.9999250Z     test/src\Development\IDE\Test.hs:44:
2020-09-29T07:43:20.0177707Z     Could not find (DsError,(8,15),"Variable not in scope: c",Nothing) in List [Diagnostic {_range = Range {_start = Position {_line = 0, _character = 0}, _end = Position {_line = 0, _character = 0}}, _severity = Just DsError, _code = Nothing, _source = Just "typecheck", _message = "Bad interface file: C:\\sr\\snapshots\\5530c14b\\lib\\x86_64-windows-ghc-8.10.1\\ghc-typelits-knownnat-0.7.2-2xmxeOP6eE9BjPxla9bOqw\\GHC\\TypeLits\\KnownNat.hi\n    Something is amiss; requested module  ghc-typelits-knownnat-0.7.2:GHC.TypeLits.KnownNat differs from name found in the interface file pretty-1.1.3.6:GHC.TypeLits.KnownNat (if these names look the same, try again with -dppr-debug)", _tags = Nothing, _relatedInformation = Nothing}]
2020-09-29T07:43:21.9192056Z   parsedResultAction plugin:                                                                              FAIL (1.92s)
2020-09-29T07:43:21.9267431Z     test/src\Development\IDE\Test.hs:78:
2020-09-29T07:43:21.9341835Z     Got unexpected diagnostics for Uri {getUri = "file:///C:/Users/VssAdministrator/AppData/Local/Temp/extra-dir-975077794534/Testing.hs"} got List [Diagnostic {_range = Range {_start = Position {_line = 0, _character = 0}, _end = Position {_line = 0, _character = 0}}, _severity = Just DsError, _code = Nothing, _source = Just "typecheck", _message = "Not in scope:\n  type constructor or class \8216GHC.Records.Extra.HasField\8217\nPerhaps you meant \8216GHC.Records.Extra.HasField\8217 (imported from GHC.Records.Extra)\nModule \8216GHC.Records.Extra\8217 does not export \8216HasField\8217.", _tags = Nothing, _relatedInformation = Nothing}]

@jneira

jneira commented Sep 29, 2020

Copy link
Copy Markdown
Member Author

cpp-error is guarded by knownBrokenInWindows but still fails if it throws an exception 🤔

@jneira

jneira commented Sep 29, 2020 •

Copy link
Copy Markdown
Member Author

I am inclined to run tests only for ghc-8.6.5 (it is the recommended version for windows) until i resolve the remaining errors, cause i would like to focus in other tasks (like hlint plugin).
Other alternative would be ignore the exception for ghc-8.8 and guard ghc-8.10.1 errors with knownBrokenInWindowsForGHC10.
@ndmitchell what do you think about?

@ndmitchell

Copy link
Copy Markdown
Collaborator

I'd be inclined to add knownBrokenInWindowsForGHC10 etc and still run the test suite. In fact, I'd be ok with just slapping knownBrokenForWindows alone on everything that breaks in any Windows. It gives us a good base on which to build.

@jneira

jneira commented Sep 29, 2020

Copy link
Copy Markdown
Member Author
  • ghc-8.8.4
2020-09-29T13:25:00.6956597Z   simple plugin:                                                                                          OK (2.26s)
2020-09-29T13:25:02.1916148Z   parsedResultAction plugin:                                                                              FAIL
2020-09-29T13:25:02.1945675Z     Exception: fd:3: hPutBuf: resource vanished (Broken pipe)
  • ghc-8.10.1
2020-09-29T13:44:32.6150415Z   simple plugin:                                                                                          FAIL
2020-09-29T13:44:32.6179387Z     Exception: fd:3: hPutBuf: resource vanished (Broken pipe)
2020-09-29T13:44:34.2202960Z   parsedResultAction plugin:                                                                              PASS (unexpected: known broken in windows for ghc-8.10) (1.61s)
2020-09-29T13:44:34.2207548Z     (unexpected success: known broken in windows for ghc-8.10)

🤔

@jneira

jneira commented Sep 29, 2020

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@jneira

jneira commented Sep 30, 2020

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@jneira

jneira commented Sep 30, 2020 •

Copy link
Copy Markdown
Member Author

Ok the "parsedResultAction plugin" test is a little bit problematic:

parsedResultAction plugin:                                                                              PASS (unexpected: known broken in windows for ghc-8.10) (1.60s)
    (unexpected success: known broken in windows for ghc-8.10)
  parsedResultAction plugin:                                                                              FAIL (1.56s)
    test/src\Development\IDE\Test.hs:78:
    Got unexpected diagnostics for Uri {getUri = "file:///C:/Users/VssAdministrator/AppData/Local/Temp/extra-dir-635950372603/Testing.hs"} got List [Diagnostic {_range = Range {_start = Position {_line = 0, _character = 0}, _end = Position {_line = 0, _character = 0}}, _severity = Just DsError, _code = Nothing, _source = Just "typecheck", _message = "Not in scope:\n  type constructor or class \8216GHC.Records.Extra.HasField\8217\nPerhaps you meant \8216GHC.Records.Extra.HasField\8217 (imported from GHC.Records.Extra)\nModule \8216GHC.Records.Extra\8217 does not export \8216HasField\8217.", _tags = Nothing, _relatedInformation = Nothing}]

So no way 😟

ghcide/test/exe/Main.hs

Lines 2290 to 2303 in ceb9eb7

pluginParsedResultTests :: TestTree
pluginParsedResultTests =
testSessionWait "parsedResultAction plugin" $ do
let content =
T.unlines
[ "{-# LANGUAGE DuplicateRecordFields, TypeApplications, FlexibleContexts, DataKinds, MultiParamTypeClasses, TypeSynonymInstances, FlexibleInstances #-}"
, "{-# OPTIONS_GHC -fplugin=RecordDotPreprocessor #-}"
, "module Testing (Company(..), display) where"
, "data Company = Company {name :: String}"
, "display :: Company -> String"
, "display c = c.name"
]
_ <- createDoc "Testing.hs" "haskell" content
expectNoMoreDiagnostics 1

@jneira

jneira commented Sep 30, 2020

Copy link
Copy Markdown
Member Author

However, dont know why ghc-8.10.1 throws:

Not in scope:
  type constructor or class GHC.Records.Extra.HasField
Perhaps you meant GHC.Records.Extra.HasField (imported from GHC.Records.Extra)
Module GHC.Records.Extra does not export HasField.

maybe the test only works for ghc-8.10.2? or is it a specific bug for windows?

@ndmitchell

Copy link
Copy Markdown
Collaborator

That HasField one seems super weird. It seems to be saying it's there. I guess its omitting package info? Or we screwed up the package table somehow?

@jneira

jneira commented Sep 30, 2020

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@jneira

jneira commented Sep 30, 2020 •

Copy link
Copy Markdown
Member Author

In my local windows the error with ghc-8.10.1 is

Unexpected usage error
Could not find module RecordDotPreprocessor
Use -v (or `:set -v` in ghci) to see a list of the files searched for.

So i guess to have record-dot-preprocessor is a requirement to run that test. However it is not installed in the azure script. 🤔

After installing record-dot-preprocessor the test passes in my local win 10 consistently 🤷

The ci is green in my pipeline too: https://dev.azure.com/jneira/haskell-language-server/_build?definitionId=4&_a=summary

@jneira

jneira commented Oct 1, 2020

Copy link
Copy Markdown
Member Author

Finally i had to ignore plugin tests for ghc > 8.8.4 (they still are being executed in 8.6.5). They need a more in deep investigation.
I think it could be merged and hopefully handle the ignored tests (only three at the end!) thereafter.
//cc @ndmitchell

@ndmitchell

Copy link
Copy Markdown
Collaborator

Awesome work! My experience is that plugins in GHC on Windows are pretty broken. I actually develop record-dot-preprocessor on Windows, but only test it on Linux, since otherwise things segfault randomly.

@jneira
jneira merged commit df13c5a into haskell:master Oct 2, 2020
pepeiborra pushed a commit to pepeiborra/ide that referenced this pull request Dec 29, 2020
…skell/ghcide#821)

* Enable tests in windows ci

* Use lsp-test-0.11.0.6

* Fix tests in windows

* Use chocolatey to install cabal in ci

* Fix test: type constructor external

* Fix test: non workspace file

* Mark cpp-error as ignored for windows

* Ignore plugin tests for windows
pepeiborra pushed a commit to pepeiborra/ide that referenced this pull request Dec 29, 2020
…skell/ghcide#821)

* Enable tests in windows ci

* Use lsp-test-0.11.0.6

* Fix tests in windows

* Use chocolatey to install cabal in ci

* Fix test: type constructor external

* Fix test: non workspace file

* Mark cpp-error as ignored for windows

* Ignore plugin tests for windows
pepeiborra pushed a commit to pepeiborra/ide that referenced this pull request Dec 29, 2020
…skell/ghcide#821)

* Enable tests in windows ci

* Use lsp-test-0.11.0.6

* Fix tests in windows

* Use chocolatey to install cabal in ci

* Fix test: type constructor external

* Fix test: non workspace file

* Mark cpp-error as ignored for windows

* Ignore plugin tests for windows
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants