parroty / extwitter

Twitter client library for elixir.
MIT License
409 stars 129 forks source link

Streaming specs fail on Elixir 1.8.x #113

Closed jbrowning closed 4 years ago

jbrowning commented 5 years ago

This is possibly due to a meck incompatibility.

Example:

1) test gets Twitter sample stream (ExTwitterStreamTest)
    test/extwitter_stream_test.exs:30
    ** (ErlangError) Erlang error: {:compile_forms, {:error, [{[], [{:none, :compile, {:crash, :sys_core_fold, {{:case_clause, {:EXIT, {:function_clause, [{:sys_core_fold, :module, [[{:attribute, 1, :file, {'lib/extwitter/oauth.ex', 1}}, {:attribute, 1, :module, ExTwitter.OAuth_meck_original}, {:attribute, 1, :compile, [:no_auto_import]}, {:attribute, 1, :export, [__info__: 1, oauth_get: 7, oauth_post: 7, request: 7, request_async: 7, send_httpc_request: 3]}, {:attribute, 1, :spec, {{:__info__, 1}, [{:type, 1, :fun, [{:type, 1, :product, [{:type, 1, ...}]}, {:type, 1, :any, []}]}]}}, {:function, 0, :__info__, 1, [{:clause, 0, [{:atom, 0, :module}], [], [{:atom, 0, ExTwitter.OAuth}]}, {:clause, 0, [{:atom, 0, :functions}], [], [{:cons, 0, {:tuple, 0, ...}, {:cons, ...}}]}, {:clause, 0, [{:atom, 0, :macros}], [], [nil: 0]}, {:clause, 0, [{:match, 0, {:var, 0, ...}, {:atom, ...}}], [], [{:call, 0, {...}, ...}]}, {:clause, 0, [{:match, 0, {:var, ...}, {...}}], [], [{:call, 0, ...}]}, {:clause, 0, [{:match, 0, {...}, ...}], [], [{:call, ...}]}, {:clause, 0, [{:atom, 0, ...}], [], [nil: 0]}]}, {:function, 54, :get_signed_params, 7, [{:clause, 54, [{:var, 54, :_method@1}, {:var, 54, :_url@1}, {:var, 54, :_params@1}, {:var, 54, :_consumer_key@1}, {:var, 54, :_consumer_secret@1}, {:var, 54, ...}, {:var, ...}], [], [{:match, 55, {:var, 55, ...}, {:call, ...}}, {:call, 61, {:remote, ...}, [...]}]}]}, {:function, 34, :oauth_get, 7, [{:clause, 34, [{:var, 34, :_url@1}, {:var, 34, :_params@1}, {:var, 34, :_consumer_key@1}, {:var, 34, :_consumer_secret@1}, {:var, 34, ...}, {:var, ...}, {...}], [], [{:match, 35, {:var, ...}, {...}}, {:match, 37, {...}, ...}, {:match, 38, ...}, {:call, ...}]}]}, {:function, 42, :oauth_post, 7, [{:clause, 42, [{:var, 42, :_url@1}, {:var, 42, :_params@1}, {:var, 42, :_consumer_key@1}, {:var, 42, ...}, {:var, ...}, {...}, ...], [], [{:match, 43, {...}, ...}, {:match, 45, ...}, {:match, ...}, {...}]}]}, {:function, 68, :proxy_option, 0, [{:clause, 68, [], [], [{:call, 69, ...}]}]}, {:function, 9, :request, 7, [{:clause, 9, [{:atom, 0, :get}, {:var, 9, ...}, {:var, ...}, {...}, ...], [], [{:call, ...}]}, {:clause, 16, [{:atom, 0, ...}, {:var, ...}, {...}, ...], [], [{...}]}]}, {:function, 23, :request_async, 7, [{:clause, 23, [{:atom, 0, ...}, {:var, ...}, {...}, ...], [], [{...}]}, {:clause, 30, [{:atom, ...}, {...}, ...], [], [...]}]}, {:function, 50, :send_httpc_request, 3, [{:clause, 50, [{:var, ...}, {...}, ...], [], [...]}]}, {:function, 64, :stream_option, 0, [{:clause, 64, [], [], ...}]}], [:binary, :return_errors, :debug_info, :dialyzer, :no_spawn_compiler_process, :from_core, :no_auto_import]], [file: 'sys_core_fold.erl', line: 109]}, {:compile, :"-select_passes/2-anonymous-2-", 3, [file: 'compile.erl', line: 578]}, {:compile, :"-internal_comp/5-anonymous-1-", 3, [file: 'compile.erl', line: 342]}, {:compile, :fold_comp, 4, [file: 'compile.erl', line: 369]}, {:compile, :internal_comp, 5, [file: 'compile.erl', line: 353]}, {:compile, :"-do_compile/2-anonymous-0-", 2, [file: 'compile.erl', line: 177]}, {:meck_code, :compile_and_load_forms, 2, [file: '/Users/me/extwitter/deps/meck/src/meck_code.erl', line: 71]}, {:meck_proc, :backup_original, 3, [file: '/Users/me/extwitter/deps/meck/src/meck_proc.erl', line: 363]}, {:meck_proc, :init, 1, [file: '/Users/me/extwitter/deps/meck/src/meck_proc.erl', line: 206]}, {:gen_server, :init_it, 2, [file: 'gen_server.erl', line: 365]}, {:gen_server, :init_it, 6, [file: 'gen_server.erl', line: 333]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 247]}]}}}, [{:compile, :"-select_passes/2-anonymous-2-", 3, [file: 'compile.erl', line: 578]}, {:compile, :"-internal_comp/5-anonymous-1-", 3, [file: 'compile.erl', line: 342]}, {:compile, :fold_comp, 4, [file: 'compile.erl', line: 369]}, {:compile, :internal_comp, 5, [file: 'compile.erl', line: 353]}, {:compile, :"-do_compile/2-anonymous-0-", 2, [file: 'compile.erl', line: 177]}, {:meck_code, :compile_and_load_forms, 2, [file: '/Users/me/extwitter/deps/meck/src/meck_code.erl', line: 71]}, {:meck_proc, :backup_original, 3, [file: '/Users/me/extwitter/deps/meck/src/meck_proc.erl', line: 363]}, {:meck_proc, :init, 1, [file: '/Users/me/extwitter/deps/meck/src/meck_proc.erl', line: 206]}, {:gen_server, :init_it, 2, [file: 'gen_server.erl', line: 365]}, {:gen_server, :init_it, 6, [file: 'gen_server.erl', line: 333]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 247]}]}}}]}], []}}
    code: test_with_mock "gets Twitter sample stream", ExTwitter.OAuth,
    stacktrace:
      /Users/me/extwitter/deps/meck/src/meck_proc.erl:96: :meck_proc.start(ExTwitter.OAuth, [])
      test/extwitter_stream_test.exs:30: anonymous fn/2 in ExTwitterStreamTest."test gets Twitter sample stream"/1
      (elixir) lib/enum.ex:1940: Enum."-reduce/3-lists^foldl/2-0-"/3
      test/extwitter_stream_test.exs:30: (test)
parroty commented 4 years ago

Thanks for reporting and sorry being late to respond. Updated the dependencies with the commit above.