-
Notifications
You must be signed in to change notification settings - Fork 79
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
Leverage elm-json solve
#356
Conversation
I think another notable one is that
That sounds cool! |
(Also, I'm not sure why the Travis-CI build isn't running for this PR) |
This is true! To be fair, there are experiments with actually rewriting the elm-test CLI in Rust, so I feel fairly confident that a reasonable amount of people who could potentially debug issues should they arise, are involved with the (edit: Added it to the cons list)
I have no idea why, but travis was disabled for PR's. I've re-enabled it after I noticed it wasn't running. I still have a commit pending for removing the (edit: They're running now! 🎉 ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me!
The existing logic for inferring the correct dependences is dubious to say the least and has been causing issues for folk using this package. "solving" the dependency tree is probably something that the elm compiler (or package manager if that becomes a separate thing) will do in the long term future and, as such, depending on an external program is something that a test runner will have to do eventually.
I think this changeset is a big improvement.
@harrysarson The tests make sense, it's the changes to that Perhaps I should remove that |
If that is possible it would be a very good idea to do so. Keeping this file up to date is a pain. |
I'm less convinced. As a means of "propagating constraints" - yeah, that's painful and shouldn't be happening. But as an elm.json that's useful when actually working on the Elm code, it seems useful to have. It shouldn't be harder to keep up to date than any other elm.json. @rtfeldman thoughts? |
To unblock this, I propose:
Thoughts? |
Bump :) |
1 similar comment
Bump :) |
One important cons is that |
That is a good point. Saying that, elm-test runs the elm compiler under the hood so running it offline is not guaranteed to work (i.e. the elm compiler may decide it needs to download packages which requires internet access). |
@zwilias could you chime in on this:
I think you recently released a new version of elm-json that solves this issue. Regarding this pull request, I now have commit rights to this repository! The cons:
are, I think, worth accepting for the improvements this PR brings. Especially because elm-json is no longer so young and (subjectively) I think rust knowledge has increases across the elm community. Therefore, I am inclined to merge this (after a rebase) in two to four weeks time unless anyone raises an further objections before then! |
There is indeed an offline mode, however, It might potentially be interesting to look into caching the generated |
Thanks @zwilias, that sounds great 👍 as far as I can tell there are no blockers to merging soon then. |
Since #451 was merged, we can close this one. |
Fixes #328, fixes #277, fixes #273, fixes #323, fixes #374
I recently released
elm-json
, a tool for interacting withelm.json
files. One of the available subcommands issolve
: Given an elm.json file (for a package or application), it tries to generate a single set of direct and indirect dependencies that satisfy all constraints. It has 2 flags that make it useful fornode-test-runner
:--test
=> Includes thetest-dependencies
and promotes them to direct dependencies--extra
=> Allows providing an extra set of packages that need to be direct dependencies of the final resultSince
elm-json
can be installed throughnpm
and has binaries available for OS X, Windows and Linux (statically linked), it seems like a fine candidate to use innode-test-runner
for calculating the final set of dependencies needed for the generated application.I've tested this on all the failure cases listed in the linked tickets, as well as a number of my own packages and applications. As far as I can tell, it just works.
With this in place, we could also start thinking about running tests for packages for both the minimal allowed versions (by passing the
--minimize
flag toelm-json solve
) and the maximal allowed versions. I did not include such exploration in this PR, but want to note that this now becomes feasible.Cons of this approach:
elmi-to-json
, so that's not a blocking factor)elm-json solve
interface will not change in the foreseeable future)elm-json