travisf

travisf

About 8 months ago we updated a large project from Elixir 1.8 to 1.10.4 and from Phoenix 1.3.0 to 1.4.17.
Ever since then we get so many depreciation warnings in the test suite that it is actually difficult to read the tests. They are of all types:

.warning: the :headers option is deprecated, please use :skip_headers instead
  (nimble_csv 0.7.0) lib/nimble_csv.ex:330: NimbleCSV.RFC4180.parse_stream/2
warning: passing float to Decimal.new/1 is deprecated as floats have inherent inaccuracy. Use Decimal.from_float/1 or Decimal.cast/1 instead
  (decimal 1.9.0) lib/decimal.ex:1187: Decimal.new/1
  (ecto 2.2.12) lib/ecto/type.ex:587: Ecto.Type.cast/2
  (ex_machina 2.4.0) lib/ex_machina/ecto_strategy.ex:62: ExMachina.EctoStrategy.cast_value/3

Most of the warnings are related to Decimal.new/1 which I get and could be fixed by upgrading ex_machina and number but that leads to a whole other cascade of problems which I’m not equipped to handle right now.
Is there a way I can quite these logs for now?
I’ve tried updating the config/test.exs files with config :logger, level: :error and that dosen’t seem to do anything.

Showing Posts 1 to 6

sanswork

sanswork

The reason the config change doesn’t work is that those are compiler warnings not runtime warnings. As far as I know there is no way to disable the display of compile warnings.

axelson

axelson

Scenic Core Team

If this is only in CI then you could run a prior step like MIX_ENV=test mix deps.compile, then your mix test output section will be much cleaner.

travisf

travisf OP

Thanks for the responses, unfortunately running MIX_ENV=test mix deps.compile does not clean up things when I test locally.
After looking closely at the warnings it seems about 90% originate with ExMachina:

warning: passing float to Decimal.new/1 is deprecated as floats have inherent inaccuracy. Use Decimal.from_float/1 or Decimal.cast/1 instead
  (decimal 1.9.0) lib/decimal.ex:1187: Decimal.new/1
  (ecto 2.2.12) lib/ecto/type.ex:587: Ecto.Type.cast/2
  (ex_machina 2.7.0) lib/ex_machina/ecto_strategy.ex:72: ExMachina.EctoStrategy.cast_value/3
  (ex_machina 2.7.0) lib/ex_machina/ecto_strategy.ex:58: anonymous fn/2 in ExMachina.EctoStrategy.cast_all_fields/1
  (elixir 1.10.4) lib/enum.ex:2111: Enum."-reduce/3-lists^foldl/2-0-"/3
  (ex_machina 2.7.0) lib/ex_machina/ecto_strategy.ex:49: ExMachina.EctoStrategy.cast/1
  (ex_machina 2.7.0) lib/ex_machina/ecto_strategy.ex:25: ExMachina.EctoStrategy.handle_insert/2
  (elixir 1.10.4) lib/stream.ex:1355: Stream.do_repeatedly/3
  (elixir 1.10.4) lib/enum.ex:2789: Enum.take/2
 ...controller_test.exs

Which is odd to me, I am using ExMachina 2.7.0. Do I need to update Ecto as well?

travisf

travisf OP

Bumping phoenix_ecto from 3.0 to 3.6.0 seems to have fixed the issue there. I started down that route last week but I kept running into dependency issues, I must have just grabbed the perfect version or inadvertently fixed something else.

vrod

vrod

Just for reference, mix hex.outdated is a helpful way to show dependencies that are out of date.

eksperimental

eksperimental

mix test --trace --seed 0 to run them one by one, in a non-random deterministic way. You can pick the issues out one by one.

— All posts loaded —

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
FlyingNoodle
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews