diff --git a/mix.exs b/mix.exs index db2972d..82bc65d 100644 --- a/mix.exs +++ b/mix.exs @@ -4,7 +4,7 @@ defmodule Uplink.MixProject do def project do [ app: :uplink, - version: "0.15.6", + version: "0.15.7", elixir: "~> 1.13", elixirc_paths: elixirc_paths(Mix.env()), start_permanent: Mix.env() == :prod, diff --git a/test/uplink/packages/instance/placement_test.exs b/test/uplink/packages/instance/placement_test.exs index fa25cfe..506fc0a 100644 --- a/test/uplink/packages/instance/placement_test.exs +++ b/test/uplink/packages/instance/placement_test.exs @@ -46,13 +46,11 @@ defmodule Uplink.Packages.Instance.PlacementTest do test "fallback to auto when no availability", %{ bypass: bypass, existing_instances: existing_instances, - cluster_members: cluster_members, - node_name: node_name + cluster_members: cluster_members } do + node_name = "instellar-0e89ea876-02" placement_name = Placement.name(node_name) - Uplink.Cache.delete({:available_nodes, placement_name}) - Bypass.expect_once(bypass, "GET", "/1.0/instances", fn conn -> assert %{"recursion" => "1", "all-projects" => _} = conn.query_params @@ -61,13 +59,14 @@ defmodule Uplink.Packages.Instance.PlacementTest do |> Plug.Conn.resp(200, existing_instances) end) - Bypass.stub(bypass, "GET", "/1.0/cluster/members", fn conn -> + Bypass.expect_once(bypass, "GET", "/1.0/cluster/members", fn conn -> conn |> Plug.Conn.put_resp_header("content-type", "application/json") |> Plug.Conn.resp(200, cluster_members) end) Uplink.Cache.put({:available_nodes, placement_name}, []) + Uplink.Cache.delete(:cluster_members) assert {:ok, %Placement{}} = Placement.find(node_name, "spread") end