Skip to content

Commit

Permalink
fix various problems breaking CI (#839)
Browse files Browse the repository at this point in the history
  • Loading branch information
aymanosman committed May 6, 2024
1 parent 73faf6d commit 4e9a8cc
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 12 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
STRIPE_MOCK_VERSION: 0.144.0
STRIPE_SECRET_KEY: non_empty_string
SKIP_STRIPE_MOCK_RUN: true
SHELL: /bin/bash # erlexec needs this
runs-on: ubuntu-20.04
name: Test (OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}})
strategy:
Expand Down
4 changes: 4 additions & 0 deletions config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ import Config
if File.exists?("config/config.secret.exs") do
import_config "config.secret.exs"
end

config :erlexec,
# erlexec is very particular about how it is run as root
user: System.get_env("USER")
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ defmodule Stripe.Mixfile do
# Non-production dependencies
{:inch_ex, ">= 0.0.0", only: [:dev, :test]},
{:mox, ">= 0.0.0", only: :test},
{:exexec, "~> 0.2.0", only: :test},
{:erlexec, "~> 2.0", only: :test},
{:dialyxir, ">= 0.0.0", only: [:dev, :test], runtime: false},
{:ex_doc, ">= 0.0.0", only: :dev, runtime: false},
{:excoveralls, ">= 0.0.0", only: :test}
Expand Down
3 changes: 1 addition & 2 deletions mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
"dialyxir": {:hex, :dialyxir, "1.4.3", "edd0124f358f0b9e95bfe53a9fcf806d615d8f838e2202a9f430d59566b6b53b", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "bf2cfb75cd5c5006bec30141b131663299c661a864ec7fbbc72dfa557487a986"},
"earmark_parser": {:hex, :earmark_parser, "1.4.39", "424642f8335b05bb9eb611aa1564c148a8ee35c9c8a8bba6e129d51a3e3c6769", [:mix], [], "hexpm", "06553a88d1f1846da9ef066b87b57c6f605552cfbe40d20bd8d59cc6bde41944"},
"erlex": {:hex, :erlex, "0.2.6", "c7987d15e899c7a2f34f5420d2a2ea0d659682c06ac607572df55a43753aa12e", [:mix], [], "hexpm", "2ed2e25711feb44d52b17d2780eabf998452f6efda104877a3881c2f8c0c0c75"},
"erlexec": {:hex, :erlexec, "1.21.0", "748af41a9b77fde69bb82d5ec37e37384d4f849f971687de49d57e8cb59422ea", [:rebar3], [], "hexpm", "826616a344d1bc0a35c9d2c7175478166f607a4e3b14c878229fd405694d65c0"},
"erlexec": {:hex, :erlexec, "2.0.6", "b7443121cfb8add8bc25e3db9c1fd79d14613bbc406984264a0bbc62f121f377", [:rebar3], [], "hexpm", "8c4ebc02449f838648d9854d1c4dc7257e57d4ea2098a7e6386348372085ab21"},
"ex_doc": {:hex, :ex_doc, "0.31.1", "8a2355ac42b1cc7b2379da9e40243f2670143721dd50748bf6c3b1184dae2089", [:mix], [{:earmark_parser, "~> 1.4.39", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.1", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1", [hex: :makeup_erlang, repo: "hexpm", optional: false]}], "hexpm", "3178c3a407c557d8343479e1ff117a96fd31bafe52a039079593fb0524ef61b0"},
"excoveralls": {:hex, :excoveralls, "0.18.0", "b92497e69465dc51bc37a6422226ee690ab437e4c06877e836f1c18daeb35da9", [:mix], [{:castore, "~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "1109bb911f3cb583401760be49c02cbbd16aed66ea9509fc5479335d284da60b"},
"exexec": {:hex, :exexec, "0.2.0", "a6ffc48cba3ac9420891b847e4dc7120692fb8c08c9e82220ebddc0bb8d96103", [:mix], [{:erlexec, "~> 1.10", [hex: :erlexec, repo: "hexpm", optional: false]}], "hexpm", "312cd1c9befba9e078e57f3541e4f4257eabda6eb9c348154fe899d6ac633299"},
"hackney": {:hex, :hackney, "1.20.1", "8d97aec62ddddd757d128bfd1df6c5861093419f8f7a4223823537bad5d064e2", [:rebar3], [{:certifi, "~> 2.12.0", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "~> 6.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "~> 1.0.0", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~> 1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "3.4.1", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "~> 1.1.0", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}, {:unicode_util_compat, "~> 0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "fe9094e5f1a2a2c0a7d10918fee36bfec0ec2a979994cff8cfe8058cd9af38e3"},
"idna": {:hex, :idna, "6.1.1", "8a63070e9f7d0c62eb9d9fcb360a7de382448200fbbd1b106cc96d3d8099df8d", [:rebar3], [{:unicode_util_compat, "~> 0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "92376eb7894412ed19ac475e4a86f7b413c1b9fbb5bd16dccd57934157944cea"},
"inch_ex": {:hex, :inch_ex, "2.0.0", "24268a9284a1751f2ceda569cd978e1fa394c977c45c331bb52a405de544f4de", [:mix], [{:bunt, "~> 0.2", [hex: :bunt, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "96d0ec5ecac8cf63142d02f16b7ab7152cf0f0f1a185a80161b758383c9399a8"},
Expand Down
6 changes: 3 additions & 3 deletions test/stripe/payment_methods/payment_method_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ defmodule Stripe.PaymentMethodTest do

describe "list/2" do
test "lists all cards" do
assert {:ok, %Stripe.List{data: cards}} =
Stripe.PaymentMethod.list(%{customer: "cus_123", type: "card"})
params = %{customer: "cus_123", type: "card"}
assert {:ok, %Stripe.List{data: cards}} = Stripe.PaymentMethod.list(params)

assert_stripe_requested(:get, "/v1/payment_methods?type=card&customer=cus_123")
assert_stripe_requested(:get, "/v1/payment_methods", query: params)
assert is_list(cards)
end
end
Expand Down
5 changes: 1 addition & 4 deletions test/stripe/subscriptions/credit_note_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ defmodule Stripe.CreditNoteTest do

assert {:ok, %Stripe.CreditNote{}} = Stripe.CreditNote.preview(params)

assert_stripe_requested(
:get,
"/v1/credit_notes/preview?amount=500&invoice=in_173uNd4Wq104wst7Gf4dgq1Y"
)
assert_stripe_requested(:get, "/v1/credit_notes/preview", query: params)
end
end

Expand Down
4 changes: 2 additions & 2 deletions test/support/stripe_mock.ex
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@ defmodule Stripe.StripeMock do
end

Logger.debug("Starting stripe_mock on port #{port}")
Exexec.run([executable | port_args], monitor: true, stdout: true, stderr: true)
:exec.run([executable | port_args], [:monitor, :stdout, :stderr])
end

defp kill_stripe_mock(manager_pid) do
Logger.debug("Killing stripe_mock")

case Exexec.stop(manager_pid) do
case :exec.stop(manager_pid) do
:ok ->
:ok

Expand Down

0 comments on commit 4e9a8cc

Please sign in to comment.