Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Nomad
Commits
99244af1
Commit
99244af1
authored
4 years ago
by
Michael Lange
Browse files
Options
Download
Email Patches
Plain Diff
Fix flaky lifecycle chart tests
parent
edd296ff
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
ui/tests/acceptance/allocation-detail-test.js
+1
-0
ui/tests/acceptance/allocation-detail-test.js
ui/tests/acceptance/task-detail-test.js
+10
-2
ui/tests/acceptance/task-detail-test.js
ui/tests/integration/components/lifecycle-chart-test.js
+1
-1
ui/tests/integration/components/lifecycle-chart-test.js
with
12 additions
and
3 deletions
+12
-3
ui/tests/acceptance/allocation-detail-test.js
+
1
-
0
View file @
99244af1
...
@@ -103,6 +103,7 @@ module('Acceptance | allocation detail', function(hooks) {
...
@@ -103,6 +103,7 @@ module('Acceptance | allocation detail', function(hooks) {
const
prestartEphemeralTask
=
server
.
db
.
taskStates
const
prestartEphemeralTask
=
server
.
db
.
taskStates
.
where
({
allocationId
:
allocation
.
id
})
.
where
({
allocationId
:
allocation
.
id
})
.
sortBy
(
'
name
'
)
.
find
(
taskState
=>
{
.
find
(
taskState
=>
{
const
task
=
server
.
db
.
tasks
.
findBy
({
name
:
taskState
.
name
});
const
task
=
server
.
db
.
tasks
.
findBy
({
name
:
taskState
.
name
});
return
task
.
Lifecycle
&&
task
.
Lifecycle
.
Hook
===
'
prestart
'
&&
!
task
.
Lifecycle
.
Sidecar
;
return
task
.
Lifecycle
&&
task
.
Lifecycle
.
Hook
===
'
prestart
'
&&
!
task
.
Lifecycle
.
Sidecar
;
...
...
This diff is collapsed.
Click to expand it.
ui/tests/acceptance/task-detail-test.js
+
10
-
2
View file @
99244af1
...
@@ -37,8 +37,16 @@ module('Acceptance | task detail', function(hooks) {
...
@@ -37,8 +37,16 @@ module('Acceptance | task detail', function(hooks) {
);
);
const
lifecycle
=
server
.
db
.
tasks
.
where
({
name
:
task
.
name
})[
0
].
Lifecycle
;
const
lifecycle
=
server
.
db
.
tasks
.
where
({
name
:
task
.
name
})[
0
].
Lifecycle
;
const
prestartString
=
lifecycle
&&
lifecycle
.
Sidecar
?
'
sidecar
'
:
'
prestart
'
;
assert
.
equal
(
Task
.
lifecycle
,
lifecycle
?
prestartString
:
'
main
'
);
let
lifecycleName
=
'
main
'
;
if
(
lifecycle
&&
(
lifecycle
.
Hook
===
'
prestart
'
||
lifecycle
.
Hook
===
'
poststart
'
))
{
lifecycleName
=
`
${
lifecycle
.
Hook
}
-
${
lifecycle
.
Sidecar
?
'
sidecar
'
:
'
ephemeral
'
}
`
;
}
if
(
lifecycle
&&
lifecycle
.
Hook
===
'
poststop
'
)
{
lifecycleName
=
'
poststop
'
;
}
assert
.
equal
(
Task
.
lifecycle
,
lifecycleName
);
assert
.
equal
(
document
.
title
,
`Task
${
task
.
name
}
- Nomad`
);
assert
.
equal
(
document
.
title
,
`Task
${
task
.
name
}
- Nomad`
);
});
});
...
...
This diff is collapsed.
Click to expand it.
ui/tests/integration/components/lifecycle-chart-test.js
+
1
-
1
View file @
99244af1
...
@@ -105,7 +105,7 @@ module('Integration | Component | lifecycle-chart', function(hooks) {
...
@@ -105,7 +105,7 @@ module('Integration | Component | lifecycle-chart', function(hooks) {
this
.
set
(
'
tasks
'
,
[
tasks
[
0
],
tasks
[
6
]]);
this
.
set
(
'
tasks
'
,
[
tasks
[
0
],
tasks
[
6
]]);
await
render
(
hbs
`<LifecycleChart @tasks={{tasks}} />`
);
await
render
(
hbs
`<LifecycleChart @tasks={{tasks}} />`
);
assert
.
ok
(
Chart
.
phases
.
length
,
4
);
assert
.
equal
(
Chart
.
phases
.
length
,
4
);
});
});
test
(
'
it reflects phase and task states when states are passed in
'
,
async
function
(
assert
)
{
test
(
'
it reflects phase and task states when states are passed in
'
,
async
function
(
assert
)
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
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
Menu
Projects
Groups
Snippets
Help