rikvdkleij / intellij-haskell

IntelliJ plugin for Haskell
https://rikvdkleij.github.io/intellij-haskell/
Apache License 2.0
1.31k stars 96 forks source link

Multi packages configuration with tests in more than one #608

Closed nhenin closed 3 years ago

nhenin commented 3 years ago

Hi, I have a multi packages configuration and I have tests now in more than one package...

when working on a test you are running the following command in background :

stack repl dolla-consensus-base:test:test dolla-consensus-proposing-flushing:test:dolla-consensus-proposing-flushing-test --no-build --ghci-options -ghci-script=/Users/nhenin/Library/Caches/com.github.rikvdkleij.intellij-haskell/repl.ghci  --ghc-options -v1 --test

I have the following that is silently happening behind and that blocks the feedback from your pluging :

* * * * * * * *
The main module to load is ambiguous. Candidates are:
1. Package `dolla-consensus-base' component dolla-consensus-base:test:test with main-is file: /Users/nhenin/dev/dolla/consensus-base/test/Spec.hs
2. Package `dolla-consensus-proposing-flushing' component dolla-consensus-proposing-flushing:test:dolla-consensus-proposing-flushing-test with main-is file: /Users/nhenin/dev/dolla/consensus-proposer/packages/flushing/test/Spec.hs
You can specify which one to pick by:
 * Specifying targets to stack ghci e.g. stack ghci dolla-consensus-base:test:test
 * Specifying what the main is e.g. stack ghci --main-is dolla-consensus-base:test:test
 * Choosing from the candidate above [1..2]
* * * * * * * *

In the console I'm using this command : stack test --fast --file-watch

How can run it properly ?

nhenin commented 3 years ago

Actually dolla-consensus-base' is a dependency ofdolla-consensus-proposing-flushing' is can help you...

rikvdkleij commented 3 years ago

Thanks for reporting!

Some versions ago I changed the plugin of having one REPL per target to a REPL per target type. I have to make it some smarter to prevent your case by checking if there is a main defined in stanza or back again to one REPL per target for test targets.

rikvdkleij commented 3 years ago

How can run it properly ?

So I have fix this in the plugin.

nhenin commented 3 years ago

you mean "I have to fix it" or "I have fixed it" ? The only thing I can do now to use your plugin is disabling all the tests executables except one .... is it a substantial modification to be done ?

rikvdkleij commented 3 years ago

I mean, I have to fix this.

is it a substantial modification to be done ?

Sorry, no, no other way.

rikvdkleij commented 3 years ago

@nhenin Should be fixed in beta80 https://github.com/rikvdkleij/intellij-haskell/releases/tag/v1.0.0-beta80

nhenin commented 3 years ago

You made my day man ! :-) It's solved ! Your reactivity is really appreciated on my side :-)

rikvdkleij commented 3 years ago

Great to hear!