goofansu

goofansu

Is there a conflict for ensure_consistency alias in book Adopting Elixir?

In the AUTOMATING YOUR CONSISTENCY CHECKS, there is an alias:

    def​ aliases ​do​
      [
        "ensure_consistency"​: [​"​​test"​, ​"​​dialyzer"​, ​"​​credo --strict"​, ​"​​inch"​, ​"​coveralls"​]
      ]
    end

When I tried in my own project, it complains:
** (Mix) "mix test" is running on environment "dev". If you are running tests along another task, please set MIX_ENV explicitly.

I suppose it should execute in MIX_ENV=test mix ensure_consistency, but in previous chapters, the deps are:

    ​defp​ deps ​do​
​ 	  [
​ 	    {​:credo​, ​"​​~> 0.8.8"​, ​only:​ [​:dev​], ​runtime:​ false},
​ 	    {​:dialyxir​, ​"​​~> 0.5"​, ​only:​ [​:dev​], ​runtime:​ false},
​ 	    {​:excoveralls​, ​"​​~> 0.7.4"​, ​only:​ [​:test​], ​runtime:​ false},
​ 	    {​:ex_doc​, ​"​​~> 0.18"​, ​only:​ [​:dev​], ​runtime:​ false},
​ 	    {​:inch_ex​, ​"​​~> 0.5"​, ​only:​ [​:dev​, ​:test​], ​runtime:​ false}
​ 	  ]
​ 	​end​

So the credo and dialyxir are available only in dev mode while excoveralls only in test mode, it seems existing a conflict.

Is there something wrong? Thanks

Most Liked

goofansu

goofansu

I changed the deps as following, and run MIX_ENV=test mix ensure_consistency, it works.

    defp​ deps ​do​
​ 	  [
​ 	    {​:credo​, ​"​​~> 0.8.8"​, ​only:​ [​:dev​, :test], ​runtime:​ false},
​ 	    {​:dialyxir​, ​"​​~> 0.5"​, ​only:​ [​:dev​, :test], ​runtime:​ false},
​ 	    {​:excoveralls​, ​"​​~> 0.7.4"​, ​only:​ [​:test​], ​runtime:​ false},
​ 	    {​:ex_doc​, ​"​​~> 0.18"​, ​only:​ [​:dev​], ​runtime:​ false},
​ 	    {​:inch_ex​, ​"​​~> 0.5"​, ​only:​ [​:dev​, ​:test​], ​runtime:​ false}
​ 	  ]
​ 	​end​

But “coveralls” cannot output anything. If I run mix converalls, it have the output.

josevalim

josevalim

Creator of Elixir

I believe there is a :preferred_cli_env configuration you should set too.

Where Next?

Popular in Chat/Questions Top

sadcad
I love the Phoenix and Elixir docs, but I always tend to learn faster when I watch a video of someone explaining things and then I implem...
New
Lincxx
Hello, I’m sure this has been asked a bunch, but where to start. I do prefer vodeos over books, but recently I have found books to be mor...
New
dopomecana
The title of this topic may sound silly at the first glance. But why I trying to ask you guys is how to go to the next level? I am curre...
New
New
SavagePixie
I was wondering if there are any beginner-friendly, exercise-based resources for learning Elixir out there. I’m looking for something lik...
New
Kielo
Hi, I run a language learning blog and would like to learn how to code so I can create an app to help English speakers learn French. I ...
New
Scoty
Hey, I am currently reading Programming Elixir and I am doing one of the exercises where you should write a solution to the “I’m thinkin...
New
Chawki
Hi,i’m new to elixir. i’m searching elixir small programs to try it out my self,Is any good resources out there? Thank you.
New
InkFlo
Hi everyone, This year I’m graduated from Bachelor Degree (in computer science) from France (not really a bachelor, the exact term is “L...
New
Besto
I’ve been trying to start learning Elixir for a couple of weeks while I develop a tiny project I have on node.js, but every time I try to...
New

Other popular topics Top

vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
hariharasudhan94
lets say i have a sample like a = 20; b = 10; if (a > b) do {:ok, "a"} end if (a < b) do {:ok, b} end if (a == b) do {:ok, "equa...
New
marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New
AstonJ
Please see the new poll here: Which code editor or IDE do you use? (Poll) (2022 Edition) It’s been a while since we first asked this, I...
208 31265 143
New
vonH
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
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 52673 488
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement