Skip to content

Update test suite for Erlang 19 #4851

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

Closed
peuh opened this issue Jun 22, 2016 · 5 comments
Closed

Update test suite for Erlang 19 #4851

peuh opened this issue Jun 22, 2016 · 5 comments

Comments

@peuh
Copy link

peuh commented Jun 22, 2016

After compiling elixir from source, 5 tests fail. Also the compilation emits a few warnings.
I have the same result whether I use master or tag/1.3

Environment

Debian Stretch (and some bit of unstable)

# cat /proc/version 
Linux version 4.5.0-2-amd64 ([email protected]) (gcc version 5.3.1 20160509 (Debian 5.3.1-19) ) #1 SMP Debian 4.5.4-1 (2016-05-16)

Erlang (installed using the standard .deb provided on erlang official website):

# erl -v
Erlang/OTP 19 [erts-8.0] [source-6dc93c1] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false]
Eshell V8.0 
  • Elixir version (elixir -v):
  • Operating system:

Current behavior

Here is the console output from make clean test

# make clean test
cd lib/elixir && "/opt/elixir/rebar" clean
==> elixir (clean)
rm -rf ebin
rm -rf lib/*/ebin
rm -rf lib/elixir/test/ebin
rm -rf lib/*/tmp
rm -rf lib/mix/test/fixtures/git_repo
rm -rf lib/mix/test/fixtures/deps_on_git_repo
rm -rf lib/mix/test/fixtures/git_rebar
rm -rf lib/elixir/src/elixir.app.src
make clean_man
make[1]: Entering directory '/opt/elixir'
rm -f man/elixir.1
rm -f man/iex.1
make[1]: Leaving directory '/opt/elixir'
==> elixir (compile)
Compiled src/elixir_parser.yrl
Compiled src/elixir_sup.erl
Compiled src/elixir_clauses.erl
Compiled src/elixir_bitstring.erl
Compiled src/elixir_def_defaults.erl
Compiled src/elixir_code_server.erl
Compiled src/elixir_fn.erl
Compiled src/elixir_aliases.erl
Compiled src/elixir_try.erl
Compiled src/elixir_def_overridable.erl
Compiled src/elixir_import.erl
Compiled src/elixir_translator.erl
Compiled src/elixir.erl
Compiled src/elixir_compiler.erl
Compiled src/elixir_utils.erl
Compiled src/elixir_exp.erl
Compiled src/elixir_bootstrap.erl
Compiled src/elixir_with.erl
Compiled src/elixir_rewrite.erl
Compiled src/elixir_quote.erl
Compiled src/elixir_dispatch.erl
Compiled src/elixir_interpolation.erl
Compiled src/elixir_env.erl
Compiled src/elixir_locals.erl
Compiled src/elixir_exp_clauses.erl
Compiled src/elixir_map.erl
Compiled src/elixir_config.erl
Compiled src/elixir_module.erl
Compiled src/elixir_for.erl
Compiled src/elixir_scope.erl
Compiled src/elixir_errors.erl
Compiled src/elixir_tokenizer.erl
Compiled src/elixir_lexical.erl
Compiled src/elixir_def.erl
Compiled src/elixir_parser.erl
==> bootstrap (compile)
Compiled lib/elixir/lib/kernel.ex
Compiled lib/elixir/lib/macro/env.ex
Compiled lib/elixir/lib/keyword.ex
Compiled lib/elixir/lib/module.ex
Compiled lib/elixir/lib/list.ex
Compiled lib/elixir/lib/macro.ex
Compiled lib/elixir/lib/code.ex
Compiled lib/elixir/lib/module/locals_tracker.ex
Compiled lib/elixir/lib/kernel/typespec.ex
Compiled lib/elixir/lib/kernel/utils.ex
Compiled lib/elixir/lib/behaviour.ex
Compiled lib/elixir/lib/exception.ex
Compiled lib/elixir/lib/protocol.ex
Compiled lib/elixir/lib/stream/reducers.ex
Compiled lib/elixir/lib/enum.ex
Compiled lib/elixir/lib/inspect/algebra.ex
Compiled lib/elixir/lib/inspect.ex
Compiled lib/elixir/lib/range.ex
Compiled lib/elixir/lib/regex.ex
Compiled lib/elixir/lib/string.ex
Compiled lib/elixir/lib/string/chars.ex
Compiled lib/elixir/lib/io.ex
Compiled lib/elixir/lib/path.ex
Compiled lib/elixir/lib/file.ex
Compiled lib/elixir/lib/system.ex
Compiled lib/elixir/lib/kernel/cli.ex
Compiled lib/elixir/lib/kernel/error_handler.ex
Compiled lib/elixir/lib/kernel/parallel_compiler.ex
Compiled lib/elixir/lib/kernel/lexical_tracker.ex
==> elixir (compile)
warning: behaviour String.Chars undefined
  lib/calendar.ex:292

warning: behaviour Inspect undefined
  lib/calendar.ex:298

warning: behaviour Enumerable undefined
  lib/file/stream.ex:69

warning: the Dict module is deprecated
  lib/hash_dict.ex:10

warning: behaviour String.Chars undefined
  lib/calendar.ex:556

warning: behaviour String.Chars undefined
  lib/calendar.ex:907

make[1]: Entering directory '/opt/elixir'
==> unicode (compile)
Compiling unicode/unicode.ex (it's taking more than 5s)
make[1]: Leaving directory '/opt/elixir'
==> elixir (compile)
==> eex (compile)
==> mix (compile)
Generated mix app
==> ex_unit (compile)
Generated ex_unit app
==> logger (compile)
Generated logger app
Generated eex app
==> iex (compile)
Generated iex app
==> elixir (eunit)
  All 194 tests passed.

==> elixir (exunit)
warning: invalid function call
  test/elixir/kernel/raise_test.exs:288

..............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................                                                                                                

  1) test consolidated keeps callbacks (Protocol.ConsolidationTest)
     test/elixir/protocol_test.exs:369
     Assertion with != failed
     code: callbacks != []
     lhs:  []
     rhs:  []
     stacktrace:
       test/elixir/protocol_test.exs:371: (test)

......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................                                                                                                                 

  2) test protocol defines callbacks (ProtocolTest)
     test/elixir/protocol_test.exs:125
     ** (ArgumentError) argument error
     stacktrace:
       test/elixir/protocol_test.exs:187: ProtocolTest.get_callbacks/3
       test/elixir/protocol_test.exs:126: (test)

.............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................                                                                                                                                                                                                          

  3) test specs (BehaviourTest)
     test/elixir/behaviour_test.exs:28
     Assertion with == failed
     code: length(Keyword.get_values(Sample.module_info()[:attributes], :callback)) == 7
     lhs:  0
     rhs:  7
     stacktrace:
       test/elixir/behaviour_test.exs:29: (test)

........................................................................................................................................................................................................................................................................................                                                                                                                                                                                                  

  4) test no warnings on raise (Kernel.DialyzerTest)
     test/elixir/kernel/dialyzer_test.exs:66
     raise.ex:2: Invalid type specification for function 'Elixir.Dialyzer.Raise':message/1. The success typing is (atom() | #{'message':=_, _=>_}) -> any()

     raise.ex:2: The inferred type for the 1st argument of message/1 (atom() | #{'message':=_, _=>_}) is not a supertype of #{'__exception__':='true', '__struct__':=atom()}, which is expected type for this argument in the callback of the 'Elixir.Exception' behaviour                                                                                                                                                                                                                


     stacktrace:
       test/elixir/kernel/dialyzer_test.exs:68: (test)

.

  5) test no warnings on valid remote calls (Kernel.DialyzerTest)
     test/elixir/kernel/dialyzer_test.exs:56
     remote_call.ex:0: The pattern #{'key':=_@1} can never match the type #{'a':=1}

     remote_call.ex:0: The pattern #{'fun':=_@1} can never match the type 'Elixir.Hello'

     remote_call.ex:0: The pattern #{'fun':=_@1} can never match the type atom() | tuple()

     remote_call.ex:2: Function map_var/0 has no local return


     stacktrace:
       test/elixir/kernel/dialyzer_test.exs:58: (test)

...................................................................................................................................................................................................................................................................................................................................................................................................................................

Finished in 13.6 seconds (8.0s on load, 5.5s on tests)
3138 tests, 5 failures

Randomized with seed 716764
Makefile:211: recipe for target 'test_stdlib' failed
make: *** [test_stdlib] Error 1

Expected behavior

No test failures :-)

@josevalim
Copy link
Member

Thanks for reporting. We are aware of those failures and we have reported
the bug to OTP two weeks ago. :)

On Wednesday, June 22, 2016, Peuh [email protected] wrote:

After compiling elixir from source, 5 tests fail. Also the compilation
emits a few warnings.
I have the same result whether I use master or tag/1.3
Environment

Debian Stretch (and some bit of unstable)

cat /proc/version

Linux version 4.5.0-2-amd64 ([email protected] javascript:_e(%7B%7D,'cvml','[email protected]');) (gcc version 5.3.1 20160509 (Debian 5.3.1-19) ) #1 SMP Debian 4.5.4-1 (2016-05-16)

Erlang (installed using the standard .deb provided on erlang official
website):

erl -v

Erlang/OTP 19 [erts-8.0] [source-6dc93c1] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false]
Eshell V8.0

  • Elixir version (elixir -v):
  • Operating system:

Current behavior

Here is the console output from make clean test

make clean test

cd lib/elixir && "/opt/elixir/rebar" clean
==> elixir (clean)
rm -rf ebin
rm -rf lib//ebin
rm -rf lib/elixir/test/ebin
rm -rf lib/
/tmp
rm -rf lib/mix/test/fixtures/git_repo
rm -rf lib/mix/test/fixtures/deps_on_git_repo
rm -rf lib/mix/test/fixtures/git_rebar
rm -rf lib/elixir/src/elixir.app.src
make clean_man
make[1]: Entering directory '/opt/elixir'
rm -f man/elixir.1
rm -f man/iex.1
make[1]: Leaving directory '/opt/elixir'
==> elixir (compile)
Compiled src/elixir_parser.yrl
Compiled src/elixir_sup.erl
Compiled src/elixir_clauses.erl
Compiled src/elixir_bitstring.erl
Compiled src/elixir_def_defaults.erl
Compiled src/elixir_code_server.erl
Compiled src/elixir_fn.erl
Compiled src/elixir_aliases.erl
Compiled src/elixir_try.erl
Compiled src/elixir_def_overridable.erl
Compiled src/elixir_import.erl
Compiled src/elixir_translator.erl
Compiled src/elixir.erl
Compiled src/elixir_compiler.erl
Compiled src/elixir_utils.erl
Compiled src/elixir_exp.erl
Compiled src/elixir_bootstrap.erl
Compiled src/elixir_with.erl
Compiled src/elixir_rewrite.erl
Compiled src/elixir_quote.erl
Compiled src/elixir_dispatch.erl
Compiled src/elixir_interpolation.erl
Compiled src/elixir_env.erl
Compiled src/elixir_locals.erl
Compiled src/elixir_exp_clauses.erl
Compiled src/elixir_map.erl
Compiled src/elixir_config.erl
Compiled src/elixir_module.erl
Compiled src/elixir_for.erl
Compiled src/elixir_scope.erl
Compiled src/elixir_errors.erl
Compiled src/elixir_tokenizer.erl
Compiled src/elixir_lexical.erl
Compiled src/elixir_def.erl
Compiled src/elixir_parser.erl
==> bootstrap (compile)
Compiled lib/elixir/lib/kernel.ex
Compiled lib/elixir/lib/macro/env.ex
Compiled lib/elixir/lib/keyword.ex
Compiled lib/elixir/lib/module.ex
Compiled lib/elixir/lib/list.ex
Compiled lib/elixir/lib/macro.ex
Compiled lib/elixir/lib/code.ex
Compiled lib/elixir/lib/module/locals_tracker.ex
Compiled lib/elixir/lib/kernel/typespec.ex
Compiled lib/elixir/lib/kernel/utils.ex
Compiled lib/elixir/lib/behaviour.ex
Compiled lib/elixir/lib/exception.ex
Compiled lib/elixir/lib/protocol.ex
Compiled lib/elixir/lib/stream/reducers.ex
Compiled lib/elixir/lib/enum.ex
Compiled lib/elixir/lib/inspect/algebra.ex
Compiled lib/elixir/lib/inspect.ex
Compiled lib/elixir/lib/range.ex
Compiled lib/elixir/lib/regex.ex
Compiled lib/elixir/lib/string.ex
Compiled lib/elixir/lib/string/chars.ex
Compiled lib/elixir/lib/io.ex
Compiled lib/elixir/lib/path.ex
Compiled lib/elixir/lib/file.ex
Compiled lib/elixir/lib/system.ex
Compiled lib/elixir/lib/kernel/cli.ex
Compiled lib/elixir/lib/kernel/error_handler.ex
Compiled lib/elixir/lib/kernel/parallel_compiler.ex
Compiled lib/elixir/lib/kernel/lexical_tracker.ex
==> elixir (compile)
warning: behaviour String.Chars undefined
lib/calendar.ex:292

warning: behaviour Inspect undefined
lib/calendar.ex:298

warning: behaviour Enumerable undefined
lib/file/stream.ex:69

warning: the Dict module is deprecated
lib/hash_dict.ex:10

warning: behaviour String.Chars undefined
lib/calendar.ex:556

warning: behaviour String.Chars undefined
lib/calendar.ex:907

make[1]: Entering directory '/opt/elixir'
==> unicode (compile)
Compiling unicode/unicode.ex (it's taking more than 5s)
make[1]: Leaving directory '/opt/elixir'
==> elixir (compile)
==> eex (compile)
==> mix (compile)
Generated mix app
==> ex_unit (compile)
Generated ex_unit app
==> logger (compile)
Generated logger app
Generated eex app
==> iex (compile)
Generated iex app
==> elixir (eunit)
All 194 tests passed.

==> elixir (exunit)
warning: invalid function call
test/elixir/kernel/raise_test.exs:288

..............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

  1. test consolidated keeps callbacks (Protocol.ConsolidationTest)
    test/elixir/protocol_test.exs:369
    Assertion with != failed
    code: callbacks != []
    lhs: []
    rhs: []
    stacktrace:
    test/elixir/protocol_test.exs:371: (test)

......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

  1. test protocol defines callbacks (ProtocolTest)
    test/elixir/protocol_test.exs:125
    ** (ArgumentError) argument error
    stacktrace:
    test/elixir/protocol_test.exs:187: ProtocolTest.get_callbacks/3
    test/elixir/protocol_test.exs:126: (test)

.............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

  1. test specs (BehaviourTest)
    test/elixir/behaviour_test.exs:28
    Assertion with == failed
    code: length(Keyword.get_values(Sample.module_info()[:attributes], :callback)) == 7
    lhs: 0
    rhs: 7
    stacktrace:
    test/elixir/behaviour_test.exs:29: (test)

........................................................................................................................................................................................................................................................................................

  1. test no warnings on raise (Kernel.DialyzerTest)
    test/elixir/kernel/dialyzer_test.exs:66
    raise.ex:2: Invalid type specification for function 'Elixir.Dialyzer.Raise':message/1. The success typing is (atom() | #{'message':=_, =>}) -> any()
 raise.ex:2: The inferred type for the 1st argument of message/1 (atom() | #{'message':=_, _=>_}) is not a supertype of #{'__exception__':='true', '__struct__':=atom()}, which is expected type for this argument in the callback of the 'Elixir.Exception' behaviour


 stacktrace:
   test/elixir/kernel/dialyzer_test.exs:68: (test)

.

  1. test no warnings on valid remote calls (Kernel.DialyzerTest)
    test/elixir/kernel/dialyzer_test.exs:56
    remote_call.ex:0: The pattern #{'key':=_@1} can never match the type #{'a':=1}
 remote_call.ex:0: The pattern #{'fun':=_@1} can never match the type 'Elixir.Hello'

 remote_call.ex:0: The pattern #{'fun':=_@1} can never match the type atom() | tuple()

 remote_call.ex:2: Function map_var/0 has no local return


 stacktrace:
   test/elixir/kernel/dialyzer_test.exs:58: (test)

...................................................................................................................................................................................................................................................................................................................................................................................................................................

Finished in 13.6 seconds (8.0s on load, 5.5s on tests)
3138 tests, 5 failures

Randomized with seed 716764
Makefile:211: recipe for target 'test_stdlib' failed
make: *** [test_stdlib] Error 1

Expected behavior

No test failures :-)


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#4851, or mute the thread
https://github.com/notifications/unsubscribe/AAAlblWETCQNd0w9CsndwJvAh5A0L0D-ks5qOU_vgaJpZM4I741f
.

José Valim
www.plataformatec.com.br
Skype: jv.ptec
Founder and Director of R&D

@peuh
Copy link
Author

peuh commented Jun 22, 2016

No problem. Thanks for the awesome job on elixir. Just starting with it but I like it a lot already.

Considering those failed tests, should I downgrade erlang to v18 and recompile or it will work anyway? It's a dev environment, not production.

@josevalim josevalim changed the title Test failure after compilation (both with release 1.3 and master ) Update test suite for Erlang 19 Jun 22, 2016
@josevalim
Copy link
Member

@peuh those bugs are all related to typespecs and it should not affect your code in anyway. You will just get more warnings than necessary if you are using a tool called dialyzer. So it is fine to use Erlang 19 but you may downgrade if it makes you feel more comfortable.

Btw, this is up for grabs. Unfortunately we can't solve the dialyzer issue, so it means we should not run that particular test for Erlang 19. The issues related to callback means we need to fetch the callback information differently (by traversing the beam abstract syntax tree and collecting callbacks). Both solutions should work fine on Erlang 18 too.

@peuh
Copy link
Author

peuh commented Jun 22, 2016

Thanks for the update @josevalim.

@ericentin
Copy link
Contributor

ericentin commented Jun 22, 2016

Grabbing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants