Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
e6d743c4
Commit
e6d743c4
authored
Mar 06, 2018
by
Kushal Pandya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return `Unknown` for nodeVersion and dbReplicationLag on null details
parent
511738f0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
2 deletions
+34
-2
ee/app/assets/javascripts/geo_nodes/components/geo_node_details.vue
...ets/javascripts/geo_nodes/components/geo_node_details.vue
+7
-1
spec/javascripts/geo_nodes/components/geo_node_details_spec.js
...javascripts/geo_nodes/components/geo_node_details_spec.js
+27
-1
No files found.
ee/app/assets/javascripts/geo_nodes/components/geo_node_details.vue
View file @
e6d743c4
...
...
@@ -97,6 +97,10 @@
return
this
.
showAdvanceItems
?
'
angle-up
'
:
'
angle-down
'
;
},
nodeVersion
()
{
if
(
this
.
nodeDetails
.
version
==
null
&&
this
.
nodeDetails
.
revision
==
null
)
{
return
__
(
'
Unknown
'
);
}
return
`
${
this
.
nodeDetails
.
version
}
(
${
this
.
nodeDetails
.
revision
}
)`
;
},
replicationSlotWAL
()
{
...
...
@@ -113,7 +117,8 @@
return
stringifyTime
(
parsedTime
);
}
return
'
Unknown
'
;
return
__
(
'
Unknown
'
);
},
lastEventStatus
()
{
return
{
...
...
@@ -150,6 +155,7 @@
},
syncSettings
()
{
return
{
syncStatusUnavailable
:
this
.
nodeDetails
.
syncStatusUnavailable
,
selectiveSyncType
:
this
.
nodeDetails
.
selectiveSyncType
,
lastEvent
:
this
.
nodeDetails
.
lastEvent
,
cursorLastEvent
:
this
.
nodeDetails
.
cursorLastEvent
,
...
...
spec/javascripts/geo_nodes/components/geo_node_details_spec.js
View file @
e6d743c4
...
...
@@ -77,6 +77,16 @@ describe('GeoNodeDetailsComponent', () => {
});
describe
(
'
nodeVersion
'
,
()
=>
{
it
(
'
returns `Unknown` when `version` and `revision` are null
'
,
()
=>
{
const
nodeDetailsVersionNull
=
Object
.
assign
({},
mockNodeDetails
,
{
version
:
null
,
revision
:
null
,
});
const
vmVersionNull
=
createComponent
(
nodeDetailsVersionNull
);
expect
(
vmVersionNull
.
nodeVersion
).
toBe
(
'
Unknown
'
);
vmVersionNull
.
$destroy
();
});
it
(
'
returns version string
'
,
()
=>
{
expect
(
vm
.
nodeVersion
).
toBe
(
'
10.4.0-pre (b93c51849b)
'
);
});
...
...
@@ -92,6 +102,15 @@ describe('GeoNodeDetailsComponent', () => {
it
(
'
returns DB replication lag time duration
'
,
()
=>
{
expect
(
vm
.
dbReplicationLag
).
toBe
(
'
0m
'
);
});
it
(
'
returns `Unknown` when `dbReplicationLag` is null
'
,
()
=>
{
const
nodeDetailsLagNull
=
Object
.
assign
({},
mockNodeDetails
,
{
dbReplicationLag
:
null
,
});
const
vmLagNull
=
createComponent
(
nodeDetailsLagNull
);
expect
(
vmLagNull
.
dbReplicationLag
).
toBe
(
'
Unknown
'
);
vmLagNull
.
$destroy
();
});
});
describe
(
'
lastEventStatus
'
,
()
=>
{
...
...
@@ -158,10 +177,17 @@ describe('GeoNodeDetailsComponent', () => {
describe
(
'
syncSettings
'
,
()
=>
{
it
(
'
returns sync settings object
'
,
()
=>
{
const
syncSettings
=
vm
.
syncSettings
();
const
nodeDetailsUnknownSync
=
Object
.
assign
({},
mockNodeDetails
,
{
syncStatusUnavailable
:
true
,
});
const
vmUnknownSync
=
createComponent
(
nodeDetailsUnknownSync
);
const
syncSettings
=
vmUnknownSync
.
syncSettings
();
expect
(
syncSettings
.
syncStatusUnavailable
).
toBe
(
true
);
expect
(
syncSettings
.
namespaces
).
toBe
(
mockNodeDetails
.
namespaces
);
expect
(
syncSettings
.
lastEvent
).
toBe
(
mockNodeDetails
.
lastEvent
);
expect
(
syncSettings
.
cursorLastEvent
).
toBe
(
mockNodeDetails
.
cursorLastEvent
);
vmUnknownSync
.
$destroy
();
});
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment