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

update run-tests.sh to work with 0.19 #1017

Open
wants to merge 12 commits into
base: master
from

Conversation

Projects
None yet
2 participants
@jerith666
Copy link
Contributor

jerith666 commented Feb 9, 2019

See #1016 for changes to the test code itself.

elm/core is special because the compiler always inserts an implicit
dependency on it. therefore it's impossible to have the tests
integrated in the elm/core project in the normal way -- if we try to
symlink out from $ELM_HOME to our project's source in the way that was
done for 0.18, the compiler gets into a deadlock. other approaches
cause it to find two copies of all the code in elm/core and refuse to
proceed.

instead, this approach creates a logically independent project, with
no real code, only tests.

jerith666 added some commits Feb 3, 2019

create a totally separate elm project for elm/core tests
elm/core is special because the compiler always inserts an implicit
dependency on it.  therefore it's impossible to have the tests
integrated in the elm/core project in the normal way -- if we try to
symlink out from $ELM_HOME to our project's source in the way that was
done for 0.18, the compiler gets into a deadlock.  other approaches
cause it to find two copies of all the code in elm/core and refuse to
proceed.

instead, this approach creates a logically independent project, with
no real code, only tests.
remove main and emit functions in tests/Main.elm
these are no longer required by the new version of elm-test
update Test.Array for 0.19
* expose Array module contents w/o prefix rather than Maybe

* use modBy instead of (%)

* remove test for Array.toString, removed in 0.19
update Test.CodeGen for 0.19
* shadowing is no longer allowed by the compiler; remove test for it
update Test.Equality for 0.19
* elm-test now requires tests to have unique names
update Test.List for 0.19
* update import syntax

* use String.fromInt, modBy, and Tuple.pair rather than toString, (%), and (,)

* inline our own version of flip, as it was removed in 0.19

* remove test for scanl, which was removed in 0.19
update Test.Result for 0.19
* use modBy rather than (%)

* String.toInt now returns a Maybe rather than a Result, so implement
  our own local version of the old behaviour, so the andThen tests can
  continue to build upon it.
update Test.String for 0.19
* String.toInt and String.toFloat now return Maybe

* String.toInt no longer parses hex literals in 0.19
update Test.Basics for 0.19
* Date is no longer part of elm/core; remove tests for it

* need to import Debug.toString to test it now

* 0.19 limited tuple size, so reduce test to match

* use new modBy and remainderBy functions

* 0.19 removed flip, curry, and uncurry; so, remove tests for those

* updates for elm-test:
  * remove a duplicate test
  * use Expect.within with floats
@jerith666

This comment has been minimized.

Copy link
Contributor Author

jerith666 commented Feb 9, 2019

CI build failed with:

tests/run-tests.sh: line 43: node_modules/elm-test/bin/elm-test: No such file or directory
ls: cannot access /home/travis/build/elm/core/tests/.elm/0.19.0/package/elm/core/: No such file or directory
The command "bash tests/run-tests.sh" exited with 2.

Hm ... I'll probably need some more details about how the CI environment is set up to say why this isn't working.

@jerith666

This comment has been minimized.

Copy link
Contributor Author

jerith666 commented Feb 9, 2019

Also you might want to have a look at @harrysarson's approach in jerith666#1 -- we weren't sure which was better.

@harrysarson

This comment has been minimized.

Copy link

harrysarson commented Feb 10, 2019

See: https://github.com/elm/core/blob/master/.travis.yml#L29

Travis is trying to run the tests using elm 0.18 which is (I think) why they are breaking.

Tidy test running and use travis in elm mode
This removes `src` as a source directory in the tests directory
as it does not exist.
Additionally, it uses a global elm-test by default in `run-tests.sh`
and uses travis elm support.

Refs: https://docs.travis-ci.com/user/languages/elm
Refs: #1017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment