2023-05-30 14:20:32 +00:00
/ * *
* Copyright ( c ) HashiCorp , Inc .
* SPDX - License - Identifier : MPL - 2.0
* /
[ui, feature] Job Page Redesign (#16932)
* [ui] Service job status panel (#16134)
* it begins
* Hacky demo enabled
* Still very hacky but seems deece
* Floor of at least 3 must be shown
* Width from on-high
* Other statuses considered
* More sensible allocTypes listing
* Beginnings of a legend
* Total number of allocs running now maps over job.groups
* Lintfix
* base the number of slots to hold open on actual tallies, which should never exceed totalAllocs
* Versions get yer versions here
* Versions lookin like versions
* Mirage fixup
* Adds Remaining as an alloc chart status and adds historical status option
* Get tests passing again by making job status static for a sec
* Historical status panel click actions moved into their own component class
* job detail tests plz chill
* Testing if percy is fickle
* Hyper-specfic on summary distribution bar identifier
* Perhaps the 2nd allocSummary item no longer exists with the more accurate afterCreate data
* UI Test eschewing the page pattern
* Bones of a new acceptance test
* Track width changes explicitly with window-resize
* testlintfix
* Alloc counting tests
* Alloc grouping test
* Alloc grouping with complex resizing
* Refined the list of showable statuses
* PR feedback addressed
* renamed allocation-row to allocation-status-row
* [ui, job status] Make panel status mode a queryParam (#16345)
* queryParam changing
* Test for QP in panel
* Adding @tracked to legacy controller
* Move the job of switching to Historical out to larger context
* integration test mock passed func
* [ui] Service job deployment status panel (#16383)
* A very fast and loose deployment panel
* Removing Unknown status from the panel
* Set up oldAllocs list in constructor, rather than as a getter/tracked var
* Small amount of template cleanup
* Refactored latest-deployment new logic back into panel.js
* Revert now-unused latest-deployment component
* margin bottom when ungrouped also
* Basic integration tests for job deployment status panel
* Updates complete alloc colour to green for new visualizations only (#16618)
* Updates complete alloc colour to green for new visualizations only
* Pale green instead of dark green for viz in general
* [ui] Job Deployment Status: History and Update Props (#16518)
* Deployment history wooooooo
* Styled deployment history
* Update Params
* lintfix
* Types and groups for updateParams
* Live-updating history
* Harden with types, error states, and pending states
* Refactor updateParams to use trigger component
* [ui] Deployment History search (#16608)
* Functioning searchbox
* Some nice animations for history items
* History search test
* Fixing up some old mirage conventions
* some a11y rule override to account for scss keyframes
* Split panel into deploying and steady components
* HandleError passed from job index
* gridified panel elements
* TotalAllocs added to deploying.js
* Width perc to px
* [ui] Splitting deployment allocs by status, health, and canary status (#16766)
* Initial attempt with lots of scratchpad work
* Style mods per UI discussion
* Fix canary overflow bug
* Dont show canary or health for steady/prev-alloc blocks
* Steady state
* Thanks Julie
* Fixes steady-state versions
* Legen, wait for it...
* Test fixes now that we have a minimum block size
* PR prep
* Shimmer effect on pending and unplaced allocs (#16801)
* Shimmer effect on pending and unplaced
* Dont show animation in the legend
* [ui, deployments] Linking allocblocks and legends to allocation / allocations index routes (#16821)
* Conditional link-to component and basic linking to allocations and allocation routes
* Job versions filter added to allocations index page
* Steady state legends link
* Legend links
* Badge count links for versions
* Fix: faded class on steady-state legend items
* version link now wont show completed ones
* Fix a11y violations with link labels
* Combining some template conditional logic
* [ui, deployments] Conversions on long nanosecond update params (#16882)
* Conversions on long nanosecond nums
* Early return in updateParamGroups comp prop
* [ui, deployments] Mirage Actively Deploying Job and Deployment Integration Tests (#16888)
* Start of deployment alloc test scaffolding
* Bit of test cleanup and canary for ungrouped allocs
* Flakey but more robust integrations for deployment panel
* De-flake acceptance tests and add an actively deploying job to mirage
* Jitter-less alloc status distribution removes my bad math
* bugfix caused by summary.desiredTotal non-null
* More interesting mirage active deployment alloc breakdown
* Further tests for previous-allocs row
* Previous alloc legend tests
* Percy snapshots added to integration test
* changelog
2023-04-25 02:45:39 +00:00
// @ts-check
import { module , test } from 'qunit' ;
import { setupApplicationTest } from 'ember-qunit' ;
import {
click ,
visit ,
find ,
findAll ,
fillIn ,
2023-05-01 19:24:21 +00:00
settled ,
[ui, feature] Job Page Redesign (#16932)
* [ui] Service job status panel (#16134)
* it begins
* Hacky demo enabled
* Still very hacky but seems deece
* Floor of at least 3 must be shown
* Width from on-high
* Other statuses considered
* More sensible allocTypes listing
* Beginnings of a legend
* Total number of allocs running now maps over job.groups
* Lintfix
* base the number of slots to hold open on actual tallies, which should never exceed totalAllocs
* Versions get yer versions here
* Versions lookin like versions
* Mirage fixup
* Adds Remaining as an alloc chart status and adds historical status option
* Get tests passing again by making job status static for a sec
* Historical status panel click actions moved into their own component class
* job detail tests plz chill
* Testing if percy is fickle
* Hyper-specfic on summary distribution bar identifier
* Perhaps the 2nd allocSummary item no longer exists with the more accurate afterCreate data
* UI Test eschewing the page pattern
* Bones of a new acceptance test
* Track width changes explicitly with window-resize
* testlintfix
* Alloc counting tests
* Alloc grouping test
* Alloc grouping with complex resizing
* Refined the list of showable statuses
* PR feedback addressed
* renamed allocation-row to allocation-status-row
* [ui, job status] Make panel status mode a queryParam (#16345)
* queryParam changing
* Test for QP in panel
* Adding @tracked to legacy controller
* Move the job of switching to Historical out to larger context
* integration test mock passed func
* [ui] Service job deployment status panel (#16383)
* A very fast and loose deployment panel
* Removing Unknown status from the panel
* Set up oldAllocs list in constructor, rather than as a getter/tracked var
* Small amount of template cleanup
* Refactored latest-deployment new logic back into panel.js
* Revert now-unused latest-deployment component
* margin bottom when ungrouped also
* Basic integration tests for job deployment status panel
* Updates complete alloc colour to green for new visualizations only (#16618)
* Updates complete alloc colour to green for new visualizations only
* Pale green instead of dark green for viz in general
* [ui] Job Deployment Status: History and Update Props (#16518)
* Deployment history wooooooo
* Styled deployment history
* Update Params
* lintfix
* Types and groups for updateParams
* Live-updating history
* Harden with types, error states, and pending states
* Refactor updateParams to use trigger component
* [ui] Deployment History search (#16608)
* Functioning searchbox
* Some nice animations for history items
* History search test
* Fixing up some old mirage conventions
* some a11y rule override to account for scss keyframes
* Split panel into deploying and steady components
* HandleError passed from job index
* gridified panel elements
* TotalAllocs added to deploying.js
* Width perc to px
* [ui] Splitting deployment allocs by status, health, and canary status (#16766)
* Initial attempt with lots of scratchpad work
* Style mods per UI discussion
* Fix canary overflow bug
* Dont show canary or health for steady/prev-alloc blocks
* Steady state
* Thanks Julie
* Fixes steady-state versions
* Legen, wait for it...
* Test fixes now that we have a minimum block size
* PR prep
* Shimmer effect on pending and unplaced allocs (#16801)
* Shimmer effect on pending and unplaced
* Dont show animation in the legend
* [ui, deployments] Linking allocblocks and legends to allocation / allocations index routes (#16821)
* Conditional link-to component and basic linking to allocations and allocation routes
* Job versions filter added to allocations index page
* Steady state legends link
* Legend links
* Badge count links for versions
* Fix: faded class on steady-state legend items
* version link now wont show completed ones
* Fix a11y violations with link labels
* Combining some template conditional logic
* [ui, deployments] Conversions on long nanosecond update params (#16882)
* Conversions on long nanosecond nums
* Early return in updateParamGroups comp prop
* [ui, deployments] Mirage Actively Deploying Job and Deployment Integration Tests (#16888)
* Start of deployment alloc test scaffolding
* Bit of test cleanup and canary for ungrouped allocs
* Flakey but more robust integrations for deployment panel
* De-flake acceptance tests and add an actively deploying job to mirage
* Jitter-less alloc status distribution removes my bad math
* bugfix caused by summary.desiredTotal non-null
* More interesting mirage active deployment alloc breakdown
* Further tests for previous-allocs row
* Previous alloc legend tests
* Percy snapshots added to integration test
* changelog
2023-04-25 02:45:39 +00:00
triggerEvent ,
} from '@ember/test-helpers' ;
import { setupMirage } from 'ember-cli-mirage/test-support' ;
import faker from 'nomad-ui/mirage/faker' ;
import percySnapshot from '@percy/ember' ;
import a11yAudit from 'nomad-ui/tests/helpers/a11y-audit' ;
// TODO: Mirage is not type-friendly / assigns "server" as a global. Try to work around this shortcoming.
module ( 'Acceptance | job status panel' , function ( hooks ) {
setupApplicationTest ( hooks ) ;
setupMirage ( hooks ) ;
hooks . beforeEach ( async function ( ) {
server . create ( 'node' ) ;
} ) ;
test ( 'Status panel lets you switch between Current and Historical' , async function ( assert ) {
assert . expect ( 5 ) ;
let job = server . create ( 'job' , {
status : 'running' ,
datacenters : [ '*' ] ,
type : 'service' ,
createAllocations : true ,
} ) ;
await visit ( ` /jobs/ ${ job . id } ` ) ;
assert . dom ( '.job-status-panel' ) . exists ( ) ;
await a11yAudit ( assert ) ;
2023-04-28 18:51:53 +00:00
await percySnapshot ( assert , {
percyCSS : `
. allocation - row td { display : none ; }
` ,
} ) ;
[ui, feature] Job Page Redesign (#16932)
* [ui] Service job status panel (#16134)
* it begins
* Hacky demo enabled
* Still very hacky but seems deece
* Floor of at least 3 must be shown
* Width from on-high
* Other statuses considered
* More sensible allocTypes listing
* Beginnings of a legend
* Total number of allocs running now maps over job.groups
* Lintfix
* base the number of slots to hold open on actual tallies, which should never exceed totalAllocs
* Versions get yer versions here
* Versions lookin like versions
* Mirage fixup
* Adds Remaining as an alloc chart status and adds historical status option
* Get tests passing again by making job status static for a sec
* Historical status panel click actions moved into their own component class
* job detail tests plz chill
* Testing if percy is fickle
* Hyper-specfic on summary distribution bar identifier
* Perhaps the 2nd allocSummary item no longer exists with the more accurate afterCreate data
* UI Test eschewing the page pattern
* Bones of a new acceptance test
* Track width changes explicitly with window-resize
* testlintfix
* Alloc counting tests
* Alloc grouping test
* Alloc grouping with complex resizing
* Refined the list of showable statuses
* PR feedback addressed
* renamed allocation-row to allocation-status-row
* [ui, job status] Make panel status mode a queryParam (#16345)
* queryParam changing
* Test for QP in panel
* Adding @tracked to legacy controller
* Move the job of switching to Historical out to larger context
* integration test mock passed func
* [ui] Service job deployment status panel (#16383)
* A very fast and loose deployment panel
* Removing Unknown status from the panel
* Set up oldAllocs list in constructor, rather than as a getter/tracked var
* Small amount of template cleanup
* Refactored latest-deployment new logic back into panel.js
* Revert now-unused latest-deployment component
* margin bottom when ungrouped also
* Basic integration tests for job deployment status panel
* Updates complete alloc colour to green for new visualizations only (#16618)
* Updates complete alloc colour to green for new visualizations only
* Pale green instead of dark green for viz in general
* [ui] Job Deployment Status: History and Update Props (#16518)
* Deployment history wooooooo
* Styled deployment history
* Update Params
* lintfix
* Types and groups for updateParams
* Live-updating history
* Harden with types, error states, and pending states
* Refactor updateParams to use trigger component
* [ui] Deployment History search (#16608)
* Functioning searchbox
* Some nice animations for history items
* History search test
* Fixing up some old mirage conventions
* some a11y rule override to account for scss keyframes
* Split panel into deploying and steady components
* HandleError passed from job index
* gridified panel elements
* TotalAllocs added to deploying.js
* Width perc to px
* [ui] Splitting deployment allocs by status, health, and canary status (#16766)
* Initial attempt with lots of scratchpad work
* Style mods per UI discussion
* Fix canary overflow bug
* Dont show canary or health for steady/prev-alloc blocks
* Steady state
* Thanks Julie
* Fixes steady-state versions
* Legen, wait for it...
* Test fixes now that we have a minimum block size
* PR prep
* Shimmer effect on pending and unplaced allocs (#16801)
* Shimmer effect on pending and unplaced
* Dont show animation in the legend
* [ui, deployments] Linking allocblocks and legends to allocation / allocations index routes (#16821)
* Conditional link-to component and basic linking to allocations and allocation routes
* Job versions filter added to allocations index page
* Steady state legends link
* Legend links
* Badge count links for versions
* Fix: faded class on steady-state legend items
* version link now wont show completed ones
* Fix a11y violations with link labels
* Combining some template conditional logic
* [ui, deployments] Conversions on long nanosecond update params (#16882)
* Conversions on long nanosecond nums
* Early return in updateParamGroups comp prop
* [ui, deployments] Mirage Actively Deploying Job and Deployment Integration Tests (#16888)
* Start of deployment alloc test scaffolding
* Bit of test cleanup and canary for ungrouped allocs
* Flakey but more robust integrations for deployment panel
* De-flake acceptance tests and add an actively deploying job to mirage
* Jitter-less alloc status distribution removes my bad math
* bugfix caused by summary.desiredTotal non-null
* More interesting mirage active deployment alloc breakdown
* Further tests for previous-allocs row
* Previous alloc legend tests
* Percy snapshots added to integration test
* changelog
2023-04-25 02:45:39 +00:00
assert
. dom ( '[data-test-status-mode="current"]' )
. exists ( 'Current mode by default' ) ;
await click ( '[data-test-status-mode-current]' ) ;
assert
. dom ( '[data-test-status-mode="current"]' )
. exists ( 'Clicking active mode makes no change' ) ;
await click ( '[data-test-status-mode-historical]' ) ;
assert
. dom ( '[data-test-status-mode="historical"]' )
. exists ( 'Lets you switch to historical mode' ) ;
} ) ;
test ( 'Status panel observes query parameters for current/historical' , async function ( assert ) {
assert . expect ( 2 ) ;
let job = server . create ( 'job' , {
status : 'running' ,
datacenters : [ '*' ] ,
type : 'service' ,
createAllocations : true ,
} ) ;
await visit ( ` /jobs/ ${ job . id } ?statusMode=historical ` ) ;
assert . dom ( '.job-status-panel' ) . exists ( ) ;
assert
. dom ( '[data-test-status-mode="historical"]' )
. exists ( 'Historical mode when rendered with queryParams' ) ;
} ) ;
test ( 'Status Panel shows accurate number and types of ungrouped allocation blocks' , async function ( assert ) {
assert . expect ( 7 ) ;
faker . seed ( 1 ) ;
let groupTaskCount = 10 ;
let job = server . create ( 'job' , {
status : 'running' ,
datacenters : [ '*' ] ,
type : 'service' ,
resourceSpec : [ 'M: 256, C: 500' ] , // a single group
createAllocations : true ,
allocStatusDistribution : {
running : 1 ,
failed : 0 ,
unknown : 0 ,
lost : 0 ,
} ,
groupTaskCount ,
shallow : true ,
} ) ;
await visit ( ` /jobs/ ${ job . id } ` ) ;
assert . dom ( '.job-status-panel' ) . exists ( ) ;
let jobAllocCount = server . db . allocations . where ( {
jobId : job . id ,
} ) . length ;
assert . equal (
jobAllocCount ,
groupTaskCount * job . taskGroups . length ,
'Correect number of allocs generated (metatest)'
) ;
assert
. dom ( '.ungrouped-allocs .represented-allocation.running' )
. exists (
{ count : jobAllocCount } ,
` All ${ jobAllocCount } allocations are represented in the status panel `
) ;
groupTaskCount = 20 ;
job = server . create ( 'job' , {
status : 'running' ,
datacenters : [ '*' ] ,
type : 'service' ,
resourceSpec : [ 'M: 256, C: 500' ] , // a single group
createAllocations : true ,
allocStatusDistribution : {
running : 0.5 ,
failed : 0.5 ,
unknown : 0 ,
lost : 0 ,
} ,
groupTaskCount ,
noActiveDeployment : true ,
shallow : true ,
} ) ;
await visit ( ` /jobs/ ${ job . id } ` ) ;
assert . dom ( '.job-status-panel' ) . exists ( ) ;
let runningAllocCount = server . db . allocations . where ( {
jobId : job . id ,
clientStatus : 'running' ,
} ) . length ;
let failedAllocCount = server . db . allocations . where ( {
jobId : job . id ,
clientStatus : 'failed' ,
} ) . length ;
assert . equal (
runningAllocCount + failedAllocCount ,
groupTaskCount * job . taskGroups . length ,
'Correect number of allocs generated (metatest)'
) ;
assert
. dom ( '.ungrouped-allocs .represented-allocation.running' )
. exists (
{ count : runningAllocCount } ,
` All ${ runningAllocCount } running allocations are represented in the status panel `
) ;
assert
. dom ( '.ungrouped-allocs .represented-allocation.failed' )
. exists (
{ count : failedAllocCount } ,
` All ${ failedAllocCount } failed allocations are represented in the status panel `
) ;
2023-04-28 18:51:53 +00:00
await percySnapshot ( assert , {
percyCSS : `
. allocation - row td { display : none ; }
` ,
} ) ;
[ui, feature] Job Page Redesign (#16932)
* [ui] Service job status panel (#16134)
* it begins
* Hacky demo enabled
* Still very hacky but seems deece
* Floor of at least 3 must be shown
* Width from on-high
* Other statuses considered
* More sensible allocTypes listing
* Beginnings of a legend
* Total number of allocs running now maps over job.groups
* Lintfix
* base the number of slots to hold open on actual tallies, which should never exceed totalAllocs
* Versions get yer versions here
* Versions lookin like versions
* Mirage fixup
* Adds Remaining as an alloc chart status and adds historical status option
* Get tests passing again by making job status static for a sec
* Historical status panel click actions moved into their own component class
* job detail tests plz chill
* Testing if percy is fickle
* Hyper-specfic on summary distribution bar identifier
* Perhaps the 2nd allocSummary item no longer exists with the more accurate afterCreate data
* UI Test eschewing the page pattern
* Bones of a new acceptance test
* Track width changes explicitly with window-resize
* testlintfix
* Alloc counting tests
* Alloc grouping test
* Alloc grouping with complex resizing
* Refined the list of showable statuses
* PR feedback addressed
* renamed allocation-row to allocation-status-row
* [ui, job status] Make panel status mode a queryParam (#16345)
* queryParam changing
* Test for QP in panel
* Adding @tracked to legacy controller
* Move the job of switching to Historical out to larger context
* integration test mock passed func
* [ui] Service job deployment status panel (#16383)
* A very fast and loose deployment panel
* Removing Unknown status from the panel
* Set up oldAllocs list in constructor, rather than as a getter/tracked var
* Small amount of template cleanup
* Refactored latest-deployment new logic back into panel.js
* Revert now-unused latest-deployment component
* margin bottom when ungrouped also
* Basic integration tests for job deployment status panel
* Updates complete alloc colour to green for new visualizations only (#16618)
* Updates complete alloc colour to green for new visualizations only
* Pale green instead of dark green for viz in general
* [ui] Job Deployment Status: History and Update Props (#16518)
* Deployment history wooooooo
* Styled deployment history
* Update Params
* lintfix
* Types and groups for updateParams
* Live-updating history
* Harden with types, error states, and pending states
* Refactor updateParams to use trigger component
* [ui] Deployment History search (#16608)
* Functioning searchbox
* Some nice animations for history items
* History search test
* Fixing up some old mirage conventions
* some a11y rule override to account for scss keyframes
* Split panel into deploying and steady components
* HandleError passed from job index
* gridified panel elements
* TotalAllocs added to deploying.js
* Width perc to px
* [ui] Splitting deployment allocs by status, health, and canary status (#16766)
* Initial attempt with lots of scratchpad work
* Style mods per UI discussion
* Fix canary overflow bug
* Dont show canary or health for steady/prev-alloc blocks
* Steady state
* Thanks Julie
* Fixes steady-state versions
* Legen, wait for it...
* Test fixes now that we have a minimum block size
* PR prep
* Shimmer effect on pending and unplaced allocs (#16801)
* Shimmer effect on pending and unplaced
* Dont show animation in the legend
* [ui, deployments] Linking allocblocks and legends to allocation / allocations index routes (#16821)
* Conditional link-to component and basic linking to allocations and allocation routes
* Job versions filter added to allocations index page
* Steady state legends link
* Legend links
* Badge count links for versions
* Fix: faded class on steady-state legend items
* version link now wont show completed ones
* Fix a11y violations with link labels
* Combining some template conditional logic
* [ui, deployments] Conversions on long nanosecond update params (#16882)
* Conversions on long nanosecond nums
* Early return in updateParamGroups comp prop
* [ui, deployments] Mirage Actively Deploying Job and Deployment Integration Tests (#16888)
* Start of deployment alloc test scaffolding
* Bit of test cleanup and canary for ungrouped allocs
* Flakey but more robust integrations for deployment panel
* De-flake acceptance tests and add an actively deploying job to mirage
* Jitter-less alloc status distribution removes my bad math
* bugfix caused by summary.desiredTotal non-null
* More interesting mirage active deployment alloc breakdown
* Further tests for previous-allocs row
* Previous alloc legend tests
* Percy snapshots added to integration test
* changelog
2023-04-25 02:45:39 +00:00
} ) ;
2023-05-05 20:25:21 +00:00
test ( 'After running/pending allocations are covered, fill in allocs by jobVersion, descending' , async function ( assert ) {
assert . expect ( 9 ) ;
let job = server . create ( 'job' , {
status : 'running' ,
datacenters : [ '*' ] ,
type : 'service' ,
resourceSpec : [ 'M: 256, C: 500' ] , // a single group
createAllocations : false ,
groupTaskCount : 4 ,
shallow : true ,
version : 5 ,
} ) ;
server . create ( 'allocation' , {
jobId : job . id ,
clientStatus : 'running' ,
jobVersion : 5 ,
} ) ;
server . create ( 'allocation' , {
jobId : job . id ,
clientStatus : 'pending' ,
jobVersion : 5 ,
} ) ;
server . create ( 'allocation' , {
jobId : job . id ,
clientStatus : 'running' ,
jobVersion : 3 ,
} ) ;
server . create ( 'allocation' , {
jobId : job . id ,
clientStatus : 'failed' ,
jobVersion : 4 ,
} ) ;
server . create ( 'allocation' , {
jobId : job . id ,
clientStatus : 'lost' ,
jobVersion : 5 ,
} ) ;
await visit ( ` /jobs/ ${ job . id } ` ) ;
assert . dom ( '.job-status-panel' ) . exists ( ) ;
// We expect to see 4 represented-allocations, since that's the number in our groupTaskCount
assert
. dom ( '.ungrouped-allocs .represented-allocation' )
. exists ( { count : 4 } ) ;
// We expect 2 of them to be running, and one to be pending, since running/pending allocations superecede other clientStatuses
assert
. dom ( '.ungrouped-allocs .represented-allocation.running' )
. exists ( { count : 2 } ) ;
assert
. dom ( '.ungrouped-allocs .represented-allocation.pending' )
. exists ( { count : 1 } ) ;
// We expect the lone other allocation to be lost, since it has the highest jobVersion
assert
. dom ( '.ungrouped-allocs .represented-allocation.lost' )
. exists ( { count : 1 } ) ;
// We expect the job versions legend to show 3 at v5 (running, pending, and lost), and 1 at v3 (old running), and none at v4 (failed is not represented)
assert . dom ( '.job-status-panel .versions > ul > li' ) . exists ( { count : 2 } ) ;
assert
. dom ( '.job-status-panel .versions > ul > li > a[data-version="5"]' )
. exists ( { count : 1 } ) ;
assert
. dom ( '.job-status-panel .versions > ul > li > a[data-version="3"]' )
. exists ( { count : 1 } ) ;
assert
. dom ( '.job-status-panel .versions > ul > li > a[data-version="4"]' )
. doesNotExist ( ) ;
await percySnapshot ( assert , {
percyCSS : `
. allocation - row td { display : none ; }
` ,
} ) ;
} ) ;
2023-05-19 19:51:35 +00:00
test ( 'After running/pending allocations are covered, fill in allocs by jobVersion, descending (batch)' , async function ( assert ) {
assert . expect ( 7 ) ;
let job = server . create ( 'job' , {
status : 'running' ,
datacenters : [ '*' ] ,
type : 'batch' ,
resourceSpec : [ 'M: 256, C: 500' ] , // a single group
createAllocations : false ,
allocStatusDistribution : {
running : 0.5 ,
failed : 0.3 ,
unknown : 0 ,
lost : 0 ,
complete : 0.2 ,
} ,
groupTaskCount : 5 ,
shallow : true ,
version : 5 ,
noActiveDeployment : true ,
} ) ;
server . create ( 'allocation' , {
jobId : job . id ,
clientStatus : 'running' ,
jobVersion : 5 ,
} ) ;
server . create ( 'allocation' , {
jobId : job . id ,
clientStatus : 'pending' ,
jobVersion : 5 ,
} ) ;
server . create ( 'allocation' , {
jobId : job . id ,
clientStatus : 'running' ,
jobVersion : 3 ,
} ) ;
server . create ( 'allocation' , {
jobId : job . id ,
clientStatus : 'failed' ,
jobVersion : 4 ,
} ) ;
server . create ( 'allocation' , {
jobId : job . id ,
clientStatus : 'complete' ,
jobVersion : 4 ,
} ) ;
server . create ( 'allocation' , {
jobId : job . id ,
clientStatus : 'lost' ,
jobVersion : 5 ,
} ) ;
await visit ( ` /jobs/ ${ job . id } ` ) ;
assert . dom ( '.job-status-panel' ) . exists ( ) ;
// We expect to see 5 represented-allocations, since that's the number in our groupTaskCount
assert
. dom ( '.ungrouped-allocs .represented-allocation' )
. exists ( { count : 5 } ) ;
// We expect 2 of them to be running, and one to be pending, since running/pending allocations superecede other clientStatuses
assert
. dom ( '.ungrouped-allocs .represented-allocation.running' )
. exists ( { count : 2 } ) ;
assert
. dom ( '.ungrouped-allocs .represented-allocation.pending' )
. exists ( { count : 1 } ) ;
// We expect 1 to be lost, since it has the highest jobVersion
assert
. dom ( '.ungrouped-allocs .represented-allocation.lost' )
. exists ( { count : 1 } ) ;
// We expect the remaining one to be complete, rather than failed, since it comes earlier in the jobAllocStatuses.batch constant
assert
. dom ( '.ungrouped-allocs .represented-allocation.complete' )
. exists ( { count : 1 } ) ;
assert
. dom ( '.ungrouped-allocs .represented-allocation.failed' )
. doesNotExist ( ) ;
await percySnapshot ( assert , {
percyCSS : `
. allocation - row td { display : none ; }
` ,
} ) ;
} ) ;
[ui, feature] Job Page Redesign (#16932)
* [ui] Service job status panel (#16134)
* it begins
* Hacky demo enabled
* Still very hacky but seems deece
* Floor of at least 3 must be shown
* Width from on-high
* Other statuses considered
* More sensible allocTypes listing
* Beginnings of a legend
* Total number of allocs running now maps over job.groups
* Lintfix
* base the number of slots to hold open on actual tallies, which should never exceed totalAllocs
* Versions get yer versions here
* Versions lookin like versions
* Mirage fixup
* Adds Remaining as an alloc chart status and adds historical status option
* Get tests passing again by making job status static for a sec
* Historical status panel click actions moved into their own component class
* job detail tests plz chill
* Testing if percy is fickle
* Hyper-specfic on summary distribution bar identifier
* Perhaps the 2nd allocSummary item no longer exists with the more accurate afterCreate data
* UI Test eschewing the page pattern
* Bones of a new acceptance test
* Track width changes explicitly with window-resize
* testlintfix
* Alloc counting tests
* Alloc grouping test
* Alloc grouping with complex resizing
* Refined the list of showable statuses
* PR feedback addressed
* renamed allocation-row to allocation-status-row
* [ui, job status] Make panel status mode a queryParam (#16345)
* queryParam changing
* Test for QP in panel
* Adding @tracked to legacy controller
* Move the job of switching to Historical out to larger context
* integration test mock passed func
* [ui] Service job deployment status panel (#16383)
* A very fast and loose deployment panel
* Removing Unknown status from the panel
* Set up oldAllocs list in constructor, rather than as a getter/tracked var
* Small amount of template cleanup
* Refactored latest-deployment new logic back into panel.js
* Revert now-unused latest-deployment component
* margin bottom when ungrouped also
* Basic integration tests for job deployment status panel
* Updates complete alloc colour to green for new visualizations only (#16618)
* Updates complete alloc colour to green for new visualizations only
* Pale green instead of dark green for viz in general
* [ui] Job Deployment Status: History and Update Props (#16518)
* Deployment history wooooooo
* Styled deployment history
* Update Params
* lintfix
* Types and groups for updateParams
* Live-updating history
* Harden with types, error states, and pending states
* Refactor updateParams to use trigger component
* [ui] Deployment History search (#16608)
* Functioning searchbox
* Some nice animations for history items
* History search test
* Fixing up some old mirage conventions
* some a11y rule override to account for scss keyframes
* Split panel into deploying and steady components
* HandleError passed from job index
* gridified panel elements
* TotalAllocs added to deploying.js
* Width perc to px
* [ui] Splitting deployment allocs by status, health, and canary status (#16766)
* Initial attempt with lots of scratchpad work
* Style mods per UI discussion
* Fix canary overflow bug
* Dont show canary or health for steady/prev-alloc blocks
* Steady state
* Thanks Julie
* Fixes steady-state versions
* Legen, wait for it...
* Test fixes now that we have a minimum block size
* PR prep
* Shimmer effect on pending and unplaced allocs (#16801)
* Shimmer effect on pending and unplaced
* Dont show animation in the legend
* [ui, deployments] Linking allocblocks and legends to allocation / allocations index routes (#16821)
* Conditional link-to component and basic linking to allocations and allocation routes
* Job versions filter added to allocations index page
* Steady state legends link
* Legend links
* Badge count links for versions
* Fix: faded class on steady-state legend items
* version link now wont show completed ones
* Fix a11y violations with link labels
* Combining some template conditional logic
* [ui, deployments] Conversions on long nanosecond update params (#16882)
* Conversions on long nanosecond nums
* Early return in updateParamGroups comp prop
* [ui, deployments] Mirage Actively Deploying Job and Deployment Integration Tests (#16888)
* Start of deployment alloc test scaffolding
* Bit of test cleanup and canary for ungrouped allocs
* Flakey but more robust integrations for deployment panel
* De-flake acceptance tests and add an actively deploying job to mirage
* Jitter-less alloc status distribution removes my bad math
* bugfix caused by summary.desiredTotal non-null
* More interesting mirage active deployment alloc breakdown
* Further tests for previous-allocs row
* Previous alloc legend tests
* Percy snapshots added to integration test
* changelog
2023-04-25 02:45:39 +00:00
test ( 'Status Panel groups allocations when they get past a threshold' , async function ( assert ) {
assert . expect ( 6 ) ;
faker . seed ( 1 ) ;
let groupTaskCount = 20 ;
let job = server . create ( 'job' , {
status : 'running' ,
datacenters : [ '*' ] ,
type : 'service' ,
resourceSpec : [ 'M: 256, C: 500' ] , // a single group
createAllocations : true ,
allocStatusDistribution : {
running : 1 ,
failed : 0 ,
unknown : 0 ,
lost : 0 ,
} ,
groupTaskCount ,
shallow : true ,
} ) ;
await visit ( ` /jobs/ ${ job . id } ` ) ;
assert . dom ( '.job-status-panel' ) . exists ( ) ;
let jobAllocCount = server . db . allocations . where ( {
jobId : job . id ,
} ) . length ;
assert
. dom ( '.ungrouped-allocs .represented-allocation.running' )
. exists (
{ count : jobAllocCount } ,
` All ${ jobAllocCount } allocations are represented in the status panel, ungrouped `
) ;
groupTaskCount = 40 ;
job = server . create ( 'job' , {
status : 'running' ,
datacenters : [ '*' ] ,
type : 'service' ,
resourceSpec : [ 'M: 256, C: 500' ] , // a single group
createAllocations : true ,
allocStatusDistribution : {
running : 1 ,
failed : 0 ,
unknown : 0 ,
lost : 0 ,
} ,
groupTaskCount ,
shallow : true ,
} ) ;
await visit ( ` /jobs/ ${ job . id } ` ) ;
assert . dom ( '.job-status-panel' ) . exists ( ) ;
jobAllocCount = server . db . allocations . where ( {
jobId : job . id ,
} ) . length ;
// At standard test resolution, 40 allocations will attempt to display 20 ungrouped, and 20 grouped.
let desiredUngroupedAllocCount = 20 ;
assert
. dom ( '.ungrouped-allocs .represented-allocation.running' )
. exists (
{ count : desiredUngroupedAllocCount } ,
` ${ desiredUngroupedAllocCount } allocations are represented ungrouped `
) ;
assert
. dom ( '.represented-allocation.rest' )
. exists ( 'Allocations are numerous enough that a summary block exists' ) ;
assert
. dom ( '.represented-allocation.rest' )
. hasText (
` + ${ groupTaskCount - desiredUngroupedAllocCount } ` ,
'Summary block has the correct number of grouped allocs'
) ;
2023-04-28 18:51:53 +00:00
await percySnapshot ( assert , {
percyCSS : `
. allocation - row td { display : none ; }
` ,
} ) ;
[ui, feature] Job Page Redesign (#16932)
* [ui] Service job status panel (#16134)
* it begins
* Hacky demo enabled
* Still very hacky but seems deece
* Floor of at least 3 must be shown
* Width from on-high
* Other statuses considered
* More sensible allocTypes listing
* Beginnings of a legend
* Total number of allocs running now maps over job.groups
* Lintfix
* base the number of slots to hold open on actual tallies, which should never exceed totalAllocs
* Versions get yer versions here
* Versions lookin like versions
* Mirage fixup
* Adds Remaining as an alloc chart status and adds historical status option
* Get tests passing again by making job status static for a sec
* Historical status panel click actions moved into their own component class
* job detail tests plz chill
* Testing if percy is fickle
* Hyper-specfic on summary distribution bar identifier
* Perhaps the 2nd allocSummary item no longer exists with the more accurate afterCreate data
* UI Test eschewing the page pattern
* Bones of a new acceptance test
* Track width changes explicitly with window-resize
* testlintfix
* Alloc counting tests
* Alloc grouping test
* Alloc grouping with complex resizing
* Refined the list of showable statuses
* PR feedback addressed
* renamed allocation-row to allocation-status-row
* [ui, job status] Make panel status mode a queryParam (#16345)
* queryParam changing
* Test for QP in panel
* Adding @tracked to legacy controller
* Move the job of switching to Historical out to larger context
* integration test mock passed func
* [ui] Service job deployment status panel (#16383)
* A very fast and loose deployment panel
* Removing Unknown status from the panel
* Set up oldAllocs list in constructor, rather than as a getter/tracked var
* Small amount of template cleanup
* Refactored latest-deployment new logic back into panel.js
* Revert now-unused latest-deployment component
* margin bottom when ungrouped also
* Basic integration tests for job deployment status panel
* Updates complete alloc colour to green for new visualizations only (#16618)
* Updates complete alloc colour to green for new visualizations only
* Pale green instead of dark green for viz in general
* [ui] Job Deployment Status: History and Update Props (#16518)
* Deployment history wooooooo
* Styled deployment history
* Update Params
* lintfix
* Types and groups for updateParams
* Live-updating history
* Harden with types, error states, and pending states
* Refactor updateParams to use trigger component
* [ui] Deployment History search (#16608)
* Functioning searchbox
* Some nice animations for history items
* History search test
* Fixing up some old mirage conventions
* some a11y rule override to account for scss keyframes
* Split panel into deploying and steady components
* HandleError passed from job index
* gridified panel elements
* TotalAllocs added to deploying.js
* Width perc to px
* [ui] Splitting deployment allocs by status, health, and canary status (#16766)
* Initial attempt with lots of scratchpad work
* Style mods per UI discussion
* Fix canary overflow bug
* Dont show canary or health for steady/prev-alloc blocks
* Steady state
* Thanks Julie
* Fixes steady-state versions
* Legen, wait for it...
* Test fixes now that we have a minimum block size
* PR prep
* Shimmer effect on pending and unplaced allocs (#16801)
* Shimmer effect on pending and unplaced
* Dont show animation in the legend
* [ui, deployments] Linking allocblocks and legends to allocation / allocations index routes (#16821)
* Conditional link-to component and basic linking to allocations and allocation routes
* Job versions filter added to allocations index page
* Steady state legends link
* Legend links
* Badge count links for versions
* Fix: faded class on steady-state legend items
* version link now wont show completed ones
* Fix a11y violations with link labels
* Combining some template conditional logic
* [ui, deployments] Conversions on long nanosecond update params (#16882)
* Conversions on long nanosecond nums
* Early return in updateParamGroups comp prop
* [ui, deployments] Mirage Actively Deploying Job and Deployment Integration Tests (#16888)
* Start of deployment alloc test scaffolding
* Bit of test cleanup and canary for ungrouped allocs
* Flakey but more robust integrations for deployment panel
* De-flake acceptance tests and add an actively deploying job to mirage
* Jitter-less alloc status distribution removes my bad math
* bugfix caused by summary.desiredTotal non-null
* More interesting mirage active deployment alloc breakdown
* Further tests for previous-allocs row
* Previous alloc legend tests
* Percy snapshots added to integration test
* changelog
2023-04-25 02:45:39 +00:00
} ) ;
test ( 'Status Panel groups allocations when they get past a threshold, multiple statuses' , async function ( assert ) {
let groupTaskCount = 50 ;
let job = server . create ( 'job' , {
status : 'running' ,
datacenters : [ '*' ] ,
type : 'service' ,
resourceSpec : [ 'M: 256, C: 500' ] , // a single group
createAllocations : true ,
allocStatusDistribution : {
running : 0.5 ,
failed : 0.3 ,
pending : 0.1 ,
2023-05-01 19:24:21 +00:00
unknown : 0.1 ,
[ui, feature] Job Page Redesign (#16932)
* [ui] Service job status panel (#16134)
* it begins
* Hacky demo enabled
* Still very hacky but seems deece
* Floor of at least 3 must be shown
* Width from on-high
* Other statuses considered
* More sensible allocTypes listing
* Beginnings of a legend
* Total number of allocs running now maps over job.groups
* Lintfix
* base the number of slots to hold open on actual tallies, which should never exceed totalAllocs
* Versions get yer versions here
* Versions lookin like versions
* Mirage fixup
* Adds Remaining as an alloc chart status and adds historical status option
* Get tests passing again by making job status static for a sec
* Historical status panel click actions moved into their own component class
* job detail tests plz chill
* Testing if percy is fickle
* Hyper-specfic on summary distribution bar identifier
* Perhaps the 2nd allocSummary item no longer exists with the more accurate afterCreate data
* UI Test eschewing the page pattern
* Bones of a new acceptance test
* Track width changes explicitly with window-resize
* testlintfix
* Alloc counting tests
* Alloc grouping test
* Alloc grouping with complex resizing
* Refined the list of showable statuses
* PR feedback addressed
* renamed allocation-row to allocation-status-row
* [ui, job status] Make panel status mode a queryParam (#16345)
* queryParam changing
* Test for QP in panel
* Adding @tracked to legacy controller
* Move the job of switching to Historical out to larger context
* integration test mock passed func
* [ui] Service job deployment status panel (#16383)
* A very fast and loose deployment panel
* Removing Unknown status from the panel
* Set up oldAllocs list in constructor, rather than as a getter/tracked var
* Small amount of template cleanup
* Refactored latest-deployment new logic back into panel.js
* Revert now-unused latest-deployment component
* margin bottom when ungrouped also
* Basic integration tests for job deployment status panel
* Updates complete alloc colour to green for new visualizations only (#16618)
* Updates complete alloc colour to green for new visualizations only
* Pale green instead of dark green for viz in general
* [ui] Job Deployment Status: History and Update Props (#16518)
* Deployment history wooooooo
* Styled deployment history
* Update Params
* lintfix
* Types and groups for updateParams
* Live-updating history
* Harden with types, error states, and pending states
* Refactor updateParams to use trigger component
* [ui] Deployment History search (#16608)
* Functioning searchbox
* Some nice animations for history items
* History search test
* Fixing up some old mirage conventions
* some a11y rule override to account for scss keyframes
* Split panel into deploying and steady components
* HandleError passed from job index
* gridified panel elements
* TotalAllocs added to deploying.js
* Width perc to px
* [ui] Splitting deployment allocs by status, health, and canary status (#16766)
* Initial attempt with lots of scratchpad work
* Style mods per UI discussion
* Fix canary overflow bug
* Dont show canary or health for steady/prev-alloc blocks
* Steady state
* Thanks Julie
* Fixes steady-state versions
* Legen, wait for it...
* Test fixes now that we have a minimum block size
* PR prep
* Shimmer effect on pending and unplaced allocs (#16801)
* Shimmer effect on pending and unplaced
* Dont show animation in the legend
* [ui, deployments] Linking allocblocks and legends to allocation / allocations index routes (#16821)
* Conditional link-to component and basic linking to allocations and allocation routes
* Job versions filter added to allocations index page
* Steady state legends link
* Legend links
* Badge count links for versions
* Fix: faded class on steady-state legend items
* version link now wont show completed ones
* Fix a11y violations with link labels
* Combining some template conditional logic
* [ui, deployments] Conversions on long nanosecond update params (#16882)
* Conversions on long nanosecond nums
* Early return in updateParamGroups comp prop
* [ui, deployments] Mirage Actively Deploying Job and Deployment Integration Tests (#16888)
* Start of deployment alloc test scaffolding
* Bit of test cleanup and canary for ungrouped allocs
* Flakey but more robust integrations for deployment panel
* De-flake acceptance tests and add an actively deploying job to mirage
* Jitter-less alloc status distribution removes my bad math
* bugfix caused by summary.desiredTotal non-null
* More interesting mirage active deployment alloc breakdown
* Further tests for previous-allocs row
* Previous alloc legend tests
* Percy snapshots added to integration test
* changelog
2023-04-25 02:45:39 +00:00
} ,
groupTaskCount ,
shallow : true ,
} ) ;
await visit ( ` /jobs/ ${ job . id } ` ) ;
assert . dom ( '.job-status-panel' ) . exists ( ) ;
// With 50 allocs split across 4 statuses distributed as above, we can expect 25 running, 16 failed, 6 pending, and 4 remaining.
// At standard test resolution, each status will be ungrouped/grouped as follows:
// 25 running: 9 ungrouped, 17 grouped
// 15 failed: 5 ungrouped, 10 grouped
// 5 pending: 0 ungrouped, 5 grouped
2023-05-01 19:24:21 +00:00
// 5 unknown: 0 ungrouped, 5 grouped. Represented as "Unplaced"
[ui, feature] Job Page Redesign (#16932)
* [ui] Service job status panel (#16134)
* it begins
* Hacky demo enabled
* Still very hacky but seems deece
* Floor of at least 3 must be shown
* Width from on-high
* Other statuses considered
* More sensible allocTypes listing
* Beginnings of a legend
* Total number of allocs running now maps over job.groups
* Lintfix
* base the number of slots to hold open on actual tallies, which should never exceed totalAllocs
* Versions get yer versions here
* Versions lookin like versions
* Mirage fixup
* Adds Remaining as an alloc chart status and adds historical status option
* Get tests passing again by making job status static for a sec
* Historical status panel click actions moved into their own component class
* job detail tests plz chill
* Testing if percy is fickle
* Hyper-specfic on summary distribution bar identifier
* Perhaps the 2nd allocSummary item no longer exists with the more accurate afterCreate data
* UI Test eschewing the page pattern
* Bones of a new acceptance test
* Track width changes explicitly with window-resize
* testlintfix
* Alloc counting tests
* Alloc grouping test
* Alloc grouping with complex resizing
* Refined the list of showable statuses
* PR feedback addressed
* renamed allocation-row to allocation-status-row
* [ui, job status] Make panel status mode a queryParam (#16345)
* queryParam changing
* Test for QP in panel
* Adding @tracked to legacy controller
* Move the job of switching to Historical out to larger context
* integration test mock passed func
* [ui] Service job deployment status panel (#16383)
* A very fast and loose deployment panel
* Removing Unknown status from the panel
* Set up oldAllocs list in constructor, rather than as a getter/tracked var
* Small amount of template cleanup
* Refactored latest-deployment new logic back into panel.js
* Revert now-unused latest-deployment component
* margin bottom when ungrouped also
* Basic integration tests for job deployment status panel
* Updates complete alloc colour to green for new visualizations only (#16618)
* Updates complete alloc colour to green for new visualizations only
* Pale green instead of dark green for viz in general
* [ui] Job Deployment Status: History and Update Props (#16518)
* Deployment history wooooooo
* Styled deployment history
* Update Params
* lintfix
* Types and groups for updateParams
* Live-updating history
* Harden with types, error states, and pending states
* Refactor updateParams to use trigger component
* [ui] Deployment History search (#16608)
* Functioning searchbox
* Some nice animations for history items
* History search test
* Fixing up some old mirage conventions
* some a11y rule override to account for scss keyframes
* Split panel into deploying and steady components
* HandleError passed from job index
* gridified panel elements
* TotalAllocs added to deploying.js
* Width perc to px
* [ui] Splitting deployment allocs by status, health, and canary status (#16766)
* Initial attempt with lots of scratchpad work
* Style mods per UI discussion
* Fix canary overflow bug
* Dont show canary or health for steady/prev-alloc blocks
* Steady state
* Thanks Julie
* Fixes steady-state versions
* Legen, wait for it...
* Test fixes now that we have a minimum block size
* PR prep
* Shimmer effect on pending and unplaced allocs (#16801)
* Shimmer effect on pending and unplaced
* Dont show animation in the legend
* [ui, deployments] Linking allocblocks and legends to allocation / allocations index routes (#16821)
* Conditional link-to component and basic linking to allocations and allocation routes
* Job versions filter added to allocations index page
* Steady state legends link
* Legend links
* Badge count links for versions
* Fix: faded class on steady-state legend items
* version link now wont show completed ones
* Fix a11y violations with link labels
* Combining some template conditional logic
* [ui, deployments] Conversions on long nanosecond update params (#16882)
* Conversions on long nanosecond nums
* Early return in updateParamGroups comp prop
* [ui, deployments] Mirage Actively Deploying Job and Deployment Integration Tests (#16888)
* Start of deployment alloc test scaffolding
* Bit of test cleanup and canary for ungrouped allocs
* Flakey but more robust integrations for deployment panel
* De-flake acceptance tests and add an actively deploying job to mirage
* Jitter-less alloc status distribution removes my bad math
* bugfix caused by summary.desiredTotal non-null
* More interesting mirage active deployment alloc breakdown
* Further tests for previous-allocs row
* Previous alloc legend tests
* Percy snapshots added to integration test
* changelog
2023-04-25 02:45:39 +00:00
assert
. dom ( '.ungrouped-allocs .represented-allocation.running' )
. exists ( { count : 9 } , '9 running allocations are represented ungrouped' ) ;
assert
. dom ( '.represented-allocation.rest.running' )
. exists (
'Running allocations are numerous enough that a summary block exists'
) ;
assert
. dom ( '.represented-allocation.rest.running' )
. hasText (
'+16' ,
'Summary block has the correct number of grouped running allocs'
) ;
assert
. dom ( '.ungrouped-allocs .represented-allocation.failed' )
. exists ( { count : 5 } , '5 failed allocations are represented ungrouped' ) ;
assert
. dom ( '.represented-allocation.rest.failed' )
. exists (
'Failed allocations are numerous enough that a summary block exists'
) ;
assert
. dom ( '.represented-allocation.rest.failed' )
. hasText (
'+10' ,
'Summary block has the correct number of grouped failed allocs'
) ;
assert
. dom ( '.ungrouped-allocs .represented-allocation.pending' )
. exists ( { count : 0 } , '0 pending allocations are represented ungrouped' ) ;
assert
. dom ( '.represented-allocation.rest.pending' )
. exists (
'pending allocations are numerous enough that a summary block exists'
) ;
assert
. dom ( '.represented-allocation.rest.pending' )
. hasText (
'5' ,
'Summary block has the correct number of grouped pending allocs'
) ;
assert
. dom ( '.ungrouped-allocs .represented-allocation.unplaced' )
. exists ( { count : 0 } , '0 unplaced allocations are represented ungrouped' ) ;
assert
. dom ( '.represented-allocation.rest.unplaced' )
. exists (
'Unplaced allocations are numerous enough that a summary block exists'
) ;
assert
. dom ( '.represented-allocation.rest.unplaced' )
. hasText (
'5' ,
'Summary block has the correct number of grouped unplaced allocs'
) ;
await percySnapshot (
2023-04-28 18:51:53 +00:00
'Status Panel groups allocations when they get past a threshold, multiple statuses (full width)' ,
{
percyCSS : `
. allocation - row td { display : none ; }
` ,
}
[ui, feature] Job Page Redesign (#16932)
* [ui] Service job status panel (#16134)
* it begins
* Hacky demo enabled
* Still very hacky but seems deece
* Floor of at least 3 must be shown
* Width from on-high
* Other statuses considered
* More sensible allocTypes listing
* Beginnings of a legend
* Total number of allocs running now maps over job.groups
* Lintfix
* base the number of slots to hold open on actual tallies, which should never exceed totalAllocs
* Versions get yer versions here
* Versions lookin like versions
* Mirage fixup
* Adds Remaining as an alloc chart status and adds historical status option
* Get tests passing again by making job status static for a sec
* Historical status panel click actions moved into their own component class
* job detail tests plz chill
* Testing if percy is fickle
* Hyper-specfic on summary distribution bar identifier
* Perhaps the 2nd allocSummary item no longer exists with the more accurate afterCreate data
* UI Test eschewing the page pattern
* Bones of a new acceptance test
* Track width changes explicitly with window-resize
* testlintfix
* Alloc counting tests
* Alloc grouping test
* Alloc grouping with complex resizing
* Refined the list of showable statuses
* PR feedback addressed
* renamed allocation-row to allocation-status-row
* [ui, job status] Make panel status mode a queryParam (#16345)
* queryParam changing
* Test for QP in panel
* Adding @tracked to legacy controller
* Move the job of switching to Historical out to larger context
* integration test mock passed func
* [ui] Service job deployment status panel (#16383)
* A very fast and loose deployment panel
* Removing Unknown status from the panel
* Set up oldAllocs list in constructor, rather than as a getter/tracked var
* Small amount of template cleanup
* Refactored latest-deployment new logic back into panel.js
* Revert now-unused latest-deployment component
* margin bottom when ungrouped also
* Basic integration tests for job deployment status panel
* Updates complete alloc colour to green for new visualizations only (#16618)
* Updates complete alloc colour to green for new visualizations only
* Pale green instead of dark green for viz in general
* [ui] Job Deployment Status: History and Update Props (#16518)
* Deployment history wooooooo
* Styled deployment history
* Update Params
* lintfix
* Types and groups for updateParams
* Live-updating history
* Harden with types, error states, and pending states
* Refactor updateParams to use trigger component
* [ui] Deployment History search (#16608)
* Functioning searchbox
* Some nice animations for history items
* History search test
* Fixing up some old mirage conventions
* some a11y rule override to account for scss keyframes
* Split panel into deploying and steady components
* HandleError passed from job index
* gridified panel elements
* TotalAllocs added to deploying.js
* Width perc to px
* [ui] Splitting deployment allocs by status, health, and canary status (#16766)
* Initial attempt with lots of scratchpad work
* Style mods per UI discussion
* Fix canary overflow bug
* Dont show canary or health for steady/prev-alloc blocks
* Steady state
* Thanks Julie
* Fixes steady-state versions
* Legen, wait for it...
* Test fixes now that we have a minimum block size
* PR prep
* Shimmer effect on pending and unplaced allocs (#16801)
* Shimmer effect on pending and unplaced
* Dont show animation in the legend
* [ui, deployments] Linking allocblocks and legends to allocation / allocations index routes (#16821)
* Conditional link-to component and basic linking to allocations and allocation routes
* Job versions filter added to allocations index page
* Steady state legends link
* Legend links
* Badge count links for versions
* Fix: faded class on steady-state legend items
* version link now wont show completed ones
* Fix a11y violations with link labels
* Combining some template conditional logic
* [ui, deployments] Conversions on long nanosecond update params (#16882)
* Conversions on long nanosecond nums
* Early return in updateParamGroups comp prop
* [ui, deployments] Mirage Actively Deploying Job and Deployment Integration Tests (#16888)
* Start of deployment alloc test scaffolding
* Bit of test cleanup and canary for ungrouped allocs
* Flakey but more robust integrations for deployment panel
* De-flake acceptance tests and add an actively deploying job to mirage
* Jitter-less alloc status distribution removes my bad math
* bugfix caused by summary.desiredTotal non-null
* More interesting mirage active deployment alloc breakdown
* Further tests for previous-allocs row
* Previous alloc legend tests
* Percy snapshots added to integration test
* changelog
2023-04-25 02:45:39 +00:00
) ;
// Simulate a window resize event; will recompute how many of each ought to be grouped.
// At 1100px, only running and failed allocations have some ungrouped allocs
find ( '.page-body' ) . style . width = '1100px' ;
await triggerEvent ( window , 'resize' ) ;
await percySnapshot (
2023-04-28 18:51:53 +00:00
'Status Panel groups allocations when they get past a threshold, multiple statuses (1100px)' ,
{
percyCSS : `
. allocation - row td { display : none ; }
` ,
}
[ui, feature] Job Page Redesign (#16932)
* [ui] Service job status panel (#16134)
* it begins
* Hacky demo enabled
* Still very hacky but seems deece
* Floor of at least 3 must be shown
* Width from on-high
* Other statuses considered
* More sensible allocTypes listing
* Beginnings of a legend
* Total number of allocs running now maps over job.groups
* Lintfix
* base the number of slots to hold open on actual tallies, which should never exceed totalAllocs
* Versions get yer versions here
* Versions lookin like versions
* Mirage fixup
* Adds Remaining as an alloc chart status and adds historical status option
* Get tests passing again by making job status static for a sec
* Historical status panel click actions moved into their own component class
* job detail tests plz chill
* Testing if percy is fickle
* Hyper-specfic on summary distribution bar identifier
* Perhaps the 2nd allocSummary item no longer exists with the more accurate afterCreate data
* UI Test eschewing the page pattern
* Bones of a new acceptance test
* Track width changes explicitly with window-resize
* testlintfix
* Alloc counting tests
* Alloc grouping test
* Alloc grouping with complex resizing
* Refined the list of showable statuses
* PR feedback addressed
* renamed allocation-row to allocation-status-row
* [ui, job status] Make panel status mode a queryParam (#16345)
* queryParam changing
* Test for QP in panel
* Adding @tracked to legacy controller
* Move the job of switching to Historical out to larger context
* integration test mock passed func
* [ui] Service job deployment status panel (#16383)
* A very fast and loose deployment panel
* Removing Unknown status from the panel
* Set up oldAllocs list in constructor, rather than as a getter/tracked var
* Small amount of template cleanup
* Refactored latest-deployment new logic back into panel.js
* Revert now-unused latest-deployment component
* margin bottom when ungrouped also
* Basic integration tests for job deployment status panel
* Updates complete alloc colour to green for new visualizations only (#16618)
* Updates complete alloc colour to green for new visualizations only
* Pale green instead of dark green for viz in general
* [ui] Job Deployment Status: History and Update Props (#16518)
* Deployment history wooooooo
* Styled deployment history
* Update Params
* lintfix
* Types and groups for updateParams
* Live-updating history
* Harden with types, error states, and pending states
* Refactor updateParams to use trigger component
* [ui] Deployment History search (#16608)
* Functioning searchbox
* Some nice animations for history items
* History search test
* Fixing up some old mirage conventions
* some a11y rule override to account for scss keyframes
* Split panel into deploying and steady components
* HandleError passed from job index
* gridified panel elements
* TotalAllocs added to deploying.js
* Width perc to px
* [ui] Splitting deployment allocs by status, health, and canary status (#16766)
* Initial attempt with lots of scratchpad work
* Style mods per UI discussion
* Fix canary overflow bug
* Dont show canary or health for steady/prev-alloc blocks
* Steady state
* Thanks Julie
* Fixes steady-state versions
* Legen, wait for it...
* Test fixes now that we have a minimum block size
* PR prep
* Shimmer effect on pending and unplaced allocs (#16801)
* Shimmer effect on pending and unplaced
* Dont show animation in the legend
* [ui, deployments] Linking allocblocks and legends to allocation / allocations index routes (#16821)
* Conditional link-to component and basic linking to allocations and allocation routes
* Job versions filter added to allocations index page
* Steady state legends link
* Legend links
* Badge count links for versions
* Fix: faded class on steady-state legend items
* version link now wont show completed ones
* Fix a11y violations with link labels
* Combining some template conditional logic
* [ui, deployments] Conversions on long nanosecond update params (#16882)
* Conversions on long nanosecond nums
* Early return in updateParamGroups comp prop
* [ui, deployments] Mirage Actively Deploying Job and Deployment Integration Tests (#16888)
* Start of deployment alloc test scaffolding
* Bit of test cleanup and canary for ungrouped allocs
* Flakey but more robust integrations for deployment panel
* De-flake acceptance tests and add an actively deploying job to mirage
* Jitter-less alloc status distribution removes my bad math
* bugfix caused by summary.desiredTotal non-null
* More interesting mirage active deployment alloc breakdown
* Further tests for previous-allocs row
* Previous alloc legend tests
* Percy snapshots added to integration test
* changelog
2023-04-25 02:45:39 +00:00
) ;
assert
. dom ( '.ungrouped-allocs .represented-allocation.running' )
. exists ( { count : 7 } , '7 running allocations are represented ungrouped' ) ;
assert
. dom ( '.represented-allocation.rest.running' )
. exists (
'Running allocations are numerous enough that a summary block exists'
) ;
assert
. dom ( '.represented-allocation.rest.running' )
. hasText (
'+18' ,
'Summary block has the correct number of grouped running allocs'
) ;
assert
. dom ( '.ungrouped-allocs .represented-allocation.failed' )
. exists ( { count : 4 } , '4 failed allocations are represented ungrouped' ) ;
assert
. dom ( '.represented-allocation.rest.failed' )
. exists (
'Failed allocations are numerous enough that a summary block exists'
) ;
assert
. dom ( '.represented-allocation.rest.failed' )
. hasText (
'+11' ,
'Summary block has the correct number of grouped failed allocs'
) ;
// At 500px, only running allocations have some ungrouped allocs. The rest are all fully grouped.
find ( '.page-body' ) . style . width = '800px' ;
await triggerEvent ( window , 'resize' ) ;
await percySnapshot (
2023-04-28 18:51:53 +00:00
'Status Panel groups allocations when they get past a threshold, multiple statuses (500px)' ,
{
percyCSS : `
. allocation - row td { display : none ; }
` ,
}
[ui, feature] Job Page Redesign (#16932)
* [ui] Service job status panel (#16134)
* it begins
* Hacky demo enabled
* Still very hacky but seems deece
* Floor of at least 3 must be shown
* Width from on-high
* Other statuses considered
* More sensible allocTypes listing
* Beginnings of a legend
* Total number of allocs running now maps over job.groups
* Lintfix
* base the number of slots to hold open on actual tallies, which should never exceed totalAllocs
* Versions get yer versions here
* Versions lookin like versions
* Mirage fixup
* Adds Remaining as an alloc chart status and adds historical status option
* Get tests passing again by making job status static for a sec
* Historical status panel click actions moved into their own component class
* job detail tests plz chill
* Testing if percy is fickle
* Hyper-specfic on summary distribution bar identifier
* Perhaps the 2nd allocSummary item no longer exists with the more accurate afterCreate data
* UI Test eschewing the page pattern
* Bones of a new acceptance test
* Track width changes explicitly with window-resize
* testlintfix
* Alloc counting tests
* Alloc grouping test
* Alloc grouping with complex resizing
* Refined the list of showable statuses
* PR feedback addressed
* renamed allocation-row to allocation-status-row
* [ui, job status] Make panel status mode a queryParam (#16345)
* queryParam changing
* Test for QP in panel
* Adding @tracked to legacy controller
* Move the job of switching to Historical out to larger context
* integration test mock passed func
* [ui] Service job deployment status panel (#16383)
* A very fast and loose deployment panel
* Removing Unknown status from the panel
* Set up oldAllocs list in constructor, rather than as a getter/tracked var
* Small amount of template cleanup
* Refactored latest-deployment new logic back into panel.js
* Revert now-unused latest-deployment component
* margin bottom when ungrouped also
* Basic integration tests for job deployment status panel
* Updates complete alloc colour to green for new visualizations only (#16618)
* Updates complete alloc colour to green for new visualizations only
* Pale green instead of dark green for viz in general
* [ui] Job Deployment Status: History and Update Props (#16518)
* Deployment history wooooooo
* Styled deployment history
* Update Params
* lintfix
* Types and groups for updateParams
* Live-updating history
* Harden with types, error states, and pending states
* Refactor updateParams to use trigger component
* [ui] Deployment History search (#16608)
* Functioning searchbox
* Some nice animations for history items
* History search test
* Fixing up some old mirage conventions
* some a11y rule override to account for scss keyframes
* Split panel into deploying and steady components
* HandleError passed from job index
* gridified panel elements
* TotalAllocs added to deploying.js
* Width perc to px
* [ui] Splitting deployment allocs by status, health, and canary status (#16766)
* Initial attempt with lots of scratchpad work
* Style mods per UI discussion
* Fix canary overflow bug
* Dont show canary or health for steady/prev-alloc blocks
* Steady state
* Thanks Julie
* Fixes steady-state versions
* Legen, wait for it...
* Test fixes now that we have a minimum block size
* PR prep
* Shimmer effect on pending and unplaced allocs (#16801)
* Shimmer effect on pending and unplaced
* Dont show animation in the legend
* [ui, deployments] Linking allocblocks and legends to allocation / allocations index routes (#16821)
* Conditional link-to component and basic linking to allocations and allocation routes
* Job versions filter added to allocations index page
* Steady state legends link
* Legend links
* Badge count links for versions
* Fix: faded class on steady-state legend items
* version link now wont show completed ones
* Fix a11y violations with link labels
* Combining some template conditional logic
* [ui, deployments] Conversions on long nanosecond update params (#16882)
* Conversions on long nanosecond nums
* Early return in updateParamGroups comp prop
* [ui, deployments] Mirage Actively Deploying Job and Deployment Integration Tests (#16888)
* Start of deployment alloc test scaffolding
* Bit of test cleanup and canary for ungrouped allocs
* Flakey but more robust integrations for deployment panel
* De-flake acceptance tests and add an actively deploying job to mirage
* Jitter-less alloc status distribution removes my bad math
* bugfix caused by summary.desiredTotal non-null
* More interesting mirage active deployment alloc breakdown
* Further tests for previous-allocs row
* Previous alloc legend tests
* Percy snapshots added to integration test
* changelog
2023-04-25 02:45:39 +00:00
) ;
assert
. dom ( '.ungrouped-allocs .represented-allocation.running' )
. exists ( { count : 4 } , '4 running allocations are represented ungrouped' ) ;
assert
. dom ( '.represented-allocation.rest.running' )
. exists (
'Running allocations are numerous enough that a summary block exists'
) ;
assert
. dom ( '.represented-allocation.rest.running' )
. hasText (
'+21' ,
'Summary block has the correct number of grouped running allocs'
) ;
assert
. dom ( '.ungrouped-allocs .represented-allocation.failed' )
. doesNotExist ( 'no failed allocations are represented ungrouped' ) ;
assert
. dom ( '.represented-allocation.rest.failed' )
. exists (
'Failed allocations are numerous enough that a summary block exists'
) ;
assert
. dom ( '.represented-allocation.rest.failed' )
. hasText (
'15' ,
'Summary block has the correct number of grouped failed allocs'
) ;
} ) ;
2023-05-01 19:24:21 +00:00
test ( 'Restarted/Rescheduled/Failed numbers reflected correctly' , async function ( assert ) {
this . store = this . owner . lookup ( 'service:store' ) ;
let groupTaskCount = 10 ;
let job = server . create ( 'job' , {
status : 'running' ,
datacenters : [ '*' ] ,
type : 'service' ,
resourceSpec : [ 'M: 256, C: 500' ] , // a single group
createAllocations : true ,
allocStatusDistribution : {
running : 0.5 ,
failed : 0.5 ,
unknown : 0 ,
lost : 0 ,
} ,
groupTaskCount ,
activeDeployment : true ,
shallow : true ,
2023-05-05 20:25:21 +00:00
version : 0 ,
2023-05-01 19:24:21 +00:00
} ) ;
let state = server . create ( 'task-state' ) ;
state . events = server . schema . taskEvents . where ( { taskStateId : state . id } ) ;
server . schema . allocations . where ( { jobId : job . id } ) . update ( {
taskStateIds : [ state . id ] ,
jobVersion : 0 ,
} ) ;
await visit ( ` /jobs/ ${ job . id } ` ) ;
assert . dom ( '.job-status-panel' ) . exists ( ) ;
assert
2023-05-25 18:20:48 +00:00
. dom ( '.failed-or-lost-links > span' )
2023-05-01 19:24:21 +00:00
. exists ( { count : 2 } , 'Restarted and Rescheduled cells are both present' ) ;
2023-05-25 18:20:48 +00:00
// await this.pauseTest();
let rescheduledCell = [ ... findAll ( '.failed-or-lost-links > span' ) ] [ 0 ] ;
let restartedCell = [ ... findAll ( '.failed-or-lost-links > span' ) ] [ 1 ] ;
2023-05-01 19:24:21 +00:00
// Check that the title in each cell has the right text
2023-05-25 18:20:48 +00:00
assert . dom ( rescheduledCell ) . hasText ( '0 Rescheduled' ) ;
assert . dom ( restartedCell ) . hasText ( '0 Restarted' ) ;
2023-05-01 19:24:21 +00:00
// Check that both values are zero and non-links
assert
. dom ( rescheduledCell . querySelector ( 'a' ) )
. doesNotExist ( 'Rescheduled cell is not a link' ) ;
assert
2023-05-25 18:20:48 +00:00
. dom ( rescheduledCell )
. hasText ( '0 Rescheduled' , 'Rescheduled cell has zero value' ) ;
2023-05-01 19:24:21 +00:00
assert
. dom ( restartedCell . querySelector ( 'a' ) )
. doesNotExist ( 'Restarted cell is not a link' ) ;
assert
2023-05-25 18:20:48 +00:00
. dom ( restartedCell )
. hasText ( '0 Restarted' , 'Restarted cell has zero value' ) ;
2023-05-01 19:24:21 +00:00
// A wild event appears! Change a recent task event to type "Restarting" in a task state:
this . store
. peekAll ( 'job' )
. objectAt ( 0 )
. get ( 'allocations' )
. objectAt ( 0 )
. get ( 'states' )
. objectAt ( 0 )
. get ( 'events' )
. objectAt ( 0 )
. set ( 'type' , 'Restarting' ) ;
await settled ( ) ;
assert
2023-05-25 18:20:48 +00:00
. dom ( restartedCell )
2023-05-01 19:24:21 +00:00
. hasText (
2023-05-25 18:20:48 +00:00
'1 Restarted' ,
2023-05-01 19:24:21 +00:00
'Restarted cell updates when a task event with type "Restarting" is added'
) ;
this . store
. peekAll ( 'job' )
. objectAt ( 0 )
. get ( 'allocations' )
. objectAt ( 1 )
. get ( 'states' )
. objectAt ( 0 )
. get ( 'events' )
. objectAt ( 0 )
. set ( 'type' , 'Restarting' ) ;
await settled ( ) ;
// Trigger a reschedule! Set up a desiredTransition object with a Reschedule property on one of the allocations.
assert
2023-05-25 18:20:48 +00:00
. dom ( restartedCell )
2023-05-01 19:24:21 +00:00
. hasText (
2023-05-25 18:20:48 +00:00
'2 Restarted' ,
2023-05-01 19:24:21 +00:00
'Restarted cell updates when a second task event with type "Restarting" is added'
) ;
this . store
. peekAll ( 'job' )
. objectAt ( 0 )
. get ( 'allocations' )
. objectAt ( 0 )
. get ( 'followUpEvaluation' )
. set ( 'content' , { 'test-key' : 'not-empty' } ) ;
await settled ( ) ;
assert
2023-05-25 18:20:48 +00:00
. dom ( rescheduledCell )
. hasText (
'1 Rescheduled' ,
'Rescheduled cell updates when desiredTransition is set'
) ;
2023-05-01 19:24:21 +00:00
assert
. dom ( rescheduledCell . querySelector ( 'a' ) )
. exists ( 'Rescheduled cell with a non-zero number is now a link' ) ;
} ) ;
[ui, feature] Job Page Redesign (#16932)
* [ui] Service job status panel (#16134)
* it begins
* Hacky demo enabled
* Still very hacky but seems deece
* Floor of at least 3 must be shown
* Width from on-high
* Other statuses considered
* More sensible allocTypes listing
* Beginnings of a legend
* Total number of allocs running now maps over job.groups
* Lintfix
* base the number of slots to hold open on actual tallies, which should never exceed totalAllocs
* Versions get yer versions here
* Versions lookin like versions
* Mirage fixup
* Adds Remaining as an alloc chart status and adds historical status option
* Get tests passing again by making job status static for a sec
* Historical status panel click actions moved into their own component class
* job detail tests plz chill
* Testing if percy is fickle
* Hyper-specfic on summary distribution bar identifier
* Perhaps the 2nd allocSummary item no longer exists with the more accurate afterCreate data
* UI Test eschewing the page pattern
* Bones of a new acceptance test
* Track width changes explicitly with window-resize
* testlintfix
* Alloc counting tests
* Alloc grouping test
* Alloc grouping with complex resizing
* Refined the list of showable statuses
* PR feedback addressed
* renamed allocation-row to allocation-status-row
* [ui, job status] Make panel status mode a queryParam (#16345)
* queryParam changing
* Test for QP in panel
* Adding @tracked to legacy controller
* Move the job of switching to Historical out to larger context
* integration test mock passed func
* [ui] Service job deployment status panel (#16383)
* A very fast and loose deployment panel
* Removing Unknown status from the panel
* Set up oldAllocs list in constructor, rather than as a getter/tracked var
* Small amount of template cleanup
* Refactored latest-deployment new logic back into panel.js
* Revert now-unused latest-deployment component
* margin bottom when ungrouped also
* Basic integration tests for job deployment status panel
* Updates complete alloc colour to green for new visualizations only (#16618)
* Updates complete alloc colour to green for new visualizations only
* Pale green instead of dark green for viz in general
* [ui] Job Deployment Status: History and Update Props (#16518)
* Deployment history wooooooo
* Styled deployment history
* Update Params
* lintfix
* Types and groups for updateParams
* Live-updating history
* Harden with types, error states, and pending states
* Refactor updateParams to use trigger component
* [ui] Deployment History search (#16608)
* Functioning searchbox
* Some nice animations for history items
* History search test
* Fixing up some old mirage conventions
* some a11y rule override to account for scss keyframes
* Split panel into deploying and steady components
* HandleError passed from job index
* gridified panel elements
* TotalAllocs added to deploying.js
* Width perc to px
* [ui] Splitting deployment allocs by status, health, and canary status (#16766)
* Initial attempt with lots of scratchpad work
* Style mods per UI discussion
* Fix canary overflow bug
* Dont show canary or health for steady/prev-alloc blocks
* Steady state
* Thanks Julie
* Fixes steady-state versions
* Legen, wait for it...
* Test fixes now that we have a minimum block size
* PR prep
* Shimmer effect on pending and unplaced allocs (#16801)
* Shimmer effect on pending and unplaced
* Dont show animation in the legend
* [ui, deployments] Linking allocblocks and legends to allocation / allocations index routes (#16821)
* Conditional link-to component and basic linking to allocations and allocation routes
* Job versions filter added to allocations index page
* Steady state legends link
* Legend links
* Badge count links for versions
* Fix: faded class on steady-state legend items
* version link now wont show completed ones
* Fix a11y violations with link labels
* Combining some template conditional logic
* [ui, deployments] Conversions on long nanosecond update params (#16882)
* Conversions on long nanosecond nums
* Early return in updateParamGroups comp prop
* [ui, deployments] Mirage Actively Deploying Job and Deployment Integration Tests (#16888)
* Start of deployment alloc test scaffolding
* Bit of test cleanup and canary for ungrouped allocs
* Flakey but more robust integrations for deployment panel
* De-flake acceptance tests and add an actively deploying job to mirage
* Jitter-less alloc status distribution removes my bad math
* bugfix caused by summary.desiredTotal non-null
* More interesting mirage active deployment alloc breakdown
* Further tests for previous-allocs row
* Previous alloc legend tests
* Percy snapshots added to integration test
* changelog
2023-04-25 02:45:39 +00:00
module ( 'deployment history' , function ( ) {
test ( 'Deployment history can be searched' , async function ( assert ) {
faker . seed ( 1 ) ;
let groupTaskCount = 10 ;
let job = server . create ( 'job' , {
status : 'running' ,
datacenters : [ '*' ] ,
type : 'service' ,
resourceSpec : [ 'M: 256, C: 500' ] , // a single group
createAllocations : true ,
allocStatusDistribution : {
running : 1 ,
failed : 0 ,
unknown : 0 ,
lost : 0 ,
} ,
groupTaskCount ,
shallow : true ,
activeDeployment : true ,
version : 0 ,
} ) ;
let state = server . create ( 'task-state' ) ;
state . events = server . schema . taskEvents . where ( { taskStateId : state . id } ) ;
server . schema . allocations . where ( { jobId : job . id } ) . update ( {
taskStateIds : [ state . id ] ,
jobVersion : 0 ,
} ) ;
await visit ( ` /jobs/ ${ job . id } ` ) ;
assert . dom ( '.job-status-panel' ) . exists ( ) ;
const serverEvents = server . schema . taskEvents . where ( {
taskStateId : state . id ,
} ) ;
const shownEvents = findAll ( '.timeline-object' ) ;
const jobAllocations = server . db . allocations . where ( { jobId : job . id } ) ;
assert . equal (
shownEvents . length ,
serverEvents . length * jobAllocations . length ,
'All events are shown'
) ;
await fillIn (
'[data-test-history-search] input' ,
serverEvents . models [ 0 ] . message
) ;
assert . equal (
findAll ( '.timeline-object' ) . length ,
jobAllocations . length ,
'Only events matching the search are shown'
) ;
await fillIn ( '[data-test-history-search] input' , 'foo bar baz' ) ;
assert
. dom ( '[data-test-history-search-no-match]' )
. exists ( 'No match message is shown' ) ;
} ) ;
} ) ;
2023-05-05 20:25:21 +00:00
2023-05-10 20:59:33 +00:00
module ( 'Batch jobs' , function ( ) {
test ( 'Batch jobs have a valid Completed status' , async function ( assert ) {
this . store = this . owner . lookup ( 'service:store' ) ;
let batchJob = server . create ( 'job' , {
status : 'running' ,
datacenters : [ '*' ] ,
type : 'batch' ,
createAllocations : true ,
allocStatusDistribution : {
running : 0.5 ,
failed : 0.3 ,
unknown : 0 ,
lost : 0 ,
complete : 0.2 ,
} ,
groupTaskCount : 10 ,
noActiveDeployment : true ,
shallow : true ,
2023-05-11 14:23:23 +00:00
version : 1 ,
2023-05-10 20:59:33 +00:00
} ) ;
let serviceJob = server . create ( 'job' , {
status : 'running' ,
datacenters : [ '*' ] ,
type : 'service' ,
createAllocations : true ,
allocStatusDistribution : {
running : 0.5 ,
failed : 0.3 ,
unknown : 0 ,
lost : 0 ,
complete : 0.2 ,
} ,
groupTaskCount : 10 ,
noActiveDeployment : true ,
shallow : true ,
2023-05-11 14:23:23 +00:00
version : 1 ,
2023-05-10 20:59:33 +00:00
} ) ;
// Batch job should have 5 running, 3 failed, 2 completed
await visit ( ` /jobs/ ${ batchJob . id } ` ) ;
assert . dom ( '.job-status-panel' ) . exists ( ) ;
2023-05-11 14:23:23 +00:00
assert
. dom ( '.running-allocs-title' )
. hasText (
'5/8 Remaining Allocations Running' ,
'Completed allocations do not count toward the Remaining denominator'
) ;
2023-05-10 20:59:33 +00:00
assert
. dom ( '.ungrouped-allocs .represented-allocation.complete' )
. exists (
{ count : 2 } ,
` 2 complete allocations are represented in the status panel `
) ;
// Service job should have 5 running, 3 failed, 2 unplaced
await visit ( ` /jobs/ ${ serviceJob . id } ` ) ;
assert . dom ( '.job-status-panel' ) . exists ( ) ;
assert . dom ( '.running-allocs-title' ) . hasText ( '5/10 Allocations Running' ) ;
assert
. dom ( '.ungrouped-allocs .represented-allocation.complete' )
. doesNotExist (
'For a service job, no copmlete allocations are represented in the status panel'
) ;
assert
. dom ( '.ungrouped-allocs .represented-allocation.unplaced' )
. exists (
{ count : 2 } ,
` 2 unplaced allocations are represented in the status panel `
) ;
} ) ;
} ) ;
2023-05-05 20:25:21 +00:00
module ( 'System jobs' , function ( ) {
test ( 'System jobs show restarted but not rescheduled allocs' , async function ( assert ) {
this . store = this . owner . lookup ( 'service:store' ) ;
let job = server . create ( 'job' , {
status : 'running' ,
datacenters : [ '*' ] ,
type : 'system' ,
createAllocations : true ,
allocStatusDistribution : {
running : 0.5 ,
failed : 0.5 ,
unknown : 0 ,
lost : 0 ,
} ,
noActiveDeployment : true ,
shallow : true ,
version : 0 ,
} ) ;
let state = server . create ( 'task-state' ) ;
state . events = server . schema . taskEvents . where ( { taskStateId : state . id } ) ;
server . schema . allocations . where ( { jobId : job . id } ) . update ( {
taskStateIds : [ state . id ] ,
jobVersion : 0 ,
} ) ;
await visit ( ` /jobs/ ${ job . id } ` ) ;
assert . dom ( '.job-status-panel' ) . exists ( ) ;
assert . dom ( '.failed-or-lost' ) . exists ( { count : 1 } ) ;
2023-05-25 18:20:48 +00:00
assert . dom ( '.failed-or-lost h4' ) . hasText ( 'Replaced Allocations' ) ;
2023-05-05 20:25:21 +00:00
assert
2023-05-25 18:20:48 +00:00
. dom ( '.failed-or-lost-links > span' )
. hasText ( '0 Restarted' , 'Restarted cell at zero by default' ) ;
2023-05-05 20:25:21 +00:00
// A wild event appears! Change a recent task event to type "Restarting" in a task state:
this . store
. peekAll ( 'job' )
. objectAt ( 0 )
. get ( 'allocations' )
. objectAt ( 0 )
. get ( 'states' )
. objectAt ( 0 )
. get ( 'events' )
. objectAt ( 0 )
. set ( 'type' , 'Restarting' ) ;
await settled ( ) ;
assert
2023-05-25 18:20:48 +00:00
. dom ( '.failed-or-lost-links > span' )
2023-05-05 20:25:21 +00:00
. hasText (
2023-05-25 18:20:48 +00:00
'1 Restarted' ,
2023-05-05 20:25:21 +00:00
'Restarted cell updates when a task event with type "Restarting" is added'
) ;
} ) ;
test ( 'System jobs do not have a sense of Desired/Total allocs' , async function ( assert ) {
this . store = this . owner . lookup ( 'service:store' ) ;
server . db . nodes . remove ( ) ;
server . createList ( 'node' , 3 , {
status : 'ready' ,
drain : false ,
schedulingEligibility : 'eligible' ,
} ) ;
let job = server . create ( 'job' , {
status : 'running' ,
datacenters : [ '*' ] ,
type : 'system' ,
createAllocations : false ,
noActiveDeployment : true ,
shallow : true ,
version : 0 ,
} ) ;
// Create an allocation on this job for each node
server . schema . nodes . all ( ) . models . forEach ( ( node ) => {
server . create ( 'allocation' , {
jobId : job . id ,
jobVersion : 0 ,
clientStatus : 'running' ,
nodeId : node . id ,
} ) ;
} ) ;
await visit ( ` /jobs/ ${ job . id } ` ) ;
let storedJob = await this . store . find (
'job' ,
JSON . stringify ( [ job . id , 'default' ] )
) ;
// Weird Mirage thing: job summary factory is disconnected from its job and therefore allocations.
// So we manually create the number here.
let summary = await storedJob . get ( 'summary' ) ;
summary
. get ( 'taskGroupSummaries' )
. objectAt ( 0 )
. set (
'runningAllocs' ,
server . schema . allocations . where ( {
jobId : job . id ,
clientStatus : 'running' ,
} ) . length
) ;
await settled ( ) ;
assert . dom ( '.job-status-panel' ) . exists ( ) ;
assert . dom ( '.running-allocs-title' ) . hasText (
` ${
server . schema . allocations . where ( {
jobId : job . id ,
clientStatus : 'running' ,
} ) . length
} Allocations Running `
) ;
// Let's bring another node online!
let newNode = server . create ( 'node' , {
status : 'ready' ,
drain : false ,
schedulingEligibility : 'eligible' ,
} ) ;
// Let's expect our scheduler to have therefore added an alloc to it
server . create ( 'allocation' , {
jobId : job . id ,
jobVersion : 0 ,
clientStatus : 'running' ,
nodeId : newNode . id ,
} ) ;
summary
. get ( 'taskGroupSummaries' )
. objectAt ( 0 )
. set (
'runningAllocs' ,
server . schema . allocations . where ( {
jobId : job . id ,
clientStatus : 'running' ,
} ) . length
) ;
await settled ( ) ;
assert . dom ( '.running-allocs-title' ) . hasText ( '4 Allocations Running' ) ;
} ) ;
} ) ;
[ui, feature] Job Page Redesign (#16932)
* [ui] Service job status panel (#16134)
* it begins
* Hacky demo enabled
* Still very hacky but seems deece
* Floor of at least 3 must be shown
* Width from on-high
* Other statuses considered
* More sensible allocTypes listing
* Beginnings of a legend
* Total number of allocs running now maps over job.groups
* Lintfix
* base the number of slots to hold open on actual tallies, which should never exceed totalAllocs
* Versions get yer versions here
* Versions lookin like versions
* Mirage fixup
* Adds Remaining as an alloc chart status and adds historical status option
* Get tests passing again by making job status static for a sec
* Historical status panel click actions moved into their own component class
* job detail tests plz chill
* Testing if percy is fickle
* Hyper-specfic on summary distribution bar identifier
* Perhaps the 2nd allocSummary item no longer exists with the more accurate afterCreate data
* UI Test eschewing the page pattern
* Bones of a new acceptance test
* Track width changes explicitly with window-resize
* testlintfix
* Alloc counting tests
* Alloc grouping test
* Alloc grouping with complex resizing
* Refined the list of showable statuses
* PR feedback addressed
* renamed allocation-row to allocation-status-row
* [ui, job status] Make panel status mode a queryParam (#16345)
* queryParam changing
* Test for QP in panel
* Adding @tracked to legacy controller
* Move the job of switching to Historical out to larger context
* integration test mock passed func
* [ui] Service job deployment status panel (#16383)
* A very fast and loose deployment panel
* Removing Unknown status from the panel
* Set up oldAllocs list in constructor, rather than as a getter/tracked var
* Small amount of template cleanup
* Refactored latest-deployment new logic back into panel.js
* Revert now-unused latest-deployment component
* margin bottom when ungrouped also
* Basic integration tests for job deployment status panel
* Updates complete alloc colour to green for new visualizations only (#16618)
* Updates complete alloc colour to green for new visualizations only
* Pale green instead of dark green for viz in general
* [ui] Job Deployment Status: History and Update Props (#16518)
* Deployment history wooooooo
* Styled deployment history
* Update Params
* lintfix
* Types and groups for updateParams
* Live-updating history
* Harden with types, error states, and pending states
* Refactor updateParams to use trigger component
* [ui] Deployment History search (#16608)
* Functioning searchbox
* Some nice animations for history items
* History search test
* Fixing up some old mirage conventions
* some a11y rule override to account for scss keyframes
* Split panel into deploying and steady components
* HandleError passed from job index
* gridified panel elements
* TotalAllocs added to deploying.js
* Width perc to px
* [ui] Splitting deployment allocs by status, health, and canary status (#16766)
* Initial attempt with lots of scratchpad work
* Style mods per UI discussion
* Fix canary overflow bug
* Dont show canary or health for steady/prev-alloc blocks
* Steady state
* Thanks Julie
* Fixes steady-state versions
* Legen, wait for it...
* Test fixes now that we have a minimum block size
* PR prep
* Shimmer effect on pending and unplaced allocs (#16801)
* Shimmer effect on pending and unplaced
* Dont show animation in the legend
* [ui, deployments] Linking allocblocks and legends to allocation / allocations index routes (#16821)
* Conditional link-to component and basic linking to allocations and allocation routes
* Job versions filter added to allocations index page
* Steady state legends link
* Legend links
* Badge count links for versions
* Fix: faded class on steady-state legend items
* version link now wont show completed ones
* Fix a11y violations with link labels
* Combining some template conditional logic
* [ui, deployments] Conversions on long nanosecond update params (#16882)
* Conversions on long nanosecond nums
* Early return in updateParamGroups comp prop
* [ui, deployments] Mirage Actively Deploying Job and Deployment Integration Tests (#16888)
* Start of deployment alloc test scaffolding
* Bit of test cleanup and canary for ungrouped allocs
* Flakey but more robust integrations for deployment panel
* De-flake acceptance tests and add an actively deploying job to mirage
* Jitter-less alloc status distribution removes my bad math
* bugfix caused by summary.desiredTotal non-null
* More interesting mirage active deployment alloc breakdown
* Further tests for previous-allocs row
* Previous alloc legend tests
* Percy snapshots added to integration test
* changelog
2023-04-25 02:45:39 +00:00
} ) ;