ExUnited - Easily spawn Elixir supervising nodes within ExUnit tests

ExUnited  is a Hex package designed to easily facilitate spawning  supervising  local Elixir nodes within tests. Unfortunately, I was not able to properly setup a spawned node for supervisioning with the Erlang  :slave.start_link/1  function. So I have written  ExUnited  to accomplish that, along with supporting  Mix.Config  configurations, additional loaded code, and a developer friendly way of writing assertions and refutations in the context of a spawned node which really improved the readability of the tests and more.

Features

  • Spawn nodes for testing purposes
  • Spin up “partially connected” vs “fully connected” nodes
  • Run in “verbose” mode which prints a colorized STDOUT of the nodes
  • Specify extra “code paths” which will be included ( config.exs  included)
  • Support child supervisioning within a spawned node
  • Exclude certain dependencies for spawned nodes
  • Easily assert and refute within the context of spawned nodes

Example

defmodule MyNodeClusterTest do
  use ExUnited.Case

  setup do
    {:ok, spawned} =
      ExUnited.spawn(
        david: [code_paths: ["test/nodes/beckham"], supervise: [David]]
      )

    on_exit(fn ->
      ExUnited.teardown()
    end)

    spawned
  end

  test "executes code in spawned node", spawned do
    assert :"[email protected]" = Node.self()
    refute :"[email protected]" == Node.self()
    sentence = "The only time you run out of chances is when you stop taking them."

    as_node(:david, phrase: sentence) do
      assert :"[email protected]" = Node.self()
      refute :"[email protected]" == Node.self()
      assert ^phrase = David.talk()

      foo = :bar
      refute match?(%{node: ^foo}, %{node: :foo})
    end
  end
end

See full example.

Enjoy the package! I would love to receive a shoutout and/or your feedback ;)

AyeSQL: Writing Raw SQL in Elixir

A small tutorial on how, why and when to use raw SQL, as well as giving some examples using Ecto and AyeSQL.

AyeSQL: Writing Raw SQL in Elixir

Deploying to Gigalixir Tutorial

Gigalixir is Elixir’s Platform as a Service. In this episode we create and deploy a new Elixir application with Gigalixir.

https://elixircasts.io/deploying-with-gigalixir-%28revised%29

ElixirWeekly: The Elixir Community Newsletter, covering community news you easily miss, shared on ElixirStatus and the web, in one email every Thursday.

Custom IEx Prompt : Elixir

You might be bored being locked down and using the same default IEx prompt. Let’s turn our boredom interesting by decorating IEx look out.

Check out the Setup and Installation

https://medium.com/@blackode/custom-iex-prompt-elixir-c95b7f5bf8c3Article Image

Simple Elixir wrapper for Covid Tracking API

A simple Elixir wrapper for https://covidtracking.com/api: https://github.com/TheFirstAvenger/covidtracking_dot_com_api

gen_rmq 2.6.0 version release

GenRMQ is a set of behaviours meant to be used to create RabbitMQ consumers and publishers.

Changelog:

With the redesigned queue configuration options, users have bigger flexibility in creating their desired consumer setup. This includes support for quorum queues as well. Check our documentation to learn more: https://github.com/meltwater/gen_rmq#documentation

Files watcher and compiler for elixir projects (only: :dev) 😉

Lettuce is a generic server process that checks the files within an elixir project that has lettuce as a dependency and then runs iex -S mix. It initialises the state of the generic server with the .ex files inside lib and their last modified time.

https://github.com/gilacost/lettuce

Elixir Wizards S3E19 Season Three Wrap and Remote Work Tips

Final episode of the Elixir Wizards Podcast third season. Check it out here: https://podcast.smartlogic.io/s3e19-season-wrap

Simple DIY Persistence for Mailgun

We created and open sourced a small tool to persist events from Mailgun, since the retention they offer is expensive. Mailgun boost a fantastic tool, we just wanted simple logging in case we needed it. Fork, run the source or use the docker container.

https://jackjoe.be/articles/mailgun-logger/

ElixirWeekly: The Elixir Community Newsletter, covering community news you easily miss, shared on ElixirStatus and the web, in one email every Thursday.

For comprehensions in Elixir

Going beyond simple mapping - a refresher on comprehensions and what they can do.

https://www.pompecki.com/post/for-comprehensions/

Looking for help maintaing Ace, an Elixir HTTP Server

https://elixirforum.com/t/help-maintaining-elixir-http-2-server-nearly-at-1-0-release/30279

I’m not able to spend as much time looking after Ace as I would like and am looking for some help.

Share my Elixir journey in GO.Exchange

GO.Exchange is a cryptocurrency exchange which adopt Elixir in production. I’ve worked on this product for almost 2 years. I think would benefit to share what I’ve learnt in this journey.

https://medium.com/@theesit/my-elixir-journey-in-go-exchange-3d9934e53790

mix.el - new Emacs Minor Mode for Mix

I’ve been using alchemist and its built-in functions to work with mix tasks from Emacs: to execute a specific test, to execute tests in a file, to list all tasks etc. They work ok if you don’t work with umbrella apps. Umbrella project is an application split into multiple subprojects. alchemist uses custom Elixir app under the hood. This Elixir app is initialized only for a specific application. So it’s either initialized for a subproject or an umbrella project. Maybe there are customizable variables that allow you to work with umbrella projects and subprojects at the same time but I couldn’t find any.

I spend my days writing Elixir code and sometimes I want to execute a Mix task from the root directory for the whole project (for example, to run a credo check) and sometimes I want to execute a task from a subproject (for example, to fetch deps only for this subproject). mix.el allows you to do it. Also, it allows you to add additional parameters before executing a mix task.

ElixirMix Podcast 091: Managing Change with Ecto and David Bernheisel

In this episode of ElixirMix, we talk with David Bernheisel about the power in Ecto. Coming from ActiveRecord, Ecto and Changesets were a wonderful alternative! We cover David’s blog post where he shares tips and tricks for working with Changesets. We cover, Ecto.Multi, how to compose Changesets, “embedded” schemas, and much more!

Podcast Episode

Single Sign On Auth with Pow Assent

https://youtu.be/eic29sMwdJ4

Create an Elixir app that authenticates users with Strava as an OAuth2 provider, and lists users recent activities by making requests against Strava’s API.

ALEx: (A)rcade (L)earning (E)nvironment for Eli(x)ir

https://github.com/seanmor5/alex

ALEx makes it easy to write AI Agents for Atari 2600 games in Elixir using the ALE Framework.

CsvGenerate, an easy way to generate CSV

I am converting a Rails app to Phoenix and have to convert a number of CSV reports, so I searched but did not find an easy to use library to generate CSV files. I wanted something a bit like Ecto.Schema , so CsvGenerate was born, https://hex.pm/packages/csv_generator

Sales of Phoenix Inside Out book series to help COVID affected people

During this difficult times of Corona Pandemic, I am helping my local community of drivers, daily wagers, homemaids who are financially affected by loss of jobs. Their lives are threatened with no financial means to meet out their basic needs of their families.

To help them, 100% sales of my books https://shankardevy.com/phoenix-book/ will go towards helping people financially affected by COVID until further notice.

Simple Phoenix LIveView App: New & Form Validations

Part 6 of the Simple Phoenix LiveView App series.

In this episode, we’ll start converting the new users page and form into live views. In the process, we’ll get to see LiveView and Phoenix form validations in action.

https://alchemist.camp/episodes/phoenix-live-view-form-validations

Tensorflow Serving in Elixir

A blog post explaining how to call Tensorflow Serving from Elixir via gRPC.

We use it to make our computer guess hand-written digits! 🤓

https://dnlserrano.dev/2020/03/28/tensorflow-serving-elixir.html