Skip to content

Commit

Permalink
Merge branch 'release/0.15.7'
Browse files Browse the repository at this point in the history
  • Loading branch information
zacksiri committed Sep 12, 2024
2 parents c55c9ef + c189656 commit e50b2e6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
9 changes: 4 additions & 5 deletions test/uplink/packages/instance/placement_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down

0 comments on commit e50b2e6

Please sign in to comment.