RicoTrevisan
How to test a Burrito-wrapped app?
I was having a hard time running tests and wrapping my tiny app with Burrito so I came up with this strategy, but I wasn’t sure if this is the best way to go about it.
Is there a simpler way to do it?
# config.exs
import Config
config :pled, compile_env: Mix.env()
# application.ex
defmodule Pled.Application do
use Application
alias Pled.CLI
@impl true
def start(_type, _args) do
env = Application.get_env(:pled, :compile_env)
if env == :test do
children = []
opts = [strategy: :one_for_one, name: Pled.Supervisor]
Supervisor.start_link(children, opts)
else
Burrito.Util.Args.argv()
|> CLI.parse_args()
|> CLI.handle_command()
System.halt(0)
end
end
end
Most Liked
Schultzer
LostKobrakai
:peer iirc allows testing beam applications even if e.g. wrapped in a docker image. I‘d expect that could also be done to burrito binaries with a bit of setup.
1
Popular in Questions
Hello, how can I check the Phoenix version ?
Thanks !
New
I’ve read in another post that it may be possible with a router helper - but I couldn’t find an appropriate one, and tbh, I’m still just ...
New
Hi guys, i’m new in the Elixir world, and i have to say, that i love it!
i’m having some problem to understand anonymous functions with ...
New
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? Ecto.Repo — Ecto v3.14.0 has exampl...
New
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
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
Other popular topics
Update:
How to use the Blogs & Podcasts section
You can post links to your blog posts or podcasts either in one of the Official Blog...
New
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine)
This is a plugin that adds support for Elixir to JetBrains IntelliJ...
New
Hello, how can I check the Phoenix version ?
Thanks !
New
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
Hello!
tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability.
After spen...
New
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New
Latest in /Elixir Desktop
Latest on Elixir Forum
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
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #hex










