Skip to content

Commit

Permalink
Fix specs for container dashboards charts timestamp fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mzazrivec committed Apr 6, 2018
1 parent 0bf7b24 commit 4cd0fae
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions spec/services/container_dashboard_service_spec.rb
Expand Up @@ -26,7 +26,7 @@
ems_openshift = FactoryGirl.create(:ems_openshift, :zone => @zone)
ems_kubernetes = FactoryGirl.create(:ems_kubernetes, :zone => @zone)

current_date = 7.days.ago
current_date = 7.days.ago.beginning_of_day.utc
old_date = 35.days.ago

current_metric_openshift = FactoryGirl.create(
Expand Down Expand Up @@ -75,13 +75,13 @@
:cpu => {
:used => 2,
:total => 2,
:xData => [current_date.strftime("%Y-%m-%d")],
:xData => [current_date],
:yData => [2]
},
:memory => {
:used => 1,
:total => 2,
:xData => [current_date.strftime("%Y-%m-%d")],
:xData => [current_date],
:yData => [1]
}
)
Expand All @@ -90,13 +90,13 @@
:cpu => {
:used => 3,
:total => 3,
:xData => [current_date.strftime("%Y-%m-%d")],
:xData => [current_date],
:yData => [3.0]
},
:memory => {
:used => 2,
:total => 3,
:xData => [current_date.strftime("%Y-%m-%d")],
:xData => [current_date],
:yData => [1.5]
}
)
Expand Down Expand Up @@ -314,8 +314,8 @@
ems_openshift = FactoryGirl.create(:ems_openshift, :zone => @zone)
ems_kubernetes = FactoryGirl.create(:ems_kubernetes, :zone => @zone)

previous_date = 8.days.ago
current_date = 7.days.ago
previous_date = 8.days.ago.beginning_of_day.utc
current_date = 7.days.ago.beginning_of_day.utc
old_date = 35.days.ago

previous_metric_openshift = FactoryGirl.create(
Expand Down Expand Up @@ -353,12 +353,12 @@
daily_network_trends_single_provider = described_class.new(ems_openshift.id, controller).network_metrics[:xy_data]

expect(daily_network_trends_single_provider).to eq(
:xData => [previous_date.strftime("%Y-%m-%d"), current_date.strftime("%Y-%m-%d")],
:xData => [previous_date, current_date],
:yData => [2000, 1000]
)

expect(daily_network_trends).to eq(
:xData => [previous_date.strftime("%Y-%m-%d"), current_date.strftime("%Y-%m-%d")],
:xData => [previous_date, current_date],
:yData => [2000, 2500]
)
end
Expand Down

0 comments on commit 4cd0fae

Please sign in to comment.