Skip to content

chore: upgrade deps to latest versions #584

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 35 additions & 39 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,33 @@
name: Test

on: [push, pull_request]
on: [pull_request]

jobs:
test:
Test:
runs-on: ubuntu-latest
name: OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}}
strategy:
matrix:
elixir:
- 1.13-slim # otp 24
- 1.12-slim # otp 24
- 1.11-slim # otp 23
- 1.10-slim # otp 22
container:
image: elixir:${{ matrix.elixir }}
- 1.14
- 1.13
otp:
- 25.3
- 24.3
steps:
- uses: actions/checkout@v2
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: ${{ matrix.elixir }}
otp-version: ${{ matrix.otp }}
version-type: strict
- name: Restore dependencies cache
uses: actions/cache@v2
with:
path: deps
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-mix-
- name: Install Dependencies
env:
MIX_ENV: test
Expand All @@ -26,42 +38,26 @@ jobs:
- name: Run Tests
run: mix test --trace

test-poison3:
Linting:
runs-on: ubuntu-latest
container:
image: elixir:1.10-slim
steps:
- uses: actions/checkout@v2
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: '1.13'
otp-version: '24.3'
version-type: strict
- name: Restore dependencies cache
uses: actions/cache@v2
with:
path: deps
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-mix-
- name: Install Dependencies
env:
MIX_ENV: test
LOCKFILE: poison3
run: |
mix local.rebar --force
mix local.hex --force
mix deps.get
- name: Run Tests for poison 3.x
env:
MIX_ENV: test
LOCKFILE: poison3
run: mix test --trace

Linting:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v1

- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: "1.14"
otp-version: "24.3"

- name: Install Dependencies
run: |
mix local.rebar --force
mix local.hex --force
mix deps.get
- name: Run Formatter
run: mix format --check-formatted
- name: Check Format
run: mix format --check-formatted
2 changes: 1 addition & 1 deletion config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Config

config :tesla, adapter: Tesla.Adapter.Httpc

if Mix.env() == :test do
if config_env() == :test do
config :logger, :console,
level: :debug,
format: "$date $time [$level] $metadata$message\n"
Expand Down
16 changes: 7 additions & 9 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,14 @@ defmodule Tesla.Mixfile do
{:fuse, "~> 2.4", optional: true},
{:telemetry, "~> 0.4 or ~> 1.0", optional: true},

# testing & docs
{:opentelemetry_process_propagator, "~> 0.1", only: [:test, :dev]},
{:excoveralls, "~> 0.8", only: :test},
# devtools
{:opentelemetry_process_propagator, ">= 0.0.0", only: [:test, :dev]},
{:excoveralls, ">= 0.0.0", only: :test, runtime: false},
{:ex_doc, ">= 0.0.0", only: :dev, runtime: false},
{:mix_test_watch, ">= 0.0.0", only: :dev},
{:dialyxir, ">= 0.0.0", only: [:dev, :test], runtime: false},
{:inch_ex, ">= 0.0.0", only: :docs},
{:httparrot, "~> 1.3", only: :test},
{:ex_doc, "~> 0.21", only: :dev, runtime: false},
{:mix_test_watch, "~> 1.0", only: :dev},
{:dialyxir, "~> 1.0", only: [:dev, :test], runtime: false},
{:inch_ex, "~> 2.0", only: :docs},

# override httparrot dependencies
{:cowlib, "~> 2.9", only: :test, override: true},
{:ranch, "~> 1.8", only: :test, override: true}
]
Expand Down
40 changes: 20 additions & 20 deletions mix.lock

Large diffs are not rendered by default.

26 changes: 0 additions & 26 deletions test/lockfiles/poison3.lock

This file was deleted.

4 changes: 2 additions & 2 deletions test/support/adapter_case.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ defmodule Tesla.AdapterCase do
defmacro __using__(adapter: adapter) do
quote do
@adapter unquote(adapter)
@http "http://localhost:#{Application.get_env(:httparrot, :http_port)}"
@https "https://localhost:#{Application.get_env(:httparrot, :https_port)}"
@http "http://localhost:#{Application.compile_env(:httparrot, :http_port)}"
@https "https://localhost:#{Application.compile_env(:httparrot, :https_port)}"

defp call(env, opts \\ []) do
case @adapter do
Expand Down
5 changes: 1 addition & 4 deletions test/tesla/adapter/ibrowse_test.exs
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
defmodule Tesla.Adapter.IbrowseTest do
use ExUnit.Case

use Tesla.AdapterCase, adapter: Tesla.Adapter.Ibrowse

use Tesla.AdapterCase.Basic
use Tesla.AdapterCase.Multipart
use Tesla.AdapterCase.StreamRequestBody

# SSL test disabled on purpose
# ibrowser seems to have a problem with "localhost" host, as explined in
# ibrowser seems to have a problem with "localhost" host, as explained in
# https://github.com/cmullaparthi/ibrowse/issues/162
#
# In case of the test below it results in
Expand Down
2 changes: 1 addition & 1 deletion test/tesla_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule TeslaTest do

require Tesla

@url "http://localhost:#{Application.get_env(:httparrot, :http_port)}"
@url "http://localhost:#{Application.compile_env(:httparrot, :http_port)}"

describe "Adapters" do
defmodule ModuleAdapter do
Expand Down
2 changes: 0 additions & 2 deletions test/test_helper.exs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
clients = [:ibrowse, :hackney, :gun, :finch, :castore, :mint]
Enum.map(clients, &Application.ensure_all_started/1)

ExUnit.configure(trace: false)
ExUnit.start()