Commit 524f58ff authored by Rajendra kadam's avatar Rajendra kadam Committed by Kamil Trzciński

Change tooltip text and fix failing spec

parent 079a3014
---
title: Update tooltip content for deployment instances
merge_request: 22289
author: Rajendra Kadam
type: added
...@@ -81,7 +81,7 @@ module Gitlab ...@@ -81,7 +81,7 @@ module Gitlab
{ {
status: pod_status&.downcase, status: pod_status&.downcase,
pod_name: pod_name, pod_name: pod_name,
tooltip: "#{name} (#{pod_name}) #{pod_status}", tooltip: "#{pod_name} (#{pod_status})",
track: track, track: track,
stable: stable? stable: stable?
} }
......
...@@ -56,10 +56,10 @@ describe Gitlab::Kubernetes::Deployment do ...@@ -56,10 +56,10 @@ describe Gitlab::Kubernetes::Deployment do
it 'returns all pods with generated names and pending' do it 'returns all pods with generated names and pending' do
expected = [ expected = [
{ status: 'pending', pod_name: 'generated-name-with-suffix', tooltip: 'unknown (generated-name-with-suffix) Pending', track: 'stable', stable: true }, { status: 'pending', pod_name: 'generated-name-with-suffix', tooltip: 'generated-name-with-suffix (Pending)', track: 'stable', stable: true },
{ status: 'pending', pod_name: 'generated-name-with-suffix', tooltip: 'unknown (generated-name-with-suffix) Pending', track: 'stable', stable: true }, { status: 'pending', pod_name: 'generated-name-with-suffix', tooltip: 'generated-name-with-suffix (Pending)', track: 'stable', stable: true },
{ status: 'pending', pod_name: 'generated-name-with-suffix', tooltip: 'unknown (generated-name-with-suffix) Pending', track: 'stable', stable: true }, { status: 'pending', pod_name: 'generated-name-with-suffix', tooltip: 'generated-name-with-suffix (Pending)', track: 'stable', stable: true },
{ status: 'pending', pod_name: 'generated-name-with-suffix', tooltip: 'unknown (generated-name-with-suffix) Pending', track: 'stable', stable: true } { status: 'pending', pod_name: 'generated-name-with-suffix', tooltip: 'generated-name-with-suffix (Pending)', track: 'stable', stable: true }
] ]
expect(deployment.instances).to eq(expected) expect(deployment.instances).to eq(expected)
...@@ -75,9 +75,9 @@ describe Gitlab::Kubernetes::Deployment do ...@@ -75,9 +75,9 @@ describe Gitlab::Kubernetes::Deployment do
it 'returns not spawned pods as pending and unknown and running' do it 'returns not spawned pods as pending and unknown and running' do
expected = [ expected = [
{ status: 'running', pod_name: 'generated-name-with-suffix', tooltip: 'unknown (generated-name-with-suffix) Running', track: 'stable', stable: true }, { status: 'running', pod_name: 'generated-name-with-suffix', tooltip: 'generated-name-with-suffix (Running)', track: 'stable', stable: true },
{ status: 'pending', pod_name: 'Not provided', tooltip: 'unknown (Not provided) Pending', track: 'stable', stable: true }, { status: 'pending', pod_name: 'Not provided', tooltip: 'Not provided (Pending)', track: 'stable', stable: true },
{ status: 'pending', pod_name: 'Not provided', tooltip: 'unknown (Not provided) Pending', track: 'stable', stable: true } { status: 'pending', pod_name: 'Not provided', tooltip: 'Not provided (Pending)', track: 'stable', stable: true }
] ]
expect(deployment.instances).to eq(expected) expect(deployment.instances).to eq(expected)
...@@ -98,10 +98,10 @@ describe Gitlab::Kubernetes::Deployment do ...@@ -98,10 +98,10 @@ describe Gitlab::Kubernetes::Deployment do
it 'returns all instances as named and waiting' do it 'returns all instances as named and waiting' do
expected = [ expected = [
{ status: 'pending', pod_name: 'kube-pod', tooltip: 'foo (kube-pod) Pending', track: 'stable', stable: true }, { status: 'pending', pod_name: 'kube-pod', tooltip: 'kube-pod (Pending)', track: 'stable', stable: true },
{ status: 'pending', pod_name: 'kube-pod1', tooltip: 'foo (kube-pod1) Pending', track: 'stable', stable: true }, { status: 'pending', pod_name: 'kube-pod1', tooltip: 'kube-pod1 (Pending)', track: 'stable', stable: true },
{ status: 'pending', pod_name: 'kube-pod2', tooltip: 'foo (kube-pod2) Pending', track: 'stable', stable: true }, { status: 'pending', pod_name: 'kube-pod2', tooltip: 'kube-pod2 (Pending)', track: 'stable', stable: true },
{ status: 'pending', pod_name: 'kube-pod3', tooltip: 'foo (kube-pod3) Pending', track: 'stable', stable: true } { status: 'pending', pod_name: 'kube-pod3', tooltip: 'kube-pod3 (Pending)', track: 'stable', stable: true }
] ]
expect(deployment.instances).to eq(expected) expect(deployment.instances).to eq(expected)
...@@ -122,10 +122,10 @@ describe Gitlab::Kubernetes::Deployment do ...@@ -122,10 +122,10 @@ describe Gitlab::Kubernetes::Deployment do
it 'returns all instances' do it 'returns all instances' do
expected = [ expected = [
{ status: 'succeeded', pod_name: 'kube-pod', tooltip: 'foo (kube-pod) Succeeded', track: 'stable', stable: true }, { status: 'succeeded', pod_name: 'kube-pod', tooltip: 'kube-pod (Succeeded)', track: 'stable', stable: true },
{ status: 'running', pod_name: 'kube-pod1', tooltip: 'foo (kube-pod1) Running', track: 'stable', stable: true }, { status: 'running', pod_name: 'kube-pod1', tooltip: 'kube-pod1 (Running)', track: 'stable', stable: true },
{ status: 'pending', pod_name: 'kube-pod2', tooltip: 'foo (kube-pod2) Pending', track: 'stable', stable: true }, { status: 'pending', pod_name: 'kube-pod2', tooltip: 'kube-pod2 (Pending)', track: 'stable', stable: true },
{ status: 'pending', pod_name: 'kube-pod3', tooltip: 'foo (kube-pod3) Pending', track: 'stable', stable: true } { status: 'pending', pod_name: 'kube-pod3', tooltip: 'kube-pod3 (Pending)', track: 'stable', stable: true }
] ]
expect(deployment.instances).to eq(expected) expect(deployment.instances).to eq(expected)
...@@ -142,7 +142,7 @@ describe Gitlab::Kubernetes::Deployment do ...@@ -142,7 +142,7 @@ describe Gitlab::Kubernetes::Deployment do
it 'returns all instances' do it 'returns all instances' do
expected = [ expected = [
{ status: 'pending', pod_name: 'kube-pod', tooltip: 'foo (kube-pod) Pending', track: 'stable', stable: true } { status: 'pending', pod_name: 'kube-pod', tooltip: 'kube-pod (Pending)', track: 'stable', stable: true }
] ]
expect(deployment.instances).to eq(expected) expect(deployment.instances).to eq(expected)
...@@ -155,7 +155,7 @@ describe Gitlab::Kubernetes::Deployment do ...@@ -155,7 +155,7 @@ describe Gitlab::Kubernetes::Deployment do
it 'returns all instances' do it 'returns all instances' do
expected = [ expected = [
{ status: 'pending', pod_name: 'kube-pod', tooltip: 'foo (kube-pod) Pending', track: 'canary', stable: false } { status: 'pending', pod_name: 'kube-pod', tooltip: 'kube-pod (Pending)', track: 'canary', stable: false }
] ]
expect(deployment.instances).to eq(expected) expect(deployment.instances).to eq(expected)
......
...@@ -66,12 +66,12 @@ describe Gitlab::Kubernetes::RolloutStatus do ...@@ -66,12 +66,12 @@ describe Gitlab::Kubernetes::RolloutStatus do
it 'stores the union of deployment instances' do it 'stores the union of deployment instances' do
expected = [ expected = [
{ status: 'running', pod_name: "two", tooltip: 'two (two) Running', track: 'any', stable: false }, { status: 'running', pod_name: "two", tooltip: 'two (Running)', track: 'any', stable: false },
{ status: 'running', pod_name: "two", tooltip: 'two (two) Running', track: 'any', stable: false }, { status: 'running', pod_name: "two", tooltip: 'two (Running)', track: 'any', stable: false },
{ status: 'running', pod_name: "two", tooltip: 'two (two) Running', track: 'any', stable: false }, { status: 'running', pod_name: "two", tooltip: 'two (Running)', track: 'any', stable: false },
{ status: 'running', pod_name: "one", tooltip: 'one (one) Running', track: 'stable', stable: true }, { status: 'running', pod_name: "one", tooltip: 'one (Running)', track: 'stable', stable: true },
{ status: 'running', pod_name: "one", tooltip: 'one (one) Running', track: 'stable', stable: true }, { status: 'running', pod_name: "one", tooltip: 'one (Running)', track: 'stable', stable: true },
{ status: 'running', pod_name: "one", tooltip: 'one (one) Running', track: 'stable', stable: true } { status: 'running', pod_name: "one", tooltip: 'one (Running)', track: 'stable', stable: true }
] ]
expect(rollout_status.instances).to eq(expected) expect(rollout_status.instances).to eq(expected)
...@@ -87,12 +87,12 @@ describe Gitlab::Kubernetes::RolloutStatus do ...@@ -87,12 +87,12 @@ describe Gitlab::Kubernetes::RolloutStatus do
it 'stores the union of deployment instances' do it 'stores the union of deployment instances' do
expected = [ expected = [
{ status: 'running', pod_name: "two", tooltip: 'two (two) Running', track: 'canary', stable: false }, { status: 'running', pod_name: "two", tooltip: 'two (Running)', track: 'canary', stable: false },
{ status: 'running', pod_name: "two", tooltip: 'two (two) Running', track: 'canary', stable: false }, { status: 'running', pod_name: "two", tooltip: 'two (Running)', track: 'canary', stable: false },
{ status: 'running', pod_name: "two", tooltip: 'two (two) Running', track: 'canary', stable: false }, { status: 'running', pod_name: "two", tooltip: 'two (Running)', track: 'canary', stable: false },
{ status: 'running', pod_name: "one", tooltip: 'one (one) Running', track: 'stable', stable: true }, { status: 'running', pod_name: "one", tooltip: 'one (Running)', track: 'stable', stable: true },
{ status: 'running', pod_name: "one", tooltip: 'one (one) Running', track: 'stable', stable: true }, { status: 'running', pod_name: "one", tooltip: 'one (Running)', track: 'stable', stable: true },
{ status: 'running', pod_name: "one", tooltip: 'one (one) Running', track: 'stable', stable: true } { status: 'running', pod_name: "one", tooltip: 'one (Running)', track: 'stable', stable: true }
] ]
expect(rollout_status.instances).to eq(expected) expect(rollout_status.instances).to eq(expected)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment