@@ -43,7 +43,7 @@ def callee(session):
43
43
`mute_count` Uint64,
44
44
`fail_count` Uint64,
45
45
`skip_count` Uint64,
46
- PRIMARY KEY (`test_name`, `suite_folder`, `full_name`,date_window,runs_window,build_type,branch,owners )
46
+ PRIMARY KEY (`test_name`, `suite_folder`, `full_name`,date_window,runs_window,build_type,branch)
47
47
)
48
48
PARTITION BY HASH(`full_name`,build_type,branch)
49
49
WITH (STORE = COLUMN)
@@ -134,15 +134,15 @@ def main():
134
134
except StopIteration :
135
135
break
136
136
137
- if results [0 ] and results [0 ].get ( 'max_date_window' , default_start_date ) is not None :
138
- last_date = results [0 ].get (
139
- 'max_date_window' , default_start_date ).strftime ('%Y-%m-%d' )
137
+ if results [0 ] and results [0 ].get ( 'max_date_window' , default_start_date ) is not None and results [0 ].get ( 'max_date_window' , default_start_date ) > default_start_date :
140
138
last_datetime = results [0 ].get (
141
139
'max_date_window' , default_start_date )
140
+
142
141
else :
143
- last_date = default_start_date .strftime ('%Y-%m-%d' )
144
142
last_datetime = default_start_date
145
-
143
+
144
+ last_date = last_datetime .strftime ('%Y-%m-%d' )
145
+
146
146
print (f'last hisotry date: { last_date } ' )
147
147
today = datetime .date .today ()
148
148
date_list = [today - datetime .timedelta (days = x ) for x in range ((today - last_datetime ).days + 1 )]
@@ -154,7 +154,7 @@ def main():
154
154
build_type,
155
155
branch,
156
156
history_list,
157
- dist_hist,
157
+ if(dist_hist = '','no_runs',dist_hist) as dist_hist,
158
158
suite_folder,
159
159
test_name,
160
160
owners,
@@ -167,7 +167,7 @@ def main():
167
167
build_type,
168
168
branch,
169
169
AGG_LIST(status) as history_list ,
170
- String::JoinFromList( AGG_LIST_DISTINCT(status) ,',') as dist_hist,
170
+ String::JoinFromList( ListSort( AGG_LIST_DISTINCT(status) ) ,',') as dist_hist,
171
171
suite_folder,
172
172
test_name,
173
173
owners,
@@ -187,21 +187,43 @@ def main():
187
187
) as test_and_date
188
188
left JOIN (
189
189
select * from (
190
- select
191
- suite_folder || '/' || test_name as full_name,
192
- run_timestamp,
193
- status ,
194
- ROW_NUMBER() OVER (PARTITION BY suite_folder,test_name ORDER BY run_timestamp DESC) AS run_number
195
- from `test_results/test_runs_column`
196
- where
197
- run_timestamp <= Date('{ date } ') + Interval("P1D")
198
- and run_timestamp >= Date('{ date } ') -13*Interval("P1D")
199
- and job_name in ('Postcommit_relwithdebinfo','Postcommit_asan')
200
- and build_type = '{ build_type } '
201
- and status != 'skipped'
202
- and branch = '{ branch } '
203
- )
204
- where run_number <= { history_for_n_runs }
190
+ select * from (
191
+ select * from (
192
+ select
193
+ suite_folder || '/' || test_name as full_name,
194
+ run_timestamp,
195
+ status ,
196
+ ROW_NUMBER() OVER (PARTITION BY suite_folder,test_name ORDER BY run_timestamp DESC) AS run_number
197
+ from `test_results/test_runs_column`
198
+ where
199
+ run_timestamp <= Date('{ date } ') + Interval("P1D")
200
+ and run_timestamp >= Date('{ date } ') -13*Interval("P1D")
201
+ and job_name in ('Postcommit_relwithdebinfo','Postcommit_asan')
202
+ and build_type = '{ build_type } '
203
+ and status != 'skipped'
204
+ and branch = '{ branch } '
205
+ )
206
+ where run_number <= { history_for_n_runs }
207
+ )
208
+ Union all
209
+ select * from (
210
+ select
211
+ suite_folder || '/' || test_name as full_name,
212
+ run_timestamp,
213
+ status ,
214
+ ROW_NUMBER() OVER (PARTITION BY suite_folder,test_name ORDER BY run_timestamp DESC) AS run_number
215
+ from `test_results/test_runs_column`
216
+ where
217
+ run_timestamp <= Date('{ date } ') + Interval("P1D")
218
+ and run_timestamp >= Date('{ date } ') -13*Interval("P1D")
219
+ and job_name in ('Postcommit_relwithdebinfo','Postcommit_asan')
220
+ and build_type = '{ build_type } '
221
+ and status = 'skipped'
222
+ and branch = '{ branch } '
223
+ )
224
+ where run_number <= { history_for_n_runs }
225
+ )
226
+ order by full_name,run_timestamp
205
227
) as hist
206
228
ON test_and_date.full_name=hist.full_name
207
229
)
0 commit comments