@@ -56,96 +56,97 @@ export class TestRunsComponent implements OnInit {
56
56
this . testRun = {
57
57
project_id : this . route . snapshot . params [ 'projectId' ]
58
58
} ;
59
- await this . milestoneService . getMilestone ( { project_id : this . route . snapshot . params [ 'projectId' ] } ) . then ( res => {
60
- this . milestones = res ;
61
- } ) ;
62
- await this . testrunService . getTestsRunLabels ( 0 ) . subscribe ( res => {
63
- this . labels = res ;
64
- } ) ;
65
- await this . testSuiteService . getTestSuite ( { project_id : this . route . snapshot . params [ 'projectId' ] } ) . then ( res => {
66
- this . suites = res ;
67
- } ) ;
68
- await this . testrunService . getTestsRunStats ( { project_id : this . route . snapshot . params [ 'projectId' ] } ) . then ( res => {
69
- this . testRunStats = res ;
70
- this . testrunService . getTestRun ( { project_id : this . route . snapshot . params [ 'projectId' ] } ) . then ( result => {
71
- this . testRuns = result ;
72
- this . testRuns . forEach ( run => {
73
- if ( run . finish_time && run . start_time ) {
74
- run [ 'duration' ] = new Date ( run . finish_time ) . getTime ( ) - new Date ( run . start_time ) . getTime ( ) ;
75
- run [ 'totalTests' ] = ( this . testRunStats . find ( stat => stat . id === run . id ) || { 'total' : 0 } ) . total ;
76
- run [ 'not_assigned' ] = ( this . testRunStats . find ( stat => stat . id === run . id ) || { 'not_assigned' : 0 } ) . not_assigned ;
77
- }
78
- } ) ;
79
- this . tbCols = [
80
- {
81
- name : 'Label' ,
82
- property : 'label.name' ,
83
- filter : true ,
84
- sorting : true ,
85
- type : 'lookup-colored' ,
86
- entity : 'label' ,
87
- values : this . labels ,
88
- editable : true ,
89
- class : 'fit'
90
- } ,
91
- { name : 'Start Time' , property : 'start_time' , filter : true , sorting : true , type : 'date' , class : 'fit' } ,
92
- { name : 'Build' , property : 'build_name' , filter : true , sorting : true , type : 'text' , editable : false , class : 'ft-width-350' } ,
93
- {
94
- name : 'Test Suite' ,
95
- property : 'test_suite.name' ,
96
- filter : true ,
97
- sorting : true ,
98
- type : 'lookup-autocomplete' ,
99
- values : this . suites ,
100
- propToShow : [ 'name' ] ,
101
- entity : 'test_suite' ,
102
- allowEmpty : false ,
103
- editable : false ,
104
- class : 'fit'
105
- } ,
106
- {
107
- name : 'Milestone' ,
108
- property : 'milestone.name' ,
109
- filter : true ,
110
- sorting : true ,
111
- type : 'lookup-autocomplete' ,
112
- values : this . milestones ,
113
- propToShow : [ 'name' ] ,
114
- entity : 'milestone' ,
115
- allowEmpty : true ,
116
- editable : false ,
117
- class : 'fit'
118
- } ,
119
- {
120
- name : 'Execution Environment' ,
121
- property : 'execution_environment' ,
122
- filter : true ,
123
- sorting : true ,
124
- type : 'text' ,
125
- editable : false ,
126
- class : 'fit'
127
- } ,
128
- { name : 'Total Tests Executed' , property : 'totalTests' , filter : false , sorting : true , type : 'text' , class : 'fit' } ,
129
- {
130
- name : 'No Resolution' ,
131
- property : 'not_assigned' ,
132
- filter : true ,
133
- sorting : true ,
134
- type : 'percent' ,
135
- editable : false ,
136
- link : {
137
- template : `/project/${ this . route . snapshot . params [ 'projectId' ] } /testrun/{id}` ,
138
- properties : [ 'id' ] , params : { f_test_resolution_opt : 1 }
139
- }
140
- } ,
141
- { name : 'Duration' , property : 'duration' , filter : true , sorting : true , type : 'time' , class : 'ft-width-120' }
142
- ] ;
143
- this . hiddenCols = [
144
- { name : 'Finish Time' , property : 'finish_time' , filter : true , sorting : true , type : 'date' } ,
145
- { name : 'Debug' , property : 'debug' , filter : false , sorting : true , type : 'checkbox' , editable : false }
146
- ] ;
147
- } ) ;
59
+ this . milestones = await this . milestoneService . getMilestone ( { project_id : this . route . snapshot . params [ 'projectId' ] } ) ;
60
+ this . labels = await this . testrunService . getTestsRunLabels ( 0 ) . toPromise ( ) ;
61
+ this . suites = await this . testSuiteService . getTestSuite ( { project_id : this . route . snapshot . params [ 'projectId' ] } ) ;
62
+ this . testRunStats = await this . testrunService . getTestsRunStats ( { project_id : this . route . snapshot . params [ 'projectId' ] } ) ;
63
+ this . testRuns = await this . testrunService . getTestRun ( { project_id : this . route . snapshot . params [ 'projectId' ] } ) ;
64
+ this . testRuns . forEach ( run => {
65
+ if ( run . finish_time && run . start_time ) {
66
+ run [ 'duration' ] = new Date ( run . finish_time ) . getTime ( ) - new Date ( run . start_time ) . getTime ( ) ;
67
+ run [ 'totalTests' ] = ( this . testRunStats . find ( stat => stat . id === run . id ) || { 'total' : 0 } ) . total ;
68
+ run [ 'not_assigned' ] = ( this . testRunStats . find ( stat => stat . id === run . id ) || { 'not_assigned' : 0 } ) . not_assigned ;
69
+ run [ 'passrate' ] = this . testrunService . getPassRate ( this . testRunStats . find ( stat => stat . id === run . id ) || new TestRunStat ( ) ) ;
70
+ }
148
71
} ) ;
72
+ this . tbCols = [
73
+ {
74
+ name : 'Label' ,
75
+ property : 'label.name' ,
76
+ filter : true ,
77
+ sorting : true ,
78
+ type : 'lookup-colored' ,
79
+ entity : 'label' ,
80
+ values : this . labels ,
81
+ editable : true ,
82
+ class : 'fit'
83
+ } ,
84
+ { name : 'Start Time' , property : 'start_time' , filter : true , sorting : true , type : 'date' , class : 'fit' } ,
85
+ { name : 'Build' , property : 'build_name' , filter : true , sorting : true , type : 'text' , editable : false , class : 'ft-width-350' } ,
86
+ {
87
+ name : 'Test Suite' ,
88
+ property : 'test_suite.name' ,
89
+ filter : true ,
90
+ sorting : true ,
91
+ type : 'lookup-autocomplete' ,
92
+ values : this . suites ,
93
+ propToShow : [ 'name' ] ,
94
+ entity : 'test_suite' ,
95
+ allowEmpty : false ,
96
+ editable : false ,
97
+ class : 'fit'
98
+ } ,
99
+ {
100
+ name : 'Milestone' ,
101
+ property : 'milestone.name' ,
102
+ filter : true ,
103
+ sorting : true ,
104
+ type : 'lookup-autocomplete' ,
105
+ values : this . milestones ,
106
+ propToShow : [ 'name' ] ,
107
+ entity : 'milestone' ,
108
+ allowEmpty : true ,
109
+ editable : false ,
110
+ class : 'fit'
111
+ } ,
112
+ {
113
+ name : 'Execution Environment' ,
114
+ property : 'execution_environment' ,
115
+ filter : true ,
116
+ sorting : true ,
117
+ type : 'text' ,
118
+ editable : false ,
119
+ class : 'fit'
120
+ } , {
121
+ name : 'Executor' ,
122
+ property : 'author' ,
123
+ filter : true ,
124
+ sorting : true ,
125
+ type : 'text' ,
126
+ editable : false ,
127
+ class : 'fit'
128
+ } ,
129
+ { name : 'Total' , property : 'totalTests' , filter : false , sorting : true , type : 'text' , class : 'fit' } ,
130
+ {
131
+ name : 'No Resolution' ,
132
+ property : 'not_assigned' ,
133
+ filter : true ,
134
+ sorting : true ,
135
+ type : 'percent' ,
136
+ editable : false ,
137
+ link : {
138
+ template : `/project/${ this . route . snapshot . params [ 'projectId' ] } /testrun/{id}` ,
139
+ properties : [ 'id' ] , params : { f_test_resolution_opt : 1 }
140
+ } ,
141
+ class : 'ft-width-250'
142
+ } ,
143
+ { name : 'Pass Rate, %' , property : 'passrate' , filter : false , sorting : true , type : 'text' , class : 'fit' } ,
144
+ { name : 'Duration' , property : 'duration' , filter : true , sorting : true , type : 'time' , class : 'fit' }
145
+ ] ;
146
+ this . hiddenCols = [
147
+ { name : 'Finish Time' , property : 'finish_time' , filter : true , sorting : true , type : 'date' } ,
148
+ { name : 'Debug' , property : 'debug' , filter : false , sorting : true , type : 'checkbox' , editable : false }
149
+ ] ;
149
150
}
150
151
151
152
handleAction ( $event ) {
0 commit comments