-
Notifications
You must be signed in to change notification settings - Fork 15
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
Health summary with clusters and databases #878
Changes from all commits
7596fc9
cc29ec9
5d40003
da62560
ae9c276
3580e6e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,8 @@ defmodule Trento.HealthSummaryServiceTest do | |
|
||
alias Trento.Application.UseCases.SapSystems.HealthSummaryDto | ||
alias Trento.SapSystems.HealthSummaryService | ||
require Trento.Domain.Enums.Health, as: Health | ||
require Trento.Domain.Enums.ClusterType, as: ClusterType | ||
|
||
alias Trento.{ | ||
HostReadModel, | ||
|
@@ -47,19 +49,43 @@ defmodule Trento.HealthSummaryServiceTest do | |
end | ||
|
||
test "should determine health summary for a SAP System" do | ||
%{ | ||
sap_system_id: sap_system_id, | ||
%Trento.ClusterReadModel{id: cluster_id} = | ||
insert(:cluster, type: ClusterType.hana_scale_up(), health: Health.passing()) | ||
|
||
%Trento.HostReadModel{id: host_1_id} = | ||
insert(:host, cluster_id: cluster_id, heartbeat: :unknown) | ||
|
||
%Trento.SapSystemReadModel{ | ||
id: sap_system_id, | ||
sid: sid | ||
} = sap_system_with_cluster_and_hosts() | ||
} = insert(:sap_system, health: Health.critical()) | ||
|
||
insert( | ||
:database_instance_without_host, | ||
sap_system_id: sap_system_id, | ||
sid: "HDD", | ||
host_id: host_1_id, | ||
health: Health.warning() | ||
) | ||
|
||
insert( | ||
:application_instance_without_host, | ||
sap_system_id: sap_system_id, | ||
sid: sid, | ||
host_id: host_1_id, | ||
health: Health.critical() | ||
) | ||
|
||
assert [ | ||
%HealthSummaryDto{ | ||
id: ^sap_system_id, | ||
sid: ^sid, | ||
sapsystem_health: :passing, | ||
database_health: :critical, | ||
clusters_health: :warning, | ||
hosts_health: :unknown | ||
sapsystem_health: :critical, | ||
database_health: :warning, | ||
clusters_health: :passing, | ||
hosts_health: :unknown, | ||
database_id: ^sap_system_id, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. now I bit confused it this is the database id or the sap system id hehe Now i'm thinking both of them might have the same id, the difference in the frontend is that we get one with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As far as I understood, they are not the same 👀 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They can but can also be different |
||
cluster_id: ^cluster_id | ||
} | ||
] = HealthSummaryService.get_health_summary() | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could rename
host_1_id
tohost_id