atom-elmjutsu icon indicating copy to clipboard operation
atom-elmjutsu copied to clipboard

Elmjutsu doesn't check for errors in tests

Open MartinSStewart opened this issue 6 years ago • 12 comments

Compiler errors in test files aren't not shown. The expected behavior is for Elmjutsu to underline the error in red and list it in a separate tab like it does with Elm files outside of tests.

MartinSStewart avatar Jan 23 '19 19:01 MartinSStewart

Hi, do you have elm-test installed? Elmjutsu uses elm-test to check for compiler errors in test files.

halohalospecial avatar Jan 26 '19 23:01 halohalospecial

Yes, I have "elm-test": "^0.19.0-rev3" installed in my npm packages.

Edit: I also tested upgrading it to rev4. Still don't get any error message in the editor.

MartinSStewart avatar Jan 27 '19 14:01 MartinSStewart

Try setting "Elm Test Path" in elmjutsu setting. By default it requires elm-test to be installed globally. I believe relative path from project root should work (might be wrong though).

ymtszw avatar Jan 28 '19 10:01 ymtszw

I tried adding a path to elm-tests but still no luck. One thing I've noticed is that, after saving, the busy spinner shows the following indefinitely image

MartinSStewart avatar Jan 28 '19 19:01 MartinSStewart

Describe your environment thoroughly please, especially elmjutsu version, linter version, other possibly related packages. The easy way is call "Linter: Debug" from command palette (cmd + shift + P in mac) and copy the resultant.

Also try:

  • Completely exit Atom and start up clean (wait a while for all package startups done before triggering Lint)
  • Make sure elm-test succeeds in your project outside of Atom (from terminals)

Personally I'm using Linter with linter-ui-default, and elm-test globally installed. If the issue is related to atom-ide-ui and/or relatively installed elm-test, I do not have much experience on them.

ymtszw avatar Jan 29 '19 04:01 ymtszw

Normally I use atom-ide-ui. For this I've disabled that and installed linter (v2.2.0 since the #153 bug is open).

Running Linter: debug shows:

Atom Version: 1.34.0
Linter Version: 2.2.0
Opened file is ignored: No
Matching Linter Providers: 
  - Elm
Disabled Linter Providers: 
Standard Linter Providers: 
  - Elm
Indie Linter Providers: 
UI Providers: 
  - Linter
Ignore Glob: **/*.min.{js,css}
VCS Ignored Paths are excluded: true
Current File Scopes: 
  - *
  - source.elm

Completely exiting Atom and starting fresh doesn't seem to help. I've run elm-test from the command line and that correctly compiles and runs tests. I've also tries changing the relative path to elm-test into an absolute path and that doesn't help (if I make a typo in the path, Elmjutsu will still tell me it can't find elm-test).

MartinSStewart avatar Jan 29 '19 19:01 MartinSStewart

Hmm, no easy fix from me. Cannot tell if it is elmjutsu problem or specific to your environment.

My usual debug process around elmjutsu and other Atom packages:

  • Turn on "Log Debug Messages" in the bottom of elmjutsu setting, check console log by opening dev console
  • Print debug! Insert console.log here and there in suspicious packages' JS files and reload Atom, check dev console

ymtszw avatar Jan 30 '19 06:01 ymtszw

@MartinSStewart, can you post the elmjutsu section in your ~/.atom/config.cson? Also, what's the value of "source-directories" in your elm.json? Thanks!

halohalospecial avatar Jan 30 '19 10:01 halohalospecial

Sorry about the delay.

Here's the config.cson (I've changed the extension so that github would let me upload it directly) config.txt

As for source-directories:

"source-directories": [
    "src"
]

@ymtszw Thanks, I'll have a look at the debug output later if I have time.

Edit: I looked at the debug output and noticed that this error is shown repeatedly image

MartinSStewart avatar Jan 31 '19 17:01 MartinSStewart

Hi @MartinSStewart, elmTestExecPath should point to the elm-test.exe binary.

halohalospecial avatar Jan 31 '19 23:01 halohalospecial

I don't have an elm-test.exe but I do have a elm-test file, are they the same thing? I've tried giving a path to it and it seems to work just as well as giving a path to the folder that it's in (which is to say, it doesn't work, but at least Elmjutsu doesn't give an error about not finding elm-test)

MartinSStewart avatar Feb 01 '19 06:02 MartinSStewart

In my Windows 10 env,

  • Node.js(8.12.0) and Yarn(1.10.1) installed, both versions built for windows, downloaded from official websites
  • Elm and elm-test installed via yarn (from PowerShell or cmd.exe)
  • In Elmjutsu setting:
    • Elm Path: C:\Users\<Username>\AppData\Local\Yarn\bin\elm
    • Elm Test Path: C:\Users\<Username>\AppData\Local\Yarn\bin\elm-test

And everything working well. Installed related packages are:

ymtszw avatar Mar 13 '19 20:03 ymtszw