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

Trouble using with elm-test #47

Open
dustinfarris opened this issue Sep 29, 2017 · 9 comments
Open

Trouble using with elm-test #47

dustinfarris opened this issue Sep 29, 2017 · 9 comments

Comments

@dustinfarris
Copy link

dustinfarris commented Sep 29, 2017

I get this output:

$ elm-test

Error: Your .elm/packages/ directory may be corrupted. I was led to believe that
saschatimme/elm-phoenix existed, but I could not find anything when I went to
look up the published versions of this package.

I tried running elm-github-install from within my tests directory (using its own elm-package.json) but that didn't help.

@gdotdesign
Copy link
Owner

gdotdesign commented Sep 29, 2017

I need some information :) both elm-package.jsons and the directory tree of both elm-stuff (tree elm-stuff -L 2) for starters.

@dustinfarris
Copy link
Author

Ok. For the record I can still run elm-test, it's just giving me this output — not sure if it will bite me or not — I'm just getting started writing tests.

Here's the info you asked for:

https://gist.github.com/dustinfarris/28f138f4b64b522147d881c027a746bc

@gdotdesign
Copy link
Owner

Thanks.

For the record I can still run elm-test

You mean it actually runs the tests and this is some extra output with them?

@dustinfarris
Copy link
Author

Right, sorry if that wasn't clear. No emergency, just seeing this output every time I run elm-test.

@MartinKavik
Copy link

@dustinfarris, @gdotdesign :
Well, this problem was a show-stopper for me, my temporary solution is this:
(see "tachyons-elm" in both files below)

File /elm-package.json:

{
  "version": "1.0.0",
  "summary": "helpful summary of your project, less than 80 characters",
  "repository": "https://github.com/user/project.git",
  "license": "BSD3",
  "native-modules": true,
  "source-directories": ["src"],
  "exposed-modules": [],
  "dependencies": {
    "gdotdesign/elm-spec": "1.0.0 <= v < 2.0.0",
    "MartinKavik/tachyons-elm": "2.1.0 <= v < 3.0.0",
    "elm-lang/core": "5.0.0 <= v < 6.0.0",
    "elm-lang/html": "2.0.0 <= v < 3.0.0",
    "jamesmacaulay/elm-graphql": "1.0.0 <= v < 2.0.0"
  },
  "dependency-sources": {
    "MartinKavik/tachyons-elm": {
      "url": "https://github.com/MartinKavik/tachyons-elm",
      "ref": "6-fix-selector-filter"
    }
  },
  "elm-version": "0.18.0 <= v < 0.19.0"
}

File /tests/elm-package.json:

{
  "version": "1.0.0",
  "summary": "Test Suites",
  "repository": "https://github.com/user/project.git",
  "license": "BSD3",
  "native-modules": true,
  "source-directories": [
    "..\\src",
    ".",
    "..\\elm-stuff\\packages\\MartinKavik\\tachyons-elm\\2.1.0"
  ],
  "exposed-modules": [],
  "dependencies": {
    "eeue56/elm-html-test": "5.1.1 <= v < 6.0.0",
    "elm-community/elm-test": "4.0.0 <= v < 5.0.0",
    "elm-lang/core": "5.0.0 <= v < 6.0.0",
    "elm-lang/html": "2.0.0 <= v < 3.0.0",
    "jamesmacaulay/elm-graphql": "1.0.0 <= v < 2.0.0"
  },
  "elm-version": "0.18.0 <= v < 0.19.0"
}

@gdotdesign
Copy link
Owner

@MartinKavik The dependencies in test/elm-package.json needs to include all dependencies of the parent elm-package.json (4. point of https://github.com/elm-community/elm-test#running-tests-locally) and probably you need to install the dependencies with elm-github-install after that in the test directory.

@dustinfarris I think the node-test-runner tries to install packages on every run and shows the message because it cannot complete it.

I think all I can do is to mention this in the Readme.

@mingan
Copy link

mingan commented Oct 31, 2017

I'd like to clarify that for this to work, you need to be on node-test-runner 0.18.9 or newer which doesn't stop when it can't install dependencies.

@opsb
Copy link

opsb commented Jul 12, 2018

There is a pretty nasty hack you can use to get this working.

package.json

{
  "scripts": {
    "test": "rsync -r tests/elm-stuff elm-stuff/generated-code/elm-community/elm-test/elm-stuff && elm-test"
}

then to deal with the call to elm-package install -y add a blank file called elm-package to the start of your PATH var.

This does mean that elm-package isn't available for normal use but if you use elm-install everywhere then this shouldn't be an issue.

@spookylukey
Copy link

spookylukey commented Mar 12, 2019

For anyone else having trouble with this, note that no released version of elm-test actually has the --skip-installed flag - it was added, but then removed again.

I found I was able to get my setup working as follows:

Install commit b671657b00cf2eae6771078a6133753caa15b17b of elm-test (i.e. rtfeldman/node-test-runner@b671657 ), which can be done like this:

npm install 'rtfeldman/node-test-runner#b671657b00cf2eae6771078a6133753caa15b17b' -g

Then, in the 'tests' directory, after having set up the elm-package.json with dependencies and dependency_sources as per your main elm-package.json, do:

elm-install

Then in the main directory (that contains tests/):

elm-test --skip-install

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

6 participants