Skip to content
Permalink
Browse files
Fix Elixir 13 compatibility
Elixir 13 is the only one which seems to work with Erlang 25.

But we can't use Elixir 13 because of a few compatibility issues so have to fix
this. That involves upgrading credo. However, as soon as credo was upgraded it
noticed a bunch of issues which also had to be fixed. Some of those were:

 * Enum.map + join should be Enum.map_join
 * Invalid module name in teardown `%___MODULE__` -> `%__MODULE__`
 * `Mix.Config` is deprecated, use `Config`
 * `db_test.ex` looks like a test module to credo, so renamed it, otherwise it has to have an .exs extension
 * ibrowse had to be compiled so it could be properly analysed

Tested on macos (intel) with asdf installed elixir and erlang:
```
  25.0.1    / 1.13.4-otp-25
  24.3.4.1  / 1.13.4-otp-24
  23.3.4.14 / 1.10.4-otp-23
```
  • Loading branch information
nickva committed Jun 30, 2022
1 parent b424ad1 commit c605e04582e713120bde664b9ce51241ba9ff2e9
Show file tree
Hide file tree
Showing 12 changed files with 14 additions and 15 deletions.
@@ -1,6 +1,6 @@
# This file is responsible for configuring your application
# and its dependencies with the aid of the Mix.Config module.
use Mix.Config
import Config

# This configuration is loaded before any dependency and is restricted
# to this project. If another project depends on this project, this
@@ -27,4 +27,4 @@ use Mix.Config
# Configuration from the imported file will override the ones defined
# here (which is why it is important to import them last).
#
import_config "#{Mix.env}.exs"
import_config "#{Mix.env}.exs"
@@ -1 +1 @@
use Mix.Config
import Config
@@ -1,4 +1,4 @@
use Mix.Config
import Config

config :logger,
backends: [:console],
@@ -1 +1 @@
use Mix.Config
import Config
@@ -1,4 +1,4 @@
use Mix.Config
import Config

config :logger,
backends: [:console],
@@ -91,9 +91,8 @@ defmodule CouchDBTest.Mixfile do
{:b64url, path: Path.expand("src/b64url", __DIR__)},
{:jiffy, path: Path.expand("src/jiffy", __DIR__)},
{:jwtf, path: Path.expand("src/jwtf", __DIR__)},
{:ibrowse,
path: Path.expand("src/ibrowse", __DIR__), override: true, compile: false},
{:credo, "~> 1.5.6", only: [:dev, :test, :integration], runtime: false}
{:ibrowse, path: Path.expand("src/ibrowse", __DIR__), override: true},
{:credo, "~> 1.6.4", only: [:dev, :test, :integration], runtime: false}
]
end

@@ -1,7 +1,7 @@
%{
"bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [:mix], [], "hexpm", "7af5c7e09fe1d40f76c8e4f9dd2be7cebd83909f31fee7cd0e9eadc567da8353"},
"certifi": {:hex, :certifi, "2.5.1", "867ce347f7c7d78563450a18a6a28a8090331e77fa02380b4a21962a65d36ee5", [:rebar3], [{:parse_trans, "~>3.3", [hex: :parse_trans, repo: "hexpm", optional: false]}], "hexpm", "805abd97539caf89ec6d4732c91e62ba9da0cda51ac462380bbd28ee697a8c42"},
"credo": {:hex, :credo, "1.5.6", "e04cc0fdc236fefbb578e0c04bd01a471081616e741d386909e527ac146016c6", [:mix], [{:bunt, "~> 0.2.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2.8", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "4b52a3e558bd64e30de62a648518a5ea2b6e3e5d2b164ef5296244753fc7eb17"},
"credo": {:hex, :credo, "1.6.4", "ddd474afb6e8c240313f3a7b0d025cc3213f0d171879429bf8535d7021d9ad78", [:mix], [{:bunt, "~> 0.2.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2.8", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "c28f910b61e1ff829bffa056ef7293a8db50e87f2c57a9b5c3f57eee124536b7"},
"excoveralls": {:hex, :excoveralls, "0.12.1", "a553c59f6850d0aff3770e4729515762ba7c8e41eedde03208182a8dc9d0ce07", [:mix], [{:hackney, "~> 1.0", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "5c1f717066a299b1b732249e736c5da96bb4120d1e55dc2e6f442d251e18a812"},
"file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"},
"hackney": {:hex, :hackney, "1.15.2", "07e33c794f8f8964ee86cebec1a8ed88db5070e52e904b8f12209773c1036085", [:rebar3], [{:certifi, "2.5.1", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "6.0.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "1.0.1", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~>1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "1.1.5", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}], "hexpm", "e0100f8ef7d1124222c11ad362c857d3df7cb5f4204054f9f0f4a728666591fc"},
@@ -1,4 +1,4 @@
Code.require_file "../../../../couchdb/test/elixir/lib/couch.ex", __DIR__
Code.require_file "../../../../couchdb/test/elixir/test/test_helper.exs", __DIR__
Code.require_file "../../../../couchdb/test/elixir/test/support/couch_test_case.ex", __DIR__
Code.require_file "../../../../couchdb/test/elixir/lib/couch/db_test.ex", __DIR__
Code.require_file "../../../../couchdb/test/elixir/lib/couch/dbtest.ex", __DIR__
@@ -1,6 +1,6 @@
# This file is responsible for configuring your application
# and its dependencies with the aid of the Mix.Config module.
use Mix.Config
import Config

# This configuration is loaded before any dependency and is restricted
# to this project. If another project depends on this project, this
File renamed without changes.
@@ -59,7 +59,7 @@ defmodule Couch.Test.Setup.Step.Start do
}
end

def teardown(_setup, %___MODULE__{test_ctx: test_ctx}) do
def teardown(_setup, %__MODULE__{test_ctx: test_ctx}) do
:test_util.stop_couch(test_ctx)
end

@@ -82,4 +82,4 @@ defmodule Couch.Test.Setup.Step.Start do
for {x, _, _} <- Application.started_applications, do: x
end

end
end
@@ -61,7 +61,7 @@ defmodule Couch.Test.Suite do
def pretty_print(tests) do
tests = Enum.join(Enum.sort(Enum.map(tests, fn {module_name, test_names} ->
test_names = test_names
|> Enum.map(fn x -> ~s("#{x}") end) |> Enum.join(",\n ")
|> Enum.map_join(fn x -> ~s("#{x}") end, ",\n ")
~s( "#{module_name}": [\n #{test_names}\n ])
end)), ",\n")
"%{\n#{tests}\n}"

0 comments on commit c605e04

Please sign in to comment.