-
Notifications
You must be signed in to change notification settings - Fork 24
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
Feature request: integrate elm-test #131
Comments
Hi @ymtszw, thanks for the great inputs! Indeed, |
The Is it possible for elmjutsu to grab all the direct and indirect |
@halohalospecial Separating responsibility sounds ok as long as elm-test-runner is active in 0.19, but it seems elm-test-runner also does not report compilation results in linter style is it? (Again it is understandable since elm-test cannot return @MethodGrab Thanks for the head up! That workaround is actually handy at least in
it might be ok for the mean time. Though even with this, If you have "always compile main" active, it still does not compile test files on save. So it would be even nicer if elmjutsu treats files under |
@ymtszw, you can set more than one main path using For example, you can set it to |
@halohalospecial I thought I could live with that, but found an oddity, could make a new issue:
|
@ymtszw, thanks a lot for reporting the issue! I'm currently not using Elm and didn't realize that paths returned by |
@halohalospecial Thanks, the problem looks resolved ❤️ So, regarding to test file compilation in Elmjutsu, current solution could be:
A caveat is, in |
From slack: https://elmlang.slack.com/archives/C0SP19AMA/p1536980552000100
So now editor plugins can compile Elm files under |
Hi @ymtszw, have you tried |
Oh, you reported it already 😸 |
FYI, this has been fixed in I'm still working on a couple of bugfixes before the next release, but it should be included in |
Hi @ymtszw, @rtfeldman, Can you check out Elmjutsu v9.0.0? Thanks! |
Thanks for the update! Some issues: (Windows 10, nodejs 8.12.0, Yarn 1.10.1, elm-test path at
|
Thanks a lot, @ymtszw ! |
I can see the same error on RoutingTests.elm in This happens only for test files when Again, my environment is:
I'll try debugging a bit locally. |
Using the same Here, I'm purposefully inserting a typo in
So basically, some patterns of Windows-style paths are not handled well in Let me ping: @rtfeldman |
Interesting! Do you get the same |
Weird, no, (Compile errors about UNKNOWN IMPORT are not a problem here since it's passing test files to
|
Hi @ymtszw, were you able to resolve this? :) |
Haven't checked for a while. |
I think this is a path-handling issue of As a workaround, pass project-relative file paths should work in Windows: @@ -80,7 +80,13 @@ export default class ElmMakeRunner {
}
}
} else {
- filePathsToCompile = [editorFilePath];
+ if (isTestFilePath && process.platform === 'win32') {
+ // Workaround for https://github.com/halohalospecial/atom-elmjutsu/issues/131#issuecomment-429445645
+ const relativeEditorFilePath = path.relative(projectDirectory, editorFilePath);
+ filePathsToCompile = [relativeEditorFilePath];
+ } else {
+ filePathsToCompile = [editorFilePath];
+ }
}
const outputPath = '/dev/null'; // TODO: Make this configurable. Tested on my local WIndows machine by editing the file under |
@ymtszw, do you want to submit a PR for your workaround? |
@halohalospecial Happy to! #145 |
[#131] Pass relative paths to elm-test in win32
Thanks a lot, @ymtszw ! 🎉 |
I believe this issue can be closed for now that all the good things are in and problems are solved. |
Closing for now... Thanks, @ymtszw! |
It would be really cool if elmjutsu integrate
elm-test
, especially, handling compilation results of files undertests/
.Currently, on-save compilation of elmjutsu (the feature migrated from linter-elm-make) cannot compile files under
tests/
, and showing an error like this:... which is understandable, since in
elm-test
, files undertests/
are considered separate Elm project,and there are many missing parts required (which are prepared internally by node-test-runner) to properly compile test suites project.
(The error itself is resolvable if we set "main path" for compilation as suggested in #130 (comment),
though this workaround just tells elmjutsu to NOT compile files under
tests/
even if the currently worked-on file is a test file, if I understand correctly)Actually I suspect this "problem" is carried over from linter-elm-make seeing this seemingly-related issue: mybuddymichael/linter-elm-make#115
Although I do not recall exact bahaviors of linter-elm-make when test files are saved.
Anyway, in Elm 0.19, many things have changed like usage of
elm-stuff/
and structure ofelm.json
, so they may not directly relate.The root issue is: "test-dependencies" are now included in projects'
elm.json
, yetelm
compiler itself does not simply compiletests/*
files and require aid from node-test-runner.So at least until elm-test is officially integrated in
elm
, we have to communicate withelm-test
in order to achieve the goal.(I could be wrong here, there may be simpler ways to compile
tests/*
files just for error checking in editor)However, currently
elm-test
does not have an option to compile test project withelm make --report=json
in order to acquire editor-plugin-friendly compilation results.(There is
--report
option though it is only emitting test-related events in JSON, not compilation results)So the work may have to start from contributing to
elm-test
.Also, perhaps we want "just compile and not actually run tests" option in
elm-test
, since tests themselves could take long time than compilation.Works required looks quite large so I cannot just demand quick action, though I would be really happy to hear from folks about this.
The text was updated successfully, but these errors were encountered: