marpo60

marpo60

Blend - test your package against different versions of its dependencies

We developed Blend a new hex package that solves the problem of testing your library against different version of its dependencies.

For example, an elixir package that depends on plug_crypto with a requirement of ~> 1.2 or ~> 2.0 , that wants to test against the two major versions, would normally have it’s mix.lock resolved to 2.x .

So there is no straightforward way of running your test locally and in the CI against 1.x and 2.x.

Blend tries to solve this. Inspired in a similar tool that exists in the ruby ecosystem called appraisal

You can create different blends and it will take care of you in generating alternative mix lockfiles and a simple way of running test against them.

Hope you like it!

Most Liked

tiagoefmoraes

tiagoefmoraes

Hey Marcelo, thanks for Blend , it’s awesome.

I just merged Surface’s PR and added it to Surface Catalogue

blend/premix.exs is very powerful, I could make custom modifications that Surface Catalogue needed.

Blend makes working with a local copy of Surface simple (BLEND=local mix ...) and fast because each blend has it’s own deps and _build directories.

marpo60

marpo60

There is a new article showing how to add blend to your existing package.

marpo60

marpo60

Hi Eiji,

For example in Github Actions you can achieve 1 and 2 using the matrix feature with blend.

We have been using blend in candlex for testing against different version of nx (0.6 and 0.7 in this case)

Initial implementation and follow up

At the end of the day it would look like this in your CI workflow

      matrix:
         include:
           - elixir_version: 1.16.0
             otp_version: '26.2.1'
             lint: true
           - elixir_version: 1.15.7
             otp_version: '25.3.2.8'
           - elixir_version: 1.15.7
             otp_version: '25.3.2.8'
             blend: "nx06"

You can take a look at the full CI workflow here

Eiji

Eiji

I only read this post and have few questions:

  1. Do you support different Erlang and Elixir versions as well? (asdf support for example)
  2. Does it only tests code or can it also detect if current project compiles with or without warnings?
  3. By using your package can I detect minimum supported package version and also minimum supported package version excluding soft-deprecate warnings?

I guess that the answer for all is no, but I may be wrong. Anyway, do you think about those points? Are they interesting features to add to your hex package?

Where Next?

Popular in Libraries Top

marcuslankenau
I feel kind of stuck with the absence of a proper xml library for Elixir. Currently I use SweetXML which was ok for me more or less to pa...
New
tmbb
I’ve been working on two packages (not on hex.pm yet) to build admin interfaces for phoenix apps: bureaucrat - which contains a bunch ...
New
devonestes
Introducing assertions, the library that helps you write really great test assertions! GitHub: https://github.com/devonestes/assertions ...
New
sasajuric
I’d like to announce a small library called boundaries. This is an experimental project which explores the idea of enforcing boundaries ...
New
OvermindDL1
Been making an MLElixir thing (not released yet…) for fun in spare time in the past day. I’m just trying to see how much I can get an ML...
132 13487 106
New
danschultzer
In short Plug n’ play OAuth 2.0 provider library. Just set up a resource owner schema with Ecto (your user schema), install the dependen...
New
tfwright
After working on it for a couple of months and using it in production for most of that time, today I’ve released LiveAdmin, a LiveView ba...
New
Crowdhailer
I have been updating a library that allows you to pipe between functions that use the erlang result tuple convention. Assuming you have...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 42633 214
New
gjaldon
As the title states, EctoEnum has just been updated after some time of hardly any activity in the repo. Here’s the latest release: https:...
New

Other popular topics Top

JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1140 51847 244
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
William
I would like to know that is there any online source for learning Phoenix Framework for building E-Commerce Store? Any advantage on build...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 49522 488
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? https://hexdocs.pm/ecto/Ecto.Repo.h...
New
chrisalley
ExUnit now has describe blocks which is a welcome addition coming from RSpec. In the docs, it states that nested hierarchies of describe ...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New

Sub Categories:

We're in Beta

About us Mission Statement