mudasobwa
I wanted to release v0.1.0 of this library in 2023, that’s why it’s still very much WIP, although fully functional already.
There was an intent to bring common_test to Elixir by @hauleth, but it seems dead.
I needed to use :peer for some specific tests and I started by adopting it for Elixir users. Soon I figured out, I wanted common_test to be easily usable from Elixir and apparently we have everything already in place to make it as easy as use Enfiladex.
Usage: add :enfiladex dependency and put use Enfiladex.Suite after use ExUnit.Case in your tests to make them run by common_test with newly introduced task MIX_ENV=test iex --sname am -S mix enfiladex.
Limitations:
on_exit/2callbacks with captures makes test to fail compiling withuse Enfiladex(Code.with_diagnostics/2issue),Enfiladex.{peer/3, multi_peer_/3}fail from tests with an anonymous function,MIX_ENV=test iex --sname am -S mix enfiladex(named node) to execute common test,- compiled
beamfiles are not yet removed.
I have no issues fixing all but the first one. It’s induced by Code.with_diagnostics/2 leaving error in the compiler errors accumulator even if handled and processed when executed in compile time.
I need it to detect whether on_exit/2 might be reused as end_per_*** callbacks in common_test. If it grabs context variables, it should be discarded. I am most likely to file an issue in Elixir core, although I understand this use-case is extremely uncommon.
Everything else is kinda working, as well as exported from Enfiladex functions
peer(fun, callback \\ [], config \\ [])multi_peer(fun, callback \\ [], config \\ [])
Both accept a function to be executed on :peer, a callback, and an optional config:
transfer_config::boolean()start_applications::boolean()nodes_count::non_neg_integer()
The docs are pending. Enjoy! enfiladex v0.3.1 — Documentation
P. S. one might test it with running MIX_ENV=test iex --sname am -S mix enfiladex in enfiladex itself after git clone.
Trending in Announcing
Other Trending Topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #blog-post
- #elixir-ls
- #ai
- #elixirconf-us
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 2- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
mudasobwa
Fixed some cosmetics and introduced tasks.
...in both cases are passed tests.mudasobwa
I am glad to introduce the first stable release,
Enfiladex v0.2.0.It has helpers to run functions on freshly spawned remote nodes via
Enfiladex.peer/3andEnfiladex.multi_peer/3as well as spawn nodes withEnfiladex.start_peers/1(to be stopped withEnfiladex.stop_peers/1afterward.)Also, it might be used as a drop-in support for both ExUnit and Erlang Common Test simultaneously (with a known limitation of freaky
on_exit/2handling when the function grabs a context, I am working on it.)Enfiladexis tested with itself, providing both Common Test and ExUnit tests at once.Example of using spawned node in
cloistertests.Comments, issue reports, and feature requests are very welcome.