kunalhiray7

kunalhiray7

Unit test cases break when elixir version upgraded from 1.7.2 to 1.8.0

Hello,

I am a newbie in Elixir-Phoenix. I have an application where the unit test cases were written using ExUnit and mock 0.3.0. The test cases were working fine with Elixir 1.7.2. However, all the test cases are now breaking when I upgraded Elixir version to 1.8.0 with the following error-
** (ErlangError) Erlang error: {:compile_forms, {:error, [{[], [{:none, :compile, {:crash, :sys_core_fold, {{:case_clause, {:EXIT, {:function_clause, [{:sys_core_fold, :module, [[{:attribute, 1, :file,…

Here are my dependencies for reference-
{:phoenix, “~> 1.3.1”},
{:phoenix_ecto, “~> 3.2”},
{:mariaex, “~> 0.8.4”},
{:gettext, “~> 0.11”},
{:cowboy, “~> 1.0”},
{:credo, “~> 0.9.1”, only: [:dev, :test], runtime: false},
{:mock, “~> 0.3.0”, only: :test},
{:uuid, “~> 1.1”},
{:ex_aws, “~> 2.0”},
{:ex_aws_s3, “~> 2.0”},
{:hackney, “~> 1.9”},
{:sweet_xml, “~> 0.6”},
{:httpoison, “~> 1.0”},
{:exvcr, “~> 0.10”, only: :test}

The corresponding Erlang/OTP version is 21.
I searched for this kind of issue but no luck so far. Any help would be greatly appreciated.

FYI: The application works fine, the problem is the test cases.

Thanks in advance.

Marked As Solved

kunalhiray7

kunalhiray7

I cleaned the _build. However, it did not solve the issue.

There was an issue with the Erlang meck version. This Erlang meck release has fixed this issue.

I was using mock which was using meck version 0.8.9. I had to upgrade mock version to 0.3.2 so that it can use the correct version of meck.

Thanks @Fl4m3Ph03n1x and @dimitarvp for the help.

Also Liked

Fl4m3Ph03n1x

Fl4m3Ph03n1x

Try deleting your build folder and deps folders and then do mix do deps.get, compile, test.

dimitarvp

dimitarvp

Try these in your shell:

rm -rf _build
rm -rf deps
mix do deps.get, test

Where Next?

Popular in Questions Top

srinivasu
How to handle excepions in elixir? Suppose i have A, B, C ,D, E modules. and each module has get() function. A.get() method will call th...
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
yawaramin
In the Dialyzer docs ( http://erlang.org/doc/man/dialyzer.html#requesting-or-suppressing-warnings-in-source-files ), there is a way to tu...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
logicmason
Hi there, I'm working through my first release with elixir/phoenix. I've built a release with distillery and found that it crashes when I...
New
lk-geimfari
What is most correct way to open, read and parse JSON file with poison? For example if we have example.json file in root of some projec...
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
baxterw3b
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
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
Mooodi
Given a string, how can I get access to its character by index? Enum.at("my_string", 2) doesn't work. Or rather, not char, but a substr...
New

Other popular topics Top

chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 30048 115
New
yurko
Here are few pieces of (common) Linux knowledge that we use for reasonably small one server apps. We use Ubuntu but this should work for ...
New
_russellb
I want to try my hand at web scraping. What tools/libraries do I need to use. I’m hoping to turn this into something professional so don’...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
vac
Hi, I'm quite new in Elixir and I'm trying to format a string to a PEM format. I have the certificate value like MIIDBTCCAe2...... and ...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
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
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
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
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New

We're in Beta

About us Mission Statement