elm-community / elm-test

moved to elm-explorations/test
https://github.com/elm-explorations/test
BSD 3-Clause "New" or "Revised" License
340 stars 35 forks source link

Compilation fails on running tests #181

Open battermann opened 7 years ago

battermann commented 7 years ago

Hi,

this might be a duplicate, or might even be an issue of another project. Anyway, since I couldn't resolve it and since it happens when running elm-app test (which should run elm-test behind the scenes, I suppose) I will post it here. I tried several things to resolve but couldn't make it work. Sometimes re-installing the packages helped, sometimes not. If this is a setup / configuration problem I'd be very glad if someone could help me out and this issue can be closed. Thanks!

Reproduce the error

OS

Use fresh Ubuntu box (I used Ubuntu 17.04 Zesty Zapus (Final) from osboxes.org)

nvm

Install nvm (v0.33.2):

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash

Node

Install Node (v8.1.2)

nvm install node

Elm

Install Elm (v0.18.0)

npm install -g elm

create-elm-app

Install create-elm-app (v0.8.6)

npm install create-elm-app -g

Create new Elm app and run tests

Create a new app and cd to the folder:

create-elm-app my-app

Run tests works:

elm-app test

output:

elm-test
--------

Running 4 tests. To reproduce these results, run: elm-test --fuzz 100 --seed 1469746098

↓ Tests
↓ A Test Suite
✗ This test should fail

    failed as expected!

TEST RUN FAILED

Duration: 7 ms
Passed:   3
Failed:   1

Add new dependencies and run tests again

Install elm-lang/http in main project and test project:

elm-app package install -y elm-lang/http

Running the test command again now fails:

Compilation failed for /home/osboxes/my-app/elm-stuff/generated-code/elm-community/elm-test/src/Main496aafb3c4c5cf7d1e284a81de8ccea9.elm

Deleting packages and re-installing sometimes made tests work again, but then after making some other change compilation fails again.

mgold commented 7 years ago

Related to #178, #176?

battermann commented 7 years ago

@mgold The suggested solution from #178:

I deleted the elm-stuff directory and all of its content in the main folder, and re-running elm-test worked for me

doesn't work for me. Even though, it occasionally makes the test's build succeed, it eventually breaks again.

I'll try to install node-test-runner from the current master branch as suggested in #176 and see what that does as soon as I get a chance.

mgold commented 7 years ago

@battermann Any new here?

battermann commented 7 years ago

I found a workaround by using Node 6.x. I haven't tested it with current node-test-runner, yet.

With latest ubuntu docker image I cannot even install elm. I get this error:

npm install -g elm
npm WARN deprecated node-uuid@1.4.8: Use uuid module instead
/root/.nvm/versions/node/v8.1.3/bin/elm -> /root/.nvm/versions/node/v8.1.3/lib/node_modules/elm/binwrappers/elm
/root/.nvm/versions/node/v8.1.3/bin/elm-package -> /root/.nvm/versions/node/v8.1.3/lib/node_modules/elm/binwrappers/elm-package
/root/.nvm/versions/node/v8.1.3/bin/elm-reactor -> /root/.nvm/versions/node/v8.1.3/lib/node_modules/elm/binwrappers/elm-reactor
/root/.nvm/versions/node/v8.1.3/bin/elm-make -> /root/.nvm/versions/node/v8.1.3/lib/node_modules/elm/binwrappers/elm-make
/root/.nvm/versions/node/v8.1.3/bin/elm-repl -> /root/.nvm/versions/node/v8.1.3/lib/node_modules/elm/binwrappers/elm-repl

> elm@0.18.0 install /root/.nvm/versions/node/v8.1.3/lib/node_modules/elm
> node install.js

sh: 1: node: Permission denied
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! elm@0.18.0 install: `node install.js`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the elm@0.18.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2017-07-10T09_46_36_406Z-debug.log
rtfeldman commented 7 years ago

I tried this on Node 8.4.0 and the current elm-test and it worked fine. 🤔

@battermann can you check out https://github.com/rtfeldman/node-test-runner locally and run npm install && npm test && echo "IT PASSED" and let me know if it prints "IT PASSED" at the end?

battermann commented 7 years ago

@rtfeldman Sorry for the delay. I tried it on three different machines (on my local machine running elementary OS, in vagrant box running Ubuntu 17.04 Zesty Zapus, and in Virtual Box image Ubuntu 17.04 Zesty Zapus from osboxes.org) . It all printed "IT PASSED" at the end.