From 8782e1a36dc53d1375c45c82527f6474603fb2f6 Mon Sep 17 00:00:00 2001 From: Carmine Di Monaco Date: Wed, 22 Mar 2023 12:06:55 +0100 Subject: [PATCH 1/8] Cluster registration process happens also when the discovered node is not a DC --- lib/trento/domain/cluster/cluster.ex | 48 +++++- test/trento/domain/cluster/cluster_test.exs | 160 ++++++++++++++++++-- 2 files changed, 190 insertions(+), 18 deletions(-) diff --git a/lib/trento/domain/cluster/cluster.ex b/lib/trento/domain/cluster/cluster.ex index 6c9c380df6..764891c9df 100644 --- a/lib/trento/domain/cluster/cluster.ex +++ b/lib/trento/domain/cluster/cluster.ex @@ -7,11 +7,19 @@ defmodule Trento.Domain.Cluster do SAP workloads. Each deployed cluster is registered as a new aggregate entry, meaning that all the hosts belonging - to the same cluster are part of the same stream. A cluster is registered first time/details updated afterwards - only by cluster discovery messages coming from the **designated controller** node. Once a cluster is - registered other hosts can be added receiving discovery messages coming from other nodes. All the hosts + to the same cluster are part of the same stream. + A cluster is registered first time by cluster discovery messages coming from all the nodes of the cluster. + When the message for the first time arrives from a **designated controller** node, the cluster is created + with the full details, otherwise the cluster is created but with unknown details. + The details will be updated when the **designated controller** of the cluster register itself. + + Once a cluster is registered the details will be updated only when a message from **designated controller** arrives. + + Once a cluster is registered other hosts can be added receiving discovery messages coming from other nodes. All the hosts are listed in the `hosts` field. + + The cluster aggregate stores and updates information coming in the cluster discovery messages such as: - Cluster name @@ -112,8 +120,9 @@ defmodule Trento.Domain.Cluster do def execute(%Cluster{rolling_up: true}, _), do: {:error, :cluster_rolling_up} - # When a DC cluster node is registered for the first time, a cluster is registered - # and the host of the node is added to the cluster + # When a DC cluster node is registered for the first time, + # a cluster is registered and the host of the node is added to the cluster, + # we took the full details of the cluster because the first host is DC def execute( %Cluster{cluster_id: nil}, %RegisterClusterHost{ @@ -149,9 +158,32 @@ defmodule Trento.Domain.Cluster do ] end - # If no DC node was received yet, no cluster was registered. - def execute(%Cluster{cluster_id: nil}, %RegisterClusterHost{designated_controller: false}), - do: {:error, :cluster_not_found} + # If no DC node was received yet, the cluster is registered with empty details + # The cluster details will be updated when a dc for the cluster will register itself + def execute(%Cluster{cluster_id: nil}, %RegisterClusterHost{ + cluster_id: cluster_id, + name: name, + host_id: host_id, + designated_controller: false + }) do + [ + %ClusterRegistered{ + cluster_id: cluster_id, + name: name, + type: :unknown, + sid: nil, + provider: :unknown, + resources_number: nil, + hosts_number: nil, + details: nil, + health: :unknown + }, + %HostAddedToCluster{ + cluster_id: cluster_id, + host_id: host_id + } + ] + end def execute( %Cluster{} = cluster, diff --git a/test/trento/domain/cluster/cluster_test.exs b/test/trento/domain/cluster/cluster_test.exs index 3f7b57db9e..c6d5b5e536 100644 --- a/test/trento/domain/cluster/cluster_test.exs +++ b/test/trento/domain/cluster/cluster_test.exs @@ -33,7 +33,7 @@ defmodule Trento.ClusterTest do require Trento.Domain.Enums.Health, as: Health describe "cluster registration" do - test "should register a cluster and add the node host to the cluster if the node is a DC" do + test "should register a cluster with full details and add the node host to the cluster if the node is a DC" do cluster_id = Faker.UUID.v4() host_id = Faker.UUID.v4() name = Faker.StarWars.character() @@ -81,7 +81,7 @@ defmodule Trento.ClusterTest do ) end - test "should add a host to the cluster" do + test "should add a host to the cluster when the cluster has full details" do cluster_id = Faker.UUID.v4() host_id = Faker.UUID.v4() name = Faker.StarWars.character() @@ -116,25 +116,165 @@ defmodule Trento.ClusterTest do ) end - test "should return an error if the cluster was not registered yet and a command from a non-DC is received" do - assert_error( - [], + test "should add a host the cluster when the cluster has empty/unknown details" do + cluster_id = Faker.UUID.v4() + host_id = Faker.UUID.v4() + host_id_two = Faker.UUID.v4() + + name = Faker.StarWars.character() + + assert_events_and_state( + [ + build( + :cluster_registered_event, + cluster_id: cluster_id, + name: name, + sid: nil, + provider: :unknown, + type: :unknown, + health: :unknown, + details: nil + ), + build(:host_added_to_cluster_event, cluster_id: cluster_id, host_id: host_id) + ], RegisterClusterHost.new!(%{ - cluster_id: Faker.UUID.v4(), - host_id: Faker.UUID.v4(), + cluster_id: cluster_id, + host_id: host_id_two, name: Faker.StarWars.character(), - sid: Faker.StarWars.planet(), - discovered_health: :unknown, + sid: Faker.StarWars.character(), type: :hana_scale_up, + discovered_health: :unknown, designated_controller: false, provider: :azure }), - {:error, :cluster_not_found} + [ + %HostAddedToCluster{ + cluster_id: cluster_id, + host_id: host_id_two + } + ], + fn cluster -> + assert cluster_id == cluster.cluster_id + assert name == cluster.name + assert :unknown == cluster.type + assert :unknown == cluster.provider + assert 2 == cluster.hosts_number + assert [host_id_two, host_id] == cluster.hosts + assert :unknown == cluster.health + end + ) + end + + test "should create a cluster with empty details when the cluster was not registered yet and a command from a non-DC is received" do + cluster_id = Faker.UUID.v4() + host_id = Faker.UUID.v4() + name = Faker.StarWars.character() + + assert_events_and_state( + [], + RegisterClusterHost.new!(%{ + cluster_id: cluster_id, + host_id: host_id, + name: name, + discovered_health: :unknown, + provider: :unknown, + type: :unknown, + designated_controller: false + }), + [ + %ClusterRegistered{ + cluster_id: cluster_id, + name: name, + sid: nil, + provider: :unknown, + type: :unknown, + health: :unknown, + details: nil + }, + %HostAddedToCluster{ + cluster_id: cluster_id, + host_id: host_id + } + ], + %Cluster{ + cluster_id: cluster_id, + name: name, + sid: nil, + type: :unknown, + provider: :unknown, + hosts: [host_id], + discovered_health: :unknown, + health: :unknown + } ) end end describe "cluster details" do + test "should update cluster details when the cluster has empty details" do + cluster_id = Faker.UUID.v4() + host_id = Faker.UUID.v4() + name = Faker.StarWars.character() + new_name = Faker.StarWars.character() + new_sid = Faker.StarWars.planet() + + details = hana_cluster_details_value_object() + + initial_events = [ + build( + :cluster_registered_event, + cluster_id: cluster_id, + name: name, + sid: nil, + provider: :unknown, + type: :unknown, + health: :unknown, + details: nil + ), + build(:host_added_to_cluster_event, cluster_id: cluster_id, host_id: host_id) + ] + + assert_events_and_state( + initial_events, + RegisterClusterHost.new!(%{ + cluster_id: cluster_id, + host_id: host_id, + name: new_name, + sid: new_sid, + provider: :gcp, + type: :hana_scale_up, + resources_number: 2, + hosts_number: 1, + discovered_health: :unknown, + details: StructHelper.to_map(details), + designated_controller: true + }), + [ + %ClusterDetailsUpdated{ + cluster_id: cluster_id, + name: new_name, + sid: new_sid, + provider: :gcp, + type: :hana_scale_up, + resources_number: 2, + hosts_number: 1, + details: details + } + ], + fn cluster -> + %Cluster{ + cluster_id: ^cluster_id, + name: ^new_name, + sid: ^new_sid, + provider: :gcp, + resources_number: 2, + hosts_number: 1, + details: ^details + } = cluster + end + ) + end + test "should update cluster details" do cluster_id = Faker.UUID.v4() host_id = Faker.UUID.v4() From 9ca0fc85e2af2b3e5bd105a0637dc5e05ba0dab4 Mon Sep 17 00:00:00 2001 From: Carmine Di Monaco Date: Thu, 23 Mar 2023 11:39:13 +0100 Subject: [PATCH 2/8] Address docs and testing review feedbacks --- lib/trento/domain/cluster/cluster.ex | 17 ++-- test/trento/domain/cluster/cluster_test.exs | 92 ++++++++++----------- 2 files changed, 54 insertions(+), 55 deletions(-) diff --git a/lib/trento/domain/cluster/cluster.ex b/lib/trento/domain/cluster/cluster.ex index 764891c9df..1fe8ec4585 100644 --- a/lib/trento/domain/cluster/cluster.ex +++ b/lib/trento/domain/cluster/cluster.ex @@ -8,16 +8,14 @@ defmodule Trento.Domain.Cluster do Each deployed cluster is registered as a new aggregate entry, meaning that all the hosts belonging to the same cluster are part of the same stream. - A cluster is registered first time by cluster discovery messages coming from all the nodes of the cluster. - When the message for the first time arrives from a **designated controller** node, the cluster is created - with the full details, otherwise the cluster is created but with unknown details. - The details will be updated when the **designated controller** of the cluster register itself. - Once a cluster is registered the details will be updated only when a message from **designated controller** arrives. + A new cluster is registered when a cluster discovery message from any of the nodes of the cluster is received. - Once a cluster is registered other hosts can be added receiving discovery messages coming from other nodes. All the hosts - are listed in the `hosts` field. + The cluster details will be populated if the received discovery message is coming from the **designated controller** node. + Otherwise the cluster details are left as unknown, and filled once a message from the **designated controller** is received. + Once a cluster is registered, other hosts will be added when cluster discovery messages from them are received. + All the hosts are listed in the `hosts` field. The cluster aggregate stores and updates information coming in the cluster discovery messages such as: @@ -158,8 +156,9 @@ defmodule Trento.Domain.Cluster do ] end - # If no DC node was received yet, the cluster is registered with empty details - # The cluster details will be updated when a dc for the cluster will register itself + # When a message from a not registered cluster node is received, and this node is **not** a DC, + # a new cluster is registered including the host that sent the message. + # In this case, the cluster details are left empty as the node is not the DC def execute(%Cluster{cluster_id: nil}, %RegisterClusterHost{ cluster_id: cluster_id, name: name, diff --git a/test/trento/domain/cluster/cluster_test.exs b/test/trento/domain/cluster/cluster_test.exs index c6d5b5e536..35bd031762 100644 --- a/test/trento/domain/cluster/cluster_test.exs +++ b/test/trento/domain/cluster/cluster_test.exs @@ -81,7 +81,51 @@ defmodule Trento.ClusterTest do ) end - test "should add a host to the cluster when the cluster has full details" do + test "should register a cluster with empty details when the cluster was not registered yet and a message from a non-DC is received" do + cluster_id = Faker.UUID.v4() + host_id = Faker.UUID.v4() + name = Faker.StarWars.character() + + assert_events_and_state( + [], + RegisterClusterHost.new!(%{ + cluster_id: cluster_id, + host_id: host_id, + name: name, + discovered_health: :unknown, + provider: :unknown, + type: :unknown, + designated_controller: false + }), + [ + %ClusterRegistered{ + cluster_id: cluster_id, + name: name, + sid: nil, + provider: :unknown, + type: :unknown, + health: :unknown, + details: nil + }, + %HostAddedToCluster{ + cluster_id: cluster_id, + host_id: host_id + } + ], + %Cluster{ + cluster_id: cluster_id, + name: name, + sid: nil, + type: :unknown, + provider: :unknown, + hosts: [host_id], + discovered_health: :unknown, + health: :unknown + } + ) + end + + test "should add a host to the cluster" do cluster_id = Faker.UUID.v4() host_id = Faker.UUID.v4() name = Faker.StarWars.character() @@ -116,7 +160,7 @@ defmodule Trento.ClusterTest do ) end - test "should add a host the cluster when the cluster has empty/unknown details" do + test "should add a new host to the cluster and keep the details as empty when a non-DC node message is received" do cluster_id = Faker.UUID.v4() host_id = Faker.UUID.v4() host_id_two = Faker.UUID.v4() @@ -164,50 +208,6 @@ defmodule Trento.ClusterTest do end ) end - - test "should create a cluster with empty details when the cluster was not registered yet and a command from a non-DC is received" do - cluster_id = Faker.UUID.v4() - host_id = Faker.UUID.v4() - name = Faker.StarWars.character() - - assert_events_and_state( - [], - RegisterClusterHost.new!(%{ - cluster_id: cluster_id, - host_id: host_id, - name: name, - discovered_health: :unknown, - provider: :unknown, - type: :unknown, - designated_controller: false - }), - [ - %ClusterRegistered{ - cluster_id: cluster_id, - name: name, - sid: nil, - provider: :unknown, - type: :unknown, - health: :unknown, - details: nil - }, - %HostAddedToCluster{ - cluster_id: cluster_id, - host_id: host_id - } - ], - %Cluster{ - cluster_id: cluster_id, - name: name, - sid: nil, - type: :unknown, - provider: :unknown, - hosts: [host_id], - discovered_health: :unknown, - health: :unknown - } - ) - end end describe "cluster details" do From 968b287d2b1d31e5ce5246cbaa99016bc55114ef Mon Sep 17 00:00:00 2001 From: Carmine Di Monaco Date: Fri, 24 Mar 2023 11:23:09 +0100 Subject: [PATCH 3/8] Removed useless tests from cluster_tests --- test/trento/domain/cluster/cluster_test.exs | 113 -------------------- 1 file changed, 113 deletions(-) diff --git a/test/trento/domain/cluster/cluster_test.exs b/test/trento/domain/cluster/cluster_test.exs index 35bd031762..5f03125ecf 100644 --- a/test/trento/domain/cluster/cluster_test.exs +++ b/test/trento/domain/cluster/cluster_test.exs @@ -159,122 +159,9 @@ defmodule Trento.ClusterTest do end ) end - - test "should add a new host to the cluster and keep the details as empty when a non-DC node message is received" do - cluster_id = Faker.UUID.v4() - host_id = Faker.UUID.v4() - host_id_two = Faker.UUID.v4() - - name = Faker.StarWars.character() - - assert_events_and_state( - [ - build( - :cluster_registered_event, - cluster_id: cluster_id, - name: name, - sid: nil, - provider: :unknown, - type: :unknown, - health: :unknown, - details: nil - ), - build(:host_added_to_cluster_event, cluster_id: cluster_id, host_id: host_id) - ], - RegisterClusterHost.new!(%{ - cluster_id: cluster_id, - host_id: host_id_two, - name: Faker.StarWars.character(), - sid: Faker.StarWars.character(), - type: :hana_scale_up, - discovered_health: :unknown, - designated_controller: false, - provider: :azure - }), - [ - %HostAddedToCluster{ - cluster_id: cluster_id, - host_id: host_id_two - } - ], - fn cluster -> - assert cluster_id == cluster.cluster_id - assert name == cluster.name - assert :unknown == cluster.type - assert :unknown == cluster.provider - assert 2 == cluster.hosts_number - assert [host_id_two, host_id] == cluster.hosts - assert :unknown == cluster.health - end - ) - end end describe "cluster details" do - test "should update cluster details when the cluster has empty details" do - cluster_id = Faker.UUID.v4() - host_id = Faker.UUID.v4() - name = Faker.StarWars.character() - new_name = Faker.StarWars.character() - new_sid = Faker.StarWars.planet() - - details = hana_cluster_details_value_object() - - initial_events = [ - build( - :cluster_registered_event, - cluster_id: cluster_id, - name: name, - sid: nil, - provider: :unknown, - type: :unknown, - health: :unknown, - details: nil - ), - build(:host_added_to_cluster_event, cluster_id: cluster_id, host_id: host_id) - ] - - assert_events_and_state( - initial_events, - RegisterClusterHost.new!(%{ - cluster_id: cluster_id, - host_id: host_id, - name: new_name, - sid: new_sid, - provider: :gcp, - type: :hana_scale_up, - resources_number: 2, - hosts_number: 1, - discovered_health: :unknown, - details: StructHelper.to_map(details), - designated_controller: true - }), - [ - %ClusterDetailsUpdated{ - cluster_id: cluster_id, - name: new_name, - sid: new_sid, - provider: :gcp, - type: :hana_scale_up, - resources_number: 2, - hosts_number: 1, - details: details - } - ], - fn cluster -> - %Cluster{ - cluster_id: ^cluster_id, - name: ^new_name, - sid: ^new_sid, - provider: :gcp, - resources_number: 2, - hosts_number: 1, - details: ^details - } = cluster - end - ) - end - test "should update cluster details" do cluster_id = Faker.UUID.v4() host_id = Faker.UUID.v4() From 0850de120efca1963422983f9748801c0261b3c6 Mon Sep 17 00:00:00 2001 From: Carmine Di Monaco Date: Fri, 24 Mar 2023 14:57:16 +0100 Subject: [PATCH 4/8] Add host to cluster when a message from a dc host arrives for a cluster Co-Authored-By: Fabrizio Sestito --- lib/trento/domain/cluster/cluster.ex | 5 ++++- test/trento/domain/cluster/cluster_test.exs | 7 +++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/trento/domain/cluster/cluster.ex b/lib/trento/domain/cluster/cluster.ex index 1fe8ec4585..14b4d99042 100644 --- a/lib/trento/domain/cluster/cluster.ex +++ b/lib/trento/domain/cluster/cluster.ex @@ -194,14 +194,17 @@ defmodule Trento.Domain.Cluster do maybe_emit_host_added_to_cluster_event(cluster, host_id) end + # When a message arrives from a non DC host who belongs to a cluster, we explicitely add that host to the cluster def execute( %Cluster{} = cluster, %RegisterClusterHost{ - designated_controller: true + designated_controller: true, + host_id: host_id } = command ) do cluster |> Multi.new() + |> Multi.execute(fn cluster -> maybe_emit_host_added_to_cluster_event(cluster, host_id) end) |> Multi.execute(fn cluster -> maybe_emit_cluster_details_updated_event(cluster, command) end) |> Multi.execute(fn cluster -> maybe_emit_cluster_discovered_health_changed_event(cluster, command) diff --git a/test/trento/domain/cluster/cluster_test.exs b/test/trento/domain/cluster/cluster_test.exs index 5f03125ecf..5e34fba043 100644 --- a/test/trento/domain/cluster/cluster_test.exs +++ b/test/trento/domain/cluster/cluster_test.exs @@ -289,6 +289,7 @@ defmodule Trento.ClusterTest do test "should use discovered cluster health when no checks are selected" do cluster_id = Faker.UUID.v4() + host_id = Faker.UUID.v4() name = Faker.StarWars.character() sid = Faker.StarWars.planet() @@ -301,11 +302,17 @@ defmodule Trento.ClusterTest do sid: sid, details: nil, provider: :azure + ), + build( + :host_added_to_cluster_event, + cluster_id: cluster_id, + host_id: host_id ) ], [ build( :register_cluster_host, + host_id: host_id, cluster_id: cluster_id, name: name, sid: sid, From 6b13197204c617b01b9b7b96640df3b19e52bbc4 Mon Sep 17 00:00:00 2001 From: Carmine Di Monaco Date: Fri, 24 Mar 2023 16:33:24 +0100 Subject: [PATCH 5/8] Add register cluster host test when the host is and is not a DC --- test/trento/domain/cluster/cluster_test.exs | 46 ++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/test/trento/domain/cluster/cluster_test.exs b/test/trento/domain/cluster/cluster_test.exs index 5e34fba043..d1c19bb241 100644 --- a/test/trento/domain/cluster/cluster_test.exs +++ b/test/trento/domain/cluster/cluster_test.exs @@ -125,7 +125,7 @@ defmodule Trento.ClusterTest do ) end - test "should add a host to the cluster" do + test "should add a host to the cluster when the host is not a DC" do cluster_id = Faker.UUID.v4() host_id = Faker.UUID.v4() name = Faker.StarWars.character() @@ -159,6 +159,50 @@ defmodule Trento.ClusterTest do end ) end + + test "should add a host to the cluster when the host is a DC" do + cluster_id = Faker.UUID.v4() + host_id = Faker.UUID.v4() + name = Faker.StarWars.character() + sid = Faker.StarWars.planet() + + assert_events_and_state( + [ + build( + :cluster_registered_event, + cluster_id: cluster_id, + provider: :azure, + sid: sid, + name: name, + details: nil + ), + build(:host_added_to_cluster_event, cluster_id: cluster_id) + ], + RegisterClusterHost.new!(%{ + cluster_id: cluster_id, + host_id: host_id, + name: name, + sid: sid, + type: :hana_scale_up, + discovered_health: :passing, + resources_number: 8, + hosts_number: 2, + designated_controller: true, + provider: :azure + }), + [ + %HostAddedToCluster{ + cluster_id: cluster_id, + host_id: host_id + } + ], + fn cluster -> + assert %Cluster{ + hosts: [^host_id | _] + } = cluster + end + ) + end end describe "cluster details" do From 53ce5a586775cf08d63b49cc27fda6206c608865 Mon Sep 17 00:00:00 2001 From: Carmine Di Monaco Date: Fri, 24 Mar 2023 16:35:17 +0100 Subject: [PATCH 6/8] Fix typo --- lib/trento/domain/cluster/cluster.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/trento/domain/cluster/cluster.ex b/lib/trento/domain/cluster/cluster.ex index 14b4d99042..ae58887bef 100644 --- a/lib/trento/domain/cluster/cluster.ex +++ b/lib/trento/domain/cluster/cluster.ex @@ -194,7 +194,7 @@ defmodule Trento.Domain.Cluster do maybe_emit_host_added_to_cluster_event(cluster, host_id) end - # When a message arrives from a non DC host who belongs to a cluster, we explicitely add that host to the cluster + # When a message arrives from a non DC host who belongs to a cluster, we add that host to the cluster def execute( %Cluster{} = cluster, %RegisterClusterHost{ From a2bd67a69a8a0d8a8c06611c04fdea94378c47b1 Mon Sep 17 00:00:00 2001 From: Fabrizio Sestito Date: Mon, 27 Mar 2023 09:41:24 +0200 Subject: [PATCH 7/8] Revisit comments --- lib/trento/domain/cluster/cluster.ex | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/trento/domain/cluster/cluster.ex b/lib/trento/domain/cluster/cluster.ex index ae58887bef..ddd50e3264 100644 --- a/lib/trento/domain/cluster/cluster.ex +++ b/lib/trento/domain/cluster/cluster.ex @@ -118,9 +118,8 @@ defmodule Trento.Domain.Cluster do def execute(%Cluster{rolling_up: true}, _), do: {:error, :cluster_rolling_up} - # When a DC cluster node is registered for the first time, - # a cluster is registered and the host of the node is added to the cluster, - # we took the full details of the cluster because the first host is DC + # When a DC node is discovered, a cluster is registered and the host is added to the cluster. + # The cluster details are populated with the information coming from the DC node. def execute( %Cluster{cluster_id: nil}, %RegisterClusterHost{ @@ -156,9 +155,8 @@ defmodule Trento.Domain.Cluster do ] end - # When a message from a not registered cluster node is received, and this node is **not** a DC, - # a new cluster is registered including the host that sent the message. - # In this case, the cluster details are left empty as the node is not the DC + # When a non-DC node is discovered, a cluster is registered and the host is added to the cluster. + # The cluster details are left as unknown, and filled once a message from the DC node is received. def execute(%Cluster{cluster_id: nil}, %RegisterClusterHost{ cluster_id: cluster_id, name: name, @@ -184,6 +182,7 @@ defmodule Trento.Domain.Cluster do ] end + # If the cluster is already registered, and the host was never discovered before, it is added to the cluster. def execute( %Cluster{} = cluster, %RegisterClusterHost{ @@ -194,7 +193,9 @@ defmodule Trento.Domain.Cluster do maybe_emit_host_added_to_cluster_event(cluster, host_id) end - # When a message arrives from a non DC host who belongs to a cluster, we add that host to the cluster + # When a DC node is discovered, if the cluster is already registered, + # the cluster details are updated with the information coming from the DC node. + # The cluster discovered health is updated based on the new details. def execute( %Cluster{} = cluster, %RegisterClusterHost{ From 1e107409108aca3875887f3163a0dc484d68b26b Mon Sep 17 00:00:00 2001 From: Fabrizio Sestito Date: Mon, 27 Mar 2023 10:23:33 +0200 Subject: [PATCH 8/8] Add info to test titles --- test/trento/domain/cluster/cluster_test.exs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/trento/domain/cluster/cluster_test.exs b/test/trento/domain/cluster/cluster_test.exs index d1c19bb241..06a43dd515 100644 --- a/test/trento/domain/cluster/cluster_test.exs +++ b/test/trento/domain/cluster/cluster_test.exs @@ -81,7 +81,7 @@ defmodule Trento.ClusterTest do ) end - test "should register a cluster with empty details when the cluster was not registered yet and a message from a non-DC is received" do + test "should register a cluster with unknown details when the cluster was not registered yet and a message from a non-DC is received" do cluster_id = Faker.UUID.v4() host_id = Faker.UUID.v4() name = Faker.StarWars.character() @@ -125,7 +125,7 @@ defmodule Trento.ClusterTest do ) end - test "should add a host to the cluster when the host is not a DC" do + test "should add a host to the cluster if the host is not a DC and the cluster is already registered" do cluster_id = Faker.UUID.v4() host_id = Faker.UUID.v4() name = Faker.StarWars.character() @@ -160,7 +160,7 @@ defmodule Trento.ClusterTest do ) end - test "should add a host to the cluster when the host is a DC" do + test "should add a host to the cluster if the host is a DC and the cluster is already registered" do cluster_id = Faker.UUID.v4() host_id = Faker.UUID.v4() name = Faker.StarWars.character()