Skip to content
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

Elmjutsu doesn't check for errors in tests #156

Open
MartinSStewart opened this issue Jan 23, 2019 · 12 comments
Open

Elmjutsu doesn't check for errors in tests #156

MartinSStewart opened this issue Jan 23, 2019 · 12 comments

Comments

@MartinSStewart
Copy link

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.

@halohalospecial
Copy link
Owner

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

@MartinSStewart
Copy link
Author

MartinSStewart commented Jan 27, 2019

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.

@ymtszw
Copy link
Contributor

ymtszw commented Jan 28, 2019

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).

@MartinSStewart
Copy link
Author

MartinSStewart commented Jan 28, 2019

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

@ymtszw
Copy link
Contributor

ymtszw commented Jan 29, 2019

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.

@MartinSStewart
Copy link
Author

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).

@ymtszw
Copy link
Contributor

ymtszw commented Jan 30, 2019

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

@halohalospecial
Copy link
Owner

@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!

@MartinSStewart
Copy link
Author

MartinSStewart commented Jan 31, 2019

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

@halohalospecial
Copy link
Owner

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

@MartinSStewart
Copy link
Author

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)

@ymtszw
Copy link
Contributor

ymtszw commented Mar 13, 2019

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:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants