Commit Graph

383 Commits

Author SHA1 Message Date
Michael Oliver
3e1748f20e
Use :ssl.handshake/3 if available to avoid deprecation warning (#372) 2018-07-31 23:23:23 -07:00
Jon Parise
d285ddc0f1
Note that contributions fall under the license (#371) 2018-07-30 13:04:09 -07:00
Jon Parise
0c448a1c99
Update the list of project maintainers (#370)
Also order the names alphabetically.
2018-07-30 09:34:28 -07:00
Jon Parise
9e4d6b4430
Add an initial contributing guide (#362) 2018-07-30 07:40:59 -07:00
Jon Parise
24a93ce0d4
Mark development deps as runtime: false (#368) 2018-07-30 07:40:00 -07:00
Michael Oliver
e1cda06b52
Remove stale TODO.md file (#365) 2018-07-29 21:35:23 -07:00
Michael Oliver
9b6fe16a06
Remove stale erlang thrift support files (#366) 2018-07-29 19:15:31 -07:00
Michael Oliver
58cdb439a5
Run mix format (#352)
* Run mix format

* Add formatter check to CI

* Combine travis env variables

* Rename env variable, better formatter message
2018-07-29 17:08:22 -07:00
Jon Parise
07f8a6b7a3
Address all of credo's "readability" issues (#359)
Also disable the MultiAliasImportRequireUse check.
2018-07-29 16:04:44 -07:00
Jon Parise
753d9db9bd
Merge pull request #361 from fishcakez/more-flakey-tests
More race condition fixes in tests
2018-07-29 13:11:03 -07:00
James Fish
308c98baff Fix registry race condition in tests
Client process exists asynchronously, so may not have finished exiting by
the next test. Therefore use a different name in each test as name does
not need to be the same.
2018-07-29 12:54:47 -07:00
James Fish
b84e1ef23b Fix race condition in tests
Process.alive?/1 returns false once a process begins to die. This is asynchronous and
everything when a process exits costs reduction. One part of this is unregistering
the process's name.
2018-07-29 12:49:10 -07:00
Jon Parise
ebc22826e3
Upgrade to ranch 1.5 (#358)
This was already reflected in mix.lock. Update our formal dependency,
too.
2018-07-29 12:10:16 -07:00
Jon Parise
d2d35e28f4
Upgrade to credo 0.10 (#357)
Also exclude the test/fixtures/app/lib/ path because it contains
generated code.
2018-07-29 11:51:19 -07:00
Jon Parise
fece96bf48
Upgrade to ex_doc 0.19 (#356) 2018-07-28 21:00:33 -07:00
James Fish
84fc3cb644
Fix flakey tests (#355) 2018-07-28 18:28:59 -07:00
Jon Parise
529cb3faff
Upgrade to excoveralls 0.9.1 (#353)
Also remove unnecessary quotes around the `coveralls` keyword. That was
producing a warning under Elixir 1.7.
2018-07-28 17:33:25 -07:00
Jon Parise
ed0c8f0d58
Test against Elixir 1.7 and Erlang/OTP 21.0 (#354) 2018-07-26 08:39:51 -07:00
Michael Oliver
c28a646f4f
Remove dependency on 'thrift' compiler and Erlang runtime (#350)
* Remove dependency on 'thrift' compiler and Erlang runtime

* Make some functions defp, remove some travis config, and moduletag

* Rename test/static to test/data

* Serialized maps/sets are non-deterministic, so we should not compare directly to the serialized data files

* Add python script for generating test data

* Minor python cleanups
2018-07-22 19:28:44 -07:00
Jon Parise
2c1380b36d
Remove benchfella and benchmarks (#351)
These benchmarks are based on a direct comparison to the Apache Thift
Erlang implementation from several Elixir versions ago.

We're also in the process of removing our Erlang runtime coupling (#323)
which will make it difficult to continue maintaining these benchmarks in
their current form.
2018-07-21 21:51:37 -07:00
Jon Parise
c25599692f
Small improvements to Schema.new/3 (#347)
- build the schema using a single merge/2 reduction
- path can be nil when we're parsed from an in-memory string
- remove the `model` type that isn't doing much for us
- remove the unused `thrift_namespace` field
2018-06-26 09:35:43 -07:00
Steve Cohen
9f453df7f1
Quality of life improvements (#349)
* Quelled compile warnings under 1.6
* Allowed ranch transport opts to be specified

In Elixir 1.6, there's a preference for catch to come before rescue
2018-06-18 11:00:55 -07:00
Jon Parise
815029d1ca
Move Thrift.Parser.Models to Thrift.AST (#346)
This moves the nested Models into a more distinct top-level namespace.
There aren't any functional changes here, but it prefaces future work to
better define the parsed (AST) representation of a Thrift file.
2018-06-13 12:11:11 -07:00
Jon Parise
1cc9b7a8a0
Fix missing ` in @moduledoc (#345) 2018-06-13 12:10:44 -07:00
Jon Parise
3b906088a9
Updating dependencies (#344) 2018-06-13 12:10:27 -07:00
Michael Oliver
45ce5a6e60
Handle special floats like NaN, inf, -inf (#329)
* Handle special floats like NaN, inf, -inf

* Add NaN struct

* Write large number with underscores

* Move Thrift.NaN and remove unnecessary function clause

* Follow consistent code style
2018-05-16 01:38:44 -07:00
Michael Oliver
f26f5e78b0
Add option for allowing both SSL and plain connections on same port (#341)
* Add option for allowing both SSL and plain connections on same port

* PR Feedback
2018-05-11 12:20:25 -07:00
Jon Parise
a30f6434cb
Support comment-based namespace declarations (#340)
Thrift uses the `namespace` keyword to define a language's namespace.

    namespace elixir Thrift.Namespace

Unfortunately, the Apache Thrift compiler will produce a warning on this
line because it doesn't recognize `elixir` as a supported language.
While that warning is benign, it can be annoying. For that reason, you
can also specify your Elixir namespace as a "magic" namespace comment:

    #@namespace elixir Thrift.Namespace

This alternate syntax is borrowed from Scrooge, which uses the same
trick for defining `scala` namespaces.
2018-05-10 10:33:09 -07:00
Jon Parise
91651ff4e8
Test the SSL.configuration/1 error path (#339) 2018-05-05 19:15:42 -07:00
Jon Parise
eaada291d4
"Generate" -> "Generates" for thrift.generate (#338)
This is consistent with the @shortdoc comments of other mix tasks.
2018-05-05 12:22:26 -07:00
James Fish
19464513c0
Add link to ssl docs (#337)
* Add link to ssl docs

* Add SSL options and example to README
2018-05-02 16:11:56 -07:00
James Fish
1ed4b894a5
Support SSL/TLS (#336) 2018-05-02 15:47:49 -07:00
Jon Parise
fb715ef8a4
Test against OTP 20.3 (#335)
Also remove the Elixir 1.6 / OTP 20.3 entry from the matrix to speed up
our CI builds a bit more. That isn't a unique-enough combination to
justify its own testing environment.
2018-05-02 15:04:02 -07:00
Jon Parise
ce8a0e6daa
Raise ConnectionError for bang function errors (#320)
The previous code attempted to raise an error atom as an exception.
Instead, wrap that error reason in a new ConnectionError exception.
2018-05-02 09:40:48 -07:00
Jon Parise
f13565eef9
Update locked development dependencies (#331) 2018-04-03 08:52:00 -07:00
Li Xiaobin
129b9f3a69 fix test failed on windows (#330) 2018-04-02 07:53:47 -07:00
Michael Oliver
cc37cb4dd5
Fix bug with enum numbering (#328)
* Fix bug with enum numbering

* Be quiet ebert

* Start enum numbering from 0
2018-03-04 19:00:35 -08:00
Paul Wilson
a484320111 Corrects the thrift example definition in the README (#327) 2018-03-01 12:27:36 -08:00
James Fish
0a298c9b9c
Avoid redefining generated in memory only modules (#326) 2018-02-17 17:04:50 -08:00
Michael Oliver
7033f56acf
Fix gen_server_opts not being passed to GenServer (#324)
* Fix gen_server_opts not being passed to GenServer

* Make gen_server_opts top-level options
2018-02-06 17:38:20 -08:00
James Fish
56e4f9b14e
Improve log handling in tests and binary server (#321)
Previously all backends were removed which would hide all logs. This
is quite inconvenient if a test fails. Capture log will only show
output for failed tests (grouped and inline with each test failure).

Do not log expected errors (tcp socket will always close eventually).
2018-01-30 10:48:47 -08:00
Jon Parise
3057d5e1af
Support Elixir 1.6 setup_all context change (#318)
Elixir 1.6's ExUnit implementation changed such that setup_all's
`context` now contains a `:module` key instead of a `:case` key.
Backwards compatibility was intended, but it looks like the ExUnit
runner now only passes `:module`.
2018-01-29 12:17:17 -08:00
Jon Parise
adb1145ce2
Test under Elixir 1.6 (#316)
Elixir 1.6 is allowed to fail for now.

Also, switch version syntax to just specify the minor (but not patch)
version. Travis will also use the latest know patch release in this
case.
2018-01-18 10:38:39 -08:00
Jon Parise
c0cebe5d19
Avoid using String.Casing.titlecase_once/1 (#317)
This is a private Elixir library function, and its arity changed to
`/2` in Elixir 1.6 to support a new `mode` parameter.
2018-01-18 10:37:36 -08:00
Jon Parise
19782388a4
Fix heredoc indentation (#315) 2018-01-18 09:16:13 -08:00
Jon Parise
50c575831e
Switch to using "Error" as our exception suffix (#314)
This is more consistent with Elixir's own naming conventions. It also
removes a small amount of ambiguity with code that refers to Thrift's
exceptions; that is, things named "exceptions" in this library are
nearly all Thrift exceptions.
2018-01-10 13:31:49 -08:00
Jon Parise
82396f6da5
Improve the oneway function client-server test (#310)
This test has been flaky because it relies on race conditions.

Force synchronization using :sys.get_state/1 and remove
assertions that can't be guaranteed.
2018-01-08 10:45:48 -08:00
Jon Parise
5de8597ca9
Delegate Client.start_link to ClientImpl (#311) 2018-01-08 10:35:02 -08:00
Jon Parise
0e669da0c8
Further simplify the generated client code (#309)
- We don't need the fullly-qualified service module because we're
  already generating code within it. This improves readability and
  cuts down on the overall size of the generated source file.
- Just use unquote/1 in the response handler macros to reduce the
  amount of generated code that was being produced by bind_quoted.
2018-01-02 20:42:10 -08:00
Jon Parise
116fe03eef
Remove with _with_options function variants (#308)
These were introduced to avoid potential conflicts between our options
parameter (named `opts`) and an `opts` function paramter named by the
Thrift IDL.

This resulted in doubling the number of generated methods (as well as
another level of function call indirection), in addition to making the
resulting user-callable API a little bit more complex.

Instead, go back to using just two generated functions (the "regular"
call and the "bang!" exception-raising variant) and rename our options
parameter to `rpc_opts`, which is very unlikely to conflict in practice.
2018-01-02 12:42:03 -08:00