зеркало из https://github.com/mozilla/treeherder.git
Bug 1733943 - Expose Sherlock backfill tasks by status (#7343)
* Bug 1733943 - Expose Sherlock backfill tasks by status * Bug 1733943 - Address change requests * Bug 1733943 - Changed migration file: renamed total_backfills_triggered field * Bug 1733943 - BE tests and UI change - status italic * Bug 1733943 - UI tests
This commit is contained in:
Родитель
095719b51f
Коммит
56a5322f9d
|
@ -116,6 +116,18 @@ def jobs_with_one_pending(successful_jobs):
|
|||
job_pending.save()
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def jobs_with_one_pending_and_one_failed(successful_jobs):
|
||||
index_in_range = get_middle_index(successful_jobs)
|
||||
next_index_in_range = get_middle_index(successful_jobs) + 1
|
||||
job_pending = successful_jobs[index_in_range]
|
||||
job_pending.result = 'unknown'
|
||||
job_pending.save()
|
||||
job_to_fail = successful_jobs[next_index_in_range]
|
||||
job_to_fail.result = 'testfailed'
|
||||
job_to_fail.save()
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def get_outcome_checker_mock():
|
||||
def get_outcome_checker_mock(outcome: OutcomeStatus):
|
||||
|
@ -238,6 +250,11 @@ class TestOutcomeChecker:
|
|||
outcome_checker = OutcomeChecker()
|
||||
|
||||
response = outcome_checker.check(record_backfilled)
|
||||
# all jobs were successful
|
||||
assert record_backfilled.get_pushes_in_context_range().count() == 6
|
||||
assert record_backfilled.total_backfills_successful == 6
|
||||
assert record_backfilled.total_backfills_in_progress == 0
|
||||
assert record_backfilled.total_backfills_failed == 0
|
||||
assert response == OutcomeStatus.SUCCESSFUL
|
||||
|
||||
def test_failed_job_means_failed_outcome(
|
||||
|
@ -247,6 +264,11 @@ class TestOutcomeChecker:
|
|||
outcome_checker = OutcomeChecker()
|
||||
|
||||
response = outcome_checker.check(record_backfilled)
|
||||
# one job failed and the rest were successful
|
||||
assert record_backfilled.get_pushes_in_context_range().count() == 6
|
||||
assert record_backfilled.total_backfills_successful == 5
|
||||
assert record_backfilled.total_backfills_in_progress == 0
|
||||
assert record_backfilled.total_backfills_failed == 1
|
||||
assert response == OutcomeStatus.FAILED
|
||||
|
||||
def test_pending_job_means_in_progress_outcome(
|
||||
|
@ -256,4 +278,23 @@ class TestOutcomeChecker:
|
|||
outcome_checker = OutcomeChecker()
|
||||
|
||||
response = outcome_checker.check(record_backfilled)
|
||||
# one job is in progress and the rest were successful
|
||||
assert record_backfilled.get_pushes_in_context_range().count() == 6
|
||||
assert record_backfilled.total_backfills_successful == 5
|
||||
assert record_backfilled.total_backfills_in_progress == 1
|
||||
assert record_backfilled.total_backfills_failed == 0
|
||||
assert response == OutcomeStatus.IN_PROGRESS
|
||||
|
||||
def test_pending_and_failed_jobs_means_in_progress_outcome(
|
||||
self, record_backfilled, outcome_checking_pushes, jobs_with_one_pending_and_one_failed
|
||||
):
|
||||
set_record_job_type(record_backfilled)
|
||||
outcome_checker = OutcomeChecker()
|
||||
|
||||
response = outcome_checker.check(record_backfilled)
|
||||
# one job is in progress, one failed and the rest were successful
|
||||
assert record_backfilled.get_pushes_in_context_range().count() == 6
|
||||
assert record_backfilled.total_backfills_successful == 4
|
||||
assert record_backfilled.total_backfills_in_progress == 1
|
||||
assert record_backfilled.total_backfills_failed == 1
|
||||
assert response == OutcomeStatus.IN_PROGRESS
|
||||
|
|
|
@ -105,7 +105,7 @@
|
|||
"backfill_record": {
|
||||
"context": "[]",
|
||||
"status": 0,
|
||||
"total_backfills_triggered": 0
|
||||
"total_actions_triggered": 0
|
||||
},
|
||||
"series_signature": {
|
||||
"id": 1945378,
|
||||
|
@ -162,7 +162,7 @@
|
|||
"backfill_record": {
|
||||
"context": "[]",
|
||||
"status": 3,
|
||||
"total_backfills_triggered": 4
|
||||
"total_actions_triggered": 4
|
||||
},
|
||||
"series_signature": {
|
||||
"id": 1948230,
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
"backfill_record": {
|
||||
"context": "[{\"perf_datum_id\": 1437239345, \"value\": 703.62, \"job_id\": 356253496, \"push_id\": 980182, \"push_timestamp\": \"2021-10-27T19:02:20\", \"push__revision\": \"c24a073833415c904a810f0bc14de21ed8f04def\"}, {\"perf_datum_id\": 1438848232, \"value\": 752.3, \"job_id\": 356594861, \"push_id\": 980227, \"push_timestamp\": \"2021-10-27T20:48:35\", \"push__revision\": \"197af0b52aec261be5f484b48c46c26c8f208ae2\"}, {\"perf_datum_id\": 1438845794, \"value\": 637.2, \"job_id\": 356594352, \"push_id\": 980228, \"push_timestamp\": \"2021-10-27T20:49:39\", \"push__revision\": \"ff38beee092bcdfcc289f4737668c9b5d4ff3d42\"}, {\"perf_datum_id\": 1438591078, \"value\": 700.56, \"job_id\": 356552835, \"push_id\": 980244, \"push_timestamp\": \"2021-10-27T21:17:00\", \"push__revision\": \"dd99452b671854d9f1f3079a051fc4822161a993\"}, {\"perf_datum_id\": 1438585688, \"value\": 635.5699999999999, \"job_id\": 356550571, \"push_id\": 980255, \"push_timestamp\": \"2021-10-27T21:43:08\", \"push__revision\": \"cb160c184b4ac2b4701688e825514f8a3add6a7e\"}]",
|
||||
"status": 0,
|
||||
"total_backfills_triggered": 0
|
||||
"total_actions_triggered": 0
|
||||
},
|
||||
"noise_profile": "N/A"
|
||||
}
|
||||
|
@ -102,7 +102,7 @@
|
|||
"backfill_record": {
|
||||
"context": "[{\"perf_datum_id\": 1438588964, \"value\": 858.7900000000001, \"job_id\": 356551789, \"push_id\": 980300, \"push_timestamp\": \"2021-10-27T22:38:38\", \"push__revision\": \"3d8df6da990da00dae776904d851c50c80aeb16e\"}, {\"perf_datum_id\": 1438591284, \"value\": 900.6400000000001, \"job_id\": 356552898, \"push_id\": 980306, \"push_timestamp\": \"2021-10-27T22:47:19\", \"push__revision\": \"909433910d0d03229dd23cc430d08d6326b44a95\"}, {\"perf_datum_id\": 1437405462, \"value\": 957.5899999999999, \"job_id\": 356285912, \"push_id\": 980323, \"push_timestamp\": \"2021-10-27T23:16:04\", \"push__revision\": \"3d8181bdd6c2b372d65125e9e68b7771d70fce8a\"}, {\"perf_datum_id\": 1437433742, \"value\": 932.48, \"job_id\": 356290338, \"push_id\": 980349, \"push_timestamp\": \"2021-10-28T00:09:34\", \"push__revision\": \"617a98c2fc8fb577df2c6c04e3c08f78dfc65c07\"}, {\"perf_datum_id\": 1438589209, \"value\": 877.1500000000001, \"job_id\": 356552355, \"push_id\": 980360, \"push_timestamp\": \"2021-10-28T00:39:38\", \"push__revision\": \"184d074f07d7d64f5aad4ccb7b683b2e937d3548\"}]",
|
||||
"status": 0,
|
||||
"total_backfills_triggered": 0
|
||||
"total_actions_triggered": 0
|
||||
},
|
||||
"noise_profile": "OK"
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
"backfill_record": {
|
||||
"context": "[{\"perf_datum_id\": 1388659888, \"value\": 1977.0, \"job_id\": 345931786, \"push_id\": 936431, \"push_timestamp\": \"2021-07-21T15:04:11\", \"push__revision\": \"759bc741488b9391c07da95988593e6d3fb49490\"}, {\"perf_datum_id\": 1388792473, \"value\": 1946.0, \"job_id\": 345954456, \"push_id\": 936591, \"push_timestamp\": \"2021-07-21T18:49:06\", \"push__revision\": \"6463b3bc31961ea9aca66b4f30dba214e76db30c\"}, {\"perf_datum_id\": 1388844193, \"value\": 1981.0, \"job_id\": 345961832, \"push_id\": 936677, \"push_timestamp\": \"2021-07-21T21:07:30\", \"push__revision\": \"deb455d7a744a7d2bb0fdee634b848640ba18c39\"}, {\"perf_datum_id\": 1388937186, \"value\": 2000.0, \"job_id\": 345970577, \"push_id\": 936792, \"push_timestamp\": \"2021-07-21T23:57:37\", \"push__revision\": \"1979267c2a7f69a743d039060eb9d0acf1633736\"}, {\"perf_datum_id\": 1389076980, \"value\": 1999.0, \"job_id\": 345985005, \"push_id\": 936891, \"push_timestamp\": \"2021-07-22T05:09:58\", \"push__revision\": \"e1209f07767f3860fdc965329651313fc8d7b912\"}]",
|
||||
"status": 1,
|
||||
"total_backfills_triggered": 0
|
||||
"total_actions_triggered": 0
|
||||
},
|
||||
"title": "imdb ContentfulSpeedIndex android-hw-g5-7-0-arm7-shippable-qr opt warm webrender"
|
||||
},
|
||||
|
@ -80,7 +80,7 @@
|
|||
"backfill_record": {
|
||||
"context": "[{\"perf_datum_id\": 1388361084, \"value\": 715.0, \"job_id\": 345872659, \"push_id\": 936302, \"push_timestamp\": \"2021-07-21T09:40:37\", \"push__revision\": \"5412920e7030d6bcdc096ca2b059f4496d2bcccf\"}, {\"perf_datum_id\": 1388620032, \"value\": 693.5, \"job_id\": 345911735, \"push_id\": 936428, \"push_timestamp\": \"2021-07-21T15:02:50\", \"push__revision\": \"3de943e6b35d15550f66b30a2b93f1ca192e72d9\"}, {\"perf_datum_id\": 1388588502, \"value\": 676.0, \"job_id\": 345911289, \"push_id\": 936431, \"push_timestamp\": \"2021-07-21T15:04:11\", \"push__revision\": \"759bc741488b9391c07da95988593e6d3fb49490\"}, {\"perf_datum_id\": 1388676634, \"value\": 693.0, \"job_id\": 345932607, \"push_id\": 936591, \"push_timestamp\": \"2021-07-21T18:49:06\", \"push__revision\": \"6463b3bc31961ea9aca66b4f30dba214e76db30c\"}, {\"perf_datum_id\": 1388809541, \"value\": 676.5, \"job_id\": 345954639, \"push_id\": 936677, \"push_timestamp\": \"2021-07-21T21:07:30\", \"push__revision\": \"deb455d7a744a7d2bb0fdee634b848640ba18c39\"}]",
|
||||
"status": 2,
|
||||
"total_backfills_triggered": 4
|
||||
"total_actions_triggered": 4
|
||||
},
|
||||
"title": "espn fnbpaint android-hw-p2-8-0-android-aarch64-shippable-qr opt warm webrender"
|
||||
},
|
||||
|
@ -154,7 +154,7 @@
|
|||
"backfill_record": {
|
||||
"context": "[{\"perf_datum_id\": 1389873571, \"value\": 3425.0, \"job_id\": 346143058, \"push_id\": 936120, \"push_timestamp\": \"2021-07-20T22:06:58\", \"push__revision\": \"66daae79dd5e5292a6cd2bbb7035682039a82084\"}, {\"perf_datum_id\": 1389824460, \"value\": 3524.0, \"job_id\": 346136357, \"push_id\": 936129, \"push_timestamp\": \"2021-07-20T22:25:48\", \"push__revision\": \"2f8bbf2478c7bf6e6f9d586cfa89e30a332a735b\"}, {\"perf_datum_id\": 1389885112, \"value\": 3543.0, \"job_id\": 346145880, \"push_id\": 936133, \"push_timestamp\": \"2021-07-20T22:27:05\", \"push__revision\": \"733ddb26d3b24c5b4e083233e7ec1569206c18f1\"}, {\"perf_datum_id\": 1389884465, \"value\": 3533.0, \"job_id\": 346145810, \"push_id\": 936139, \"push_timestamp\": \"2021-07-20T22:32:35\", \"push__revision\": \"fb9919b26f3078d78d4a8bcfb8f8e262f8439ba4\"}, {\"perf_datum_id\": 1390014330, \"value\": 3528.0, \"job_id\": 346172464, \"push_id\": 936149, \"push_timestamp\": \"2021-07-20T23:09:36\", \"push__revision\": \"0857e0620a84bf5a42f899d31a91a2be14c29940\"}]",
|
||||
"status": 1,
|
||||
"total_backfills_triggered": 0
|
||||
"total_actions_triggered": 0
|
||||
},
|
||||
"title": "booking LastVisualChange android-hw-g5-7-0-arm7-shippable-qr opt warm webrender"
|
||||
},
|
||||
|
@ -298,7 +298,7 @@
|
|||
"backfill_record": {
|
||||
"context": "[{\"perf_datum_id\": 1387890830, \"value\": 4122.0, \"job_id\": 345766651, \"push_id\": 935791, \"push_timestamp\": \"2021-07-20T13:52:14\", \"push__revision\": \"02e7901e8253d1779ac0fd9359130d8ceb14eaf0\"}, {\"perf_datum_id\": 1388147540, \"value\": 4193.0, \"job_id\": 345833567, \"push_id\": 936055, \"push_timestamp\": \"2021-07-20T20:47:42\", \"push__revision\": \"0fb1ccb2974191c256a9baaa9beb710d3147bc64\"}, {\"perf_datum_id\": 1389825111, \"value\": 4368.0, \"job_id\": 346136420, \"push_id\": 936129, \"push_timestamp\": \"2021-07-20T22:25:48\", \"push__revision\": \"2f8bbf2478c7bf6e6f9d586cfa89e30a332a735b\"}, {\"perf_datum_id\": 1388189307, \"value\": 4354.0, \"job_id\": 345846284, \"push_id\": 936184, \"push_timestamp\": \"2021-07-21T01:45:05\", \"push__revision\": \"b0febb3c6ba1f3bb9837d11f8b529839f8083068\"}, {\"perf_datum_id\": 1388270661, \"value\": 4243.0, \"job_id\": 345857443, \"push_id\": 936217, \"push_timestamp\": \"2021-07-21T04:48:43\", \"push__revision\": \"d716918916ac1a4993a616f07d501f9b64be467d\"}]",
|
||||
"status": 1,
|
||||
"total_backfills_triggered": 0
|
||||
"total_actions_triggered": 0
|
||||
},
|
||||
"title": "allrecipes PerceptualSpeedIndex android-hw-g5-7-0-arm7-shippable-qr opt cold webrender"
|
||||
},
|
||||
|
@ -617,7 +617,7 @@
|
|||
"backfill_record": {
|
||||
"context": "[{\"perf_datum_id\": 1387889627, \"value\": 825.0, \"job_id\": 345763276, \"push_id\": 935791, \"push_timestamp\": \"2021-07-20T13:52:14\", \"push__revision\": \"02e7901e8253d1779ac0fd9359130d8ceb14eaf0\"}, {\"perf_datum_id\": 1388121627, \"value\": 837.5, \"job_id\": 345823232, \"push_id\": 936055, \"push_timestamp\": \"2021-07-20T20:47:42\", \"push__revision\": \"0fb1ccb2974191c256a9baaa9beb710d3147bc64\"}, {\"perf_datum_id\": 1388187718, \"value\": 897.0, \"job_id\": 345843882, \"push_id\": 936184, \"push_timestamp\": \"2021-07-21T01:45:05\", \"push__revision\": \"b0febb3c6ba1f3bb9837d11f8b529839f8083068\"}, {\"perf_datum_id\": 1388266920, \"value\": 897.5, \"job_id\": 345854980, \"push_id\": 936217, \"push_timestamp\": \"2021-07-21T04:48:43\", \"push__revision\": \"d716918916ac1a4993a616f07d501f9b64be467d\"}, {\"perf_datum_id\": 1388633676, \"value\": 903.0, \"job_id\": 345878029, \"push_id\": 936302, \"push_timestamp\": \"2021-07-21T09:40:37\", \"push__revision\": \"5412920e7030d6bcdc096ca2b059f4496d2bcccf\"}]",
|
||||
"status": 4,
|
||||
"total_backfills_triggered": 4
|
||||
"total_actions_triggered": 4
|
||||
},
|
||||
"title": "youtube dcf android-hw-g5-7-0-arm7-shippable-qr opt warm webrender"
|
||||
},
|
||||
|
@ -1146,7 +1146,7 @@
|
|||
"backfill_record": {
|
||||
"context": "[{\"perf_datum_id\": 1388702184, \"value\": 6908.5, \"job_id\": 345911060, \"push_id\": 936428, \"push_timestamp\": \"2021-07-21T15:02:50\", \"push__revision\": \"3de943e6b35d15550f66b30a2b93f1ca192e72d9\"}, {\"perf_datum_id\": 1388654794, \"value\": 7004.0, \"job_id\": 345910544, \"push_id\": 936431, \"push_timestamp\": \"2021-07-21T15:04:11\", \"push__revision\": \"759bc741488b9391c07da95988593e6d3fb49490\"}, {\"perf_datum_id\": 1388787018, \"value\": 7117.5, \"job_id\": 345934751, \"push_id\": 936591, \"push_timestamp\": \"2021-07-21T18:49:06\", \"push__revision\": \"6463b3bc31961ea9aca66b4f30dba214e76db30c\"}, {\"perf_datum_id\": 1388836148, \"value\": 7090.0, \"job_id\": 345956185, \"push_id\": 936677, \"push_timestamp\": \"2021-07-21T21:07:30\", \"push__revision\": \"deb455d7a744a7d2bb0fdee634b848640ba18c39\"}, {\"perf_datum_id\": 1388934087, \"value\": 7222.5, \"job_id\": 345969812, \"push_id\": 936792, \"push_timestamp\": \"2021-07-21T23:57:37\", \"push__revision\": \"1979267c2a7f69a743d039060eb9d0acf1633736\"}]",
|
||||
"status": 0,
|
||||
"total_backfills_triggered": 0
|
||||
"total_actions_triggered": 0
|
||||
},
|
||||
"title": "imdb loadtime android-hw-g5-7-0-arm7-shippable-qr opt cold webrender"
|
||||
},
|
||||
|
@ -1220,7 +1220,7 @@
|
|||
"backfill_record": {
|
||||
"context": "[{\"perf_datum_id\": 1388787019, \"value\": 1093.0, \"job_id\": 345934751, \"push_id\": 936591, \"push_timestamp\": \"2021-07-21T18:49:06\", \"push__revision\": \"6463b3bc31961ea9aca66b4f30dba214e76db30c\"}, {\"perf_datum_id\": 1388836149, \"value\": 1082.5, \"job_id\": 345956185, \"push_id\": 936677, \"push_timestamp\": \"2021-07-21T21:07:30\", \"push__revision\": \"deb455d7a744a7d2bb0fdee634b848640ba18c39\"}, {\"perf_datum_id\": 1388934088, \"value\": 1109.0, \"job_id\": 345969812, \"push_id\": 936792, \"push_timestamp\": \"2021-07-21T23:57:37\", \"push__revision\": \"1979267c2a7f69a743d039060eb9d0acf1633736\"}, {\"perf_datum_id\": 1389075943, \"value\": 1091.0, \"job_id\": 345984625, \"push_id\": 936891, \"push_timestamp\": \"2021-07-22T05:09:58\", \"push__revision\": \"e1209f07767f3860fdc965329651313fc8d7b912\"}, {\"perf_datum_id\": 1389150062, \"value\": 1106.5, \"job_id\": 345992316, \"push_id\": 936923, \"push_timestamp\": \"2021-07-22T08:07:45\", \"push__revision\": \"b7a98f400dc5540ba5291a096eed0d1127df8ced\"}]",
|
||||
"status": 1,
|
||||
"total_backfills_triggered": 0
|
||||
"total_actions_triggered": 0
|
||||
},
|
||||
"title": "imdb dcf android-hw-g5-7-0-arm7-shippable-qr opt warm webrender"
|
||||
},
|
||||
|
@ -1329,7 +1329,7 @@
|
|||
"backfill_record": {
|
||||
"context": "[{\"perf_datum_id\": 1390653405, \"value\": 9190.0, \"job_id\": 346319831, \"push_id\": 936084, \"push_timestamp\": \"2021-07-20T21:27:35\", \"push__revision\": \"5a673b05aea0ec12c286fe535c254059bdb4adfd\"}, {\"perf_datum_id\": 1390654887, \"value\": 9158.0, \"job_id\": 346319918, \"push_id\": 936089, \"push_timestamp\": \"2021-07-20T21:38:43\", \"push__revision\": \"29ba31ce922e2d97aacd14ff8fb1da22536e859a\"}, {\"perf_datum_id\": 1388190037, \"value\": 9364.0, \"job_id\": 345846304, \"push_id\": 936184, \"push_timestamp\": \"2021-07-21T01:45:05\", \"push__revision\": \"b0febb3c6ba1f3bb9837d11f8b529839f8083068\"}, {\"perf_datum_id\": 1388269798, \"value\": 9359.0, \"job_id\": 345857108, \"push_id\": 936217, \"push_timestamp\": \"2021-07-21T04:48:43\", \"push__revision\": \"d716918916ac1a4993a616f07d501f9b64be467d\"}, {\"perf_datum_id\": 1388635913, \"value\": 9348.0, \"job_id\": 345925396, \"push_id\": 936302, \"push_timestamp\": \"2021-07-21T09:40:37\", \"push__revision\": \"5412920e7030d6bcdc096ca2b059f4496d2bcccf\"}]",
|
||||
"status": 1,
|
||||
"total_backfills_triggered": 0
|
||||
"total_actions_triggered": 0
|
||||
},
|
||||
"title": "imdb LastVisualChange android-hw-g5-7-0-arm7-shippable-qr opt warm webrender"
|
||||
},
|
||||
|
@ -1368,7 +1368,7 @@
|
|||
"backfill_record": {
|
||||
"context": "[{\"perf_datum_id\": 1390696248, \"value\": 10071.0, \"job_id\": 346326803, \"push_id\": 936090, \"push_timestamp\": \"2021-07-20T21:39:16\", \"push__revision\": \"ef54abc95cb5b2ef2f7f9398fdc3a7ec73096592\"}, {\"perf_datum_id\": 1390719851, \"value\": 10246.0, \"job_id\": 346331288, \"push_id\": 936117, \"push_timestamp\": \"2021-07-20T22:00:22\", \"push__revision\": \"7b7a049fb3e3979546f707a50e12dc9aacf59f78\"}, {\"perf_datum_id\": 1390742686, \"value\": 10262.0, \"job_id\": 346334555, \"push_id\": 936129, \"push_timestamp\": \"2021-07-20T22:25:48\", \"push__revision\": \"2f8bbf2478c7bf6e6f9d586cfa89e30a332a735b\"}, {\"perf_datum_id\": 1390741662, \"value\": 10389.0, \"job_id\": 346334371, \"push_id\": 936133, \"push_timestamp\": \"2021-07-20T22:27:05\", \"push__revision\": \"733ddb26d3b24c5b4e083233e7ec1569206c18f1\"}, {\"perf_datum_id\": 1388190031, \"value\": 10190.0, \"job_id\": 345846304, \"push_id\": 936184, \"push_timestamp\": \"2021-07-21T01:45:05\", \"push__revision\": \"b0febb3c6ba1f3bb9837d11f8b529839f8083068\"}]",
|
||||
"status": 1,
|
||||
"total_backfills_triggered": 0
|
||||
"total_actions_triggered": 0
|
||||
},
|
||||
"title": "imdb LastVisualChange android-hw-g5-7-0-arm7-shippable-qr opt cold webrender"
|
||||
},
|
||||
|
@ -2142,7 +2142,7 @@
|
|||
"backfill_record": {
|
||||
"context": "[{\"perf_datum_id\": 1390682796, \"value\": 698.5, \"job_id\": 346320909, \"push_id\": 936117, \"push_timestamp\": \"2021-07-20T22:00:22\", \"push__revision\": \"7b7a049fb3e3979546f707a50e12dc9aacf59f78\"}, {\"perf_datum_id\": 1390677509, \"value\": 717.5, \"job_id\": 346320747, \"push_id\": 936120, \"push_timestamp\": \"2021-07-20T22:06:58\", \"push__revision\": \"66daae79dd5e5292a6cd2bbb7035682039a82084\"}, {\"perf_datum_id\": 1390640889, \"value\": 682.5, \"job_id\": 346316211, \"push_id\": 936129, \"push_timestamp\": \"2021-07-20T22:25:48\", \"push__revision\": \"2f8bbf2478c7bf6e6f9d586cfa89e30a332a735b\"}, {\"perf_datum_id\": 1388188722, \"value\": 690.0, \"job_id\": 345843423, \"push_id\": 936184, \"push_timestamp\": \"2021-07-21T01:45:05\", \"push__revision\": \"b0febb3c6ba1f3bb9837d11f8b529839f8083068\"}, {\"perf_datum_id\": 1388263939, \"value\": 680.0, \"job_id\": 345854544, \"push_id\": 936217, \"push_timestamp\": \"2021-07-21T04:48:43\", \"push__revision\": \"d716918916ac1a4993a616f07d501f9b64be467d\"}]",
|
||||
"status": 1,
|
||||
"total_backfills_triggered": 0
|
||||
"total_actions_triggered": 0
|
||||
},
|
||||
"title": "espn fcp android-hw-p2-8-0-android-aarch64-shippable-qr opt warm webrender"
|
||||
},
|
||||
|
@ -2251,7 +2251,7 @@
|
|||
"backfill_record": {
|
||||
"context": "[{\"perf_datum_id\": 1387889302, \"value\": 2304.0, \"job_id\": 345763268, \"push_id\": 935791, \"push_timestamp\": \"2021-07-20T13:52:14\", \"push__revision\": \"02e7901e8253d1779ac0fd9359130d8ceb14eaf0\"}, {\"perf_datum_id\": 1388146500, \"value\": 2376.0, \"job_id\": 345823237, \"push_id\": 936055, \"push_timestamp\": \"2021-07-20T20:47:42\", \"push__revision\": \"0fb1ccb2974191c256a9baaa9beb710d3147bc64\"}, {\"perf_datum_id\": 1388192734, \"value\": 2511.0, \"job_id\": 345843903, \"push_id\": 936184, \"push_timestamp\": \"2021-07-21T01:45:05\", \"push__revision\": \"b0febb3c6ba1f3bb9837d11f8b529839f8083068\"}, {\"perf_datum_id\": 1388268718, \"value\": 2509.5, \"job_id\": 345855017, \"push_id\": 936217, \"push_timestamp\": \"2021-07-21T04:48:43\", \"push__revision\": \"d716918916ac1a4993a616f07d501f9b64be467d\"}, {\"perf_datum_id\": 1388634217, \"value\": 2619.5, \"job_id\": 345878031, \"push_id\": 936302, \"push_timestamp\": \"2021-07-21T09:40:37\", \"push__revision\": \"5412920e7030d6bcdc096ca2b059f4496d2bcccf\"}]",
|
||||
"status": 1,
|
||||
"total_backfills_triggered": 0
|
||||
"total_actions_triggered": 0
|
||||
},
|
||||
"title": "espn fcp android-hw-g5-7-0-arm7-shippable opt cold"
|
||||
},
|
||||
|
@ -2500,7 +2500,7 @@
|
|||
"backfill_record": {
|
||||
"context": "[{\"perf_datum_id\": 1390683638, \"value\": 733.0, \"job_id\": 346322145, \"push_id\": 936117, \"push_timestamp\": \"2021-07-20T22:00:22\", \"push__revision\": \"7b7a049fb3e3979546f707a50e12dc9aacf59f78\"}, {\"perf_datum_id\": 1390678461, \"value\": 754.0, \"job_id\": 346321625, \"push_id\": 936120, \"push_timestamp\": \"2021-07-20T22:06:58\", \"push__revision\": \"66daae79dd5e5292a6cd2bbb7035682039a82084\"}, {\"perf_datum_id\": 1390646122, \"value\": 726.0, \"job_id\": 346319528, \"push_id\": 936129, \"push_timestamp\": \"2021-07-20T22:25:48\", \"push__revision\": \"2f8bbf2478c7bf6e6f9d586cfa89e30a332a735b\"}, {\"perf_datum_id\": 1388189295, \"value\": 728.0, \"job_id\": 345846309, \"push_id\": 936184, \"push_timestamp\": \"2021-07-21T01:45:05\", \"push__revision\": \"b0febb3c6ba1f3bb9837d11f8b529839f8083068\"}, {\"perf_datum_id\": 1388264207, \"value\": 706.0, \"job_id\": 345855436, \"push_id\": 936217, \"push_timestamp\": \"2021-07-21T04:48:43\", \"push__revision\": \"d716918916ac1a4993a616f07d501f9b64be467d\"}]",
|
||||
"status": 1,
|
||||
"total_backfills_triggered": 0
|
||||
"total_actions_triggered": 0
|
||||
},
|
||||
"title": "espn FirstVisualChange android-hw-p2-8-0-android-aarch64-shippable-qr opt warm webrender"
|
||||
},
|
||||
|
@ -2574,7 +2574,7 @@
|
|||
"backfill_record": {
|
||||
"context": "[{\"perf_datum_id\": 1387890044, \"value\": 2668.0, \"job_id\": 345766366, \"push_id\": 935791, \"push_timestamp\": \"2021-07-20T13:52:14\", \"push__revision\": \"02e7901e8253d1779ac0fd9359130d8ceb14eaf0\"}, {\"perf_datum_id\": 1388146622, \"value\": 2741.0, \"job_id\": 345833189, \"push_id\": 936055, \"push_timestamp\": \"2021-07-20T20:47:42\", \"push__revision\": \"0fb1ccb2974191c256a9baaa9beb710d3147bc64\"}, {\"perf_datum_id\": 1388193563, \"value\": 2906.0, \"job_id\": 345847417, \"push_id\": 936184, \"push_timestamp\": \"2021-07-21T01:45:05\", \"push__revision\": \"b0febb3c6ba1f3bb9837d11f8b529839f8083068\"}, {\"perf_datum_id\": 1388268777, \"value\": 2874.0, \"job_id\": 345856742, \"push_id\": 936217, \"push_timestamp\": \"2021-07-21T04:48:43\", \"push__revision\": \"d716918916ac1a4993a616f07d501f9b64be467d\"}, {\"perf_datum_id\": 1388635115, \"value\": 2973.0, \"job_id\": 345925661, \"push_id\": 936302, \"push_timestamp\": \"2021-07-21T09:40:37\", \"push__revision\": \"5412920e7030d6bcdc096ca2b059f4496d2bcccf\"}]",
|
||||
"status": 1,
|
||||
"total_backfills_triggered": 0
|
||||
"total_actions_triggered": 0
|
||||
},
|
||||
"title": "espn FirstVisualChange android-hw-g5-7-0-arm7-shippable opt cold"
|
||||
},
|
||||
|
|
|
@ -13,10 +13,12 @@ import { Provider, ReactReduxContext } from 'react-redux';
|
|||
|
||||
import { configureStore } from '../../../../ui/job-view/redux/configureStore';
|
||||
import {
|
||||
backfillRetriggeredTitle,
|
||||
unknownFrameworkMessage,
|
||||
endpoints,
|
||||
filterText,
|
||||
unknownFrameworkMessage,
|
||||
backfillRetriggeredTitle,
|
||||
alertBackfillResultVisual,
|
||||
alertBackfillResultStatusMap,
|
||||
notSupportedAlertFiltersMessage,
|
||||
} from '../../../../ui/perfherder/perf-helpers/constants';
|
||||
import repos from '../../mock/repositories';
|
||||
|
@ -852,6 +854,79 @@ test('test sherlock backfill status icons are displayed correctly', async () =>
|
|||
expect(alertIcon).toBeInTheDocument();
|
||||
});
|
||||
|
||||
test('test sherlock status 0 in tooltip on alerts', async () => {
|
||||
const alert = testAlertSummaries[0].alerts[3];
|
||||
alert.backfill_record.status = alertBackfillResultStatusMap.preliminary;
|
||||
expect(alert.id).toEqual(69347);
|
||||
|
||||
const { getByTestId, getByText } = alertsViewControls();
|
||||
// hovering over the Sherlock icon should display the tooltip
|
||||
const alertIcon = await waitFor(() =>
|
||||
getByTestId(`alert ${alert.id.toString()} sherlock icon`),
|
||||
);
|
||||
fireEvent.mouseOver(alertIcon);
|
||||
await waitFor(() => getByText(alertBackfillResultVisual.preliminary.message));
|
||||
});
|
||||
|
||||
test('test sherlock status 1 in tooltip on alerts', async () => {
|
||||
const alert = testAlertSummaries[0].alerts[3];
|
||||
alert.backfill_record.status =
|
||||
alertBackfillResultStatusMap.readyForProcessing;
|
||||
expect(alert.id).toEqual(69347);
|
||||
|
||||
const { getByTestId, getByText } = alertsViewControls();
|
||||
// hovering over the Sherlock icon should display the tooltip
|
||||
const alertIcon = await waitFor(() =>
|
||||
getByTestId(`alert ${alert.id.toString()} sherlock icon`),
|
||||
);
|
||||
fireEvent.mouseOver(alertIcon);
|
||||
await waitFor(() =>
|
||||
getByText(alertBackfillResultVisual.readyForProcessing.message),
|
||||
);
|
||||
});
|
||||
|
||||
test('test sherlock status 2 in tooltip on alerts', async () => {
|
||||
const alert = testAlertSummaries[0].alerts[3];
|
||||
alert.backfill_record.status = alertBackfillResultStatusMap.backfilled;
|
||||
expect(alert.id).toEqual(69347);
|
||||
|
||||
const { getByTestId, getByText } = alertsViewControls();
|
||||
// hovering over the Sherlock icon should display the tooltip
|
||||
const alertIcon = await waitFor(() =>
|
||||
getByTestId(`alert ${alert.id.toString()} sherlock icon`),
|
||||
);
|
||||
fireEvent.mouseOver(alertIcon);
|
||||
await waitFor(() => getByText(alertBackfillResultVisual.backfilled.message));
|
||||
});
|
||||
|
||||
test('test sherlock status 3 in tooltip on alerts', async () => {
|
||||
const alert = testAlertSummaries[0].alerts[3];
|
||||
alert.backfill_record.status = alertBackfillResultStatusMap.successful;
|
||||
expect(alert.id).toEqual(69347);
|
||||
|
||||
const { getByTestId, getByText } = alertsViewControls();
|
||||
// hovering over the Sherlock icon should display the tooltip
|
||||
const alertIcon = await waitFor(() =>
|
||||
getByTestId(`alert ${alert.id.toString()} sherlock icon`),
|
||||
);
|
||||
fireEvent.mouseOver(alertIcon);
|
||||
await waitFor(() => getByText(alertBackfillResultVisual.successful.message));
|
||||
});
|
||||
|
||||
test('test sherlock status 4 in tooltip on alerts', async () => {
|
||||
const alert = testAlertSummaries[0].alerts[3];
|
||||
alert.backfill_record.status = alertBackfillResultStatusMap.failed;
|
||||
expect(alert.id).toEqual(69347);
|
||||
|
||||
const { getByTestId, getByText } = alertsViewControls();
|
||||
// hovering over the Sherlock icon should display the tooltip
|
||||
const alertIcon = await waitFor(() =>
|
||||
getByTestId(`alert ${alert.id.toString()} sherlock icon`),
|
||||
);
|
||||
fireEvent.mouseOver(alertIcon);
|
||||
await waitFor(() => getByText(alertBackfillResultVisual.failed.message));
|
||||
});
|
||||
|
||||
test("Alert's ID can be copied to clipboard", async () => {
|
||||
const { queryAllByTitle } = alertsViewControls();
|
||||
Object.assign(navigator, {
|
||||
|
|
|
@ -13,7 +13,7 @@ class OutcomeStatus(Enum):
|
|||
|
||||
class OutcomeChecker:
|
||||
"""
|
||||
Checks outcome of backfills
|
||||
Checks outcome of backfills and counts total of tasks in progress, successful, failed
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
|
@ -23,8 +23,11 @@ class OutcomeChecker:
|
|||
if record.job_type is None:
|
||||
raise ValueError(f"No job_type for record {record.alert.id}.")
|
||||
of_type = record.job_type
|
||||
with_successful_results = 'success'
|
||||
with_unknown_results = 'unknown'
|
||||
with_successful_results = 'success' # state is "completed"
|
||||
with_unknown_results = 'unknown' # state is "running" or "pending"
|
||||
total_backfills_in_progress = 0
|
||||
total_backfills_failed = 0
|
||||
total_backfills_successful = 0
|
||||
|
||||
pushes_in_range = record.get_pushes_in_context_range()
|
||||
for push in pushes_in_range:
|
||||
|
@ -32,7 +35,20 @@ class OutcomeChecker:
|
|||
if push.total_jobs(of_type, with_successful_results) == 0:
|
||||
# either (at least) one job is in progress or it failed
|
||||
if push.total_jobs(of_type, with_unknown_results) > 0:
|
||||
return OutcomeStatus.IN_PROGRESS
|
||||
total_backfills_in_progress += 1
|
||||
else:
|
||||
return OutcomeStatus.FAILED
|
||||
return OutcomeStatus.SUCCESSFUL
|
||||
total_backfills_failed += 1
|
||||
else:
|
||||
total_backfills_successful += 1
|
||||
|
||||
record.total_backfills_failed = total_backfills_failed
|
||||
record.total_backfills_successful = total_backfills_successful
|
||||
record.total_backfills_in_progress = total_backfills_in_progress
|
||||
record.save()
|
||||
|
||||
if total_backfills_in_progress > 0:
|
||||
return OutcomeStatus.IN_PROGRESS
|
||||
elif total_backfills_failed > 0:
|
||||
return OutcomeStatus.FAILED
|
||||
elif total_backfills_successful > 0:
|
||||
return OutcomeStatus.SUCCESSFUL
|
||||
|
|
|
@ -163,7 +163,7 @@ class Sherlock:
|
|||
) -> Tuple[bool, str]:
|
||||
success = False
|
||||
|
||||
record.total_backfills_triggered = actually_backfilled
|
||||
record.total_actions_triggered = actually_backfilled
|
||||
|
||||
if actually_backfilled == to_backfill:
|
||||
record.status = BackfillRecord.BACKFILLED
|
||||
|
|
|
@ -118,7 +118,11 @@ class BackfillReportContent:
|
|||
alert_summary = record.alert.summary
|
||||
alert = record.alert
|
||||
job_symbol = self.__escape_markdown(record.job_symbol) or 'N/A'
|
||||
total_backfills = record.total_backfills_triggered
|
||||
total_backfills = (
|
||||
record.total_backfills_failed
|
||||
+ record.total_backfills_successful
|
||||
+ record.total_backfills_in_progress
|
||||
)
|
||||
push_range_md_link = self.__build_push_range_md_link(record)
|
||||
|
||||
# some fields require adjustments
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
# Generated by Django 3.1.13 on 2021-12-20 14:15
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('perf', '0041_backfillnotificationrecord'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RenameField(
|
||||
model_name='backfillrecord',
|
||||
old_name='total_backfills_triggered',
|
||||
new_name='total_actions_triggered',
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='backfillrecord',
|
||||
name='total_backfills_failed',
|
||||
field=models.IntegerField(default=0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='backfillrecord',
|
||||
name='total_backfills_in_progress',
|
||||
field=models.IntegerField(default=0),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='backfillrecord',
|
||||
name='total_backfills_successful',
|
||||
field=models.IntegerField(default=0),
|
||||
),
|
||||
]
|
|
@ -667,7 +667,10 @@ class BackfillRecord(models.Model):
|
|||
job_tier = models.PositiveIntegerField(null=True)
|
||||
job_platform_option = models.CharField(max_length=100, null=True)
|
||||
|
||||
total_backfills_triggered = models.IntegerField(default=0)
|
||||
total_actions_triggered = models.IntegerField(default=0)
|
||||
total_backfills_failed = models.IntegerField(default=0)
|
||||
total_backfills_successful = models.IntegerField(default=0)
|
||||
total_backfills_in_progress = models.IntegerField(default=0)
|
||||
|
||||
@property
|
||||
def id(self):
|
||||
|
|
|
@ -50,11 +50,22 @@ class WordsField(serializers.CharField):
|
|||
class BackfillRecordSerializer(serializers.Serializer):
|
||||
context = serializers.JSONField()
|
||||
status = serializers.IntegerField()
|
||||
total_backfills_triggered = serializers.IntegerField()
|
||||
total_actions_triggered = serializers.IntegerField()
|
||||
total_backfills_failed = serializers.IntegerField()
|
||||
total_backfills_successful = serializers.IntegerField()
|
||||
total_backfills_in_progress = serializers.IntegerField()
|
||||
|
||||
class Meta:
|
||||
model = BackfillRecord
|
||||
fields = ('alert', 'context', 'status', 'total_backfills_triggered')
|
||||
fields = (
|
||||
'alert',
|
||||
'context',
|
||||
'status',
|
||||
'total_actions_triggered',
|
||||
'total_backfills_failed',
|
||||
'total_backfills_successful',
|
||||
'total_backfills_in_progress',
|
||||
)
|
||||
|
||||
|
||||
class PerformanceFrameworkSerializer(serializers.ModelSerializer):
|
||||
|
|
|
@ -152,8 +152,6 @@ export default class AlertTableRow extends React.Component {
|
|||
};
|
||||
|
||||
renderAlertStatus = (alert, alertStatus, statusColor) => {
|
||||
const backfillStatusInfo = this.getBackfillStatusInfo(alert);
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
(
|
||||
|
@ -161,19 +159,7 @@ export default class AlertTableRow extends React.Component {
|
|||
<FontAwesomeIcon icon={faCheck} color="#28a745" />
|
||||
)}
|
||||
<span className={statusColor}>{alertStatus}</span>
|
||||
{alert.related_summary_id && this.getReassignment(alert)}
|
||||
{backfillStatusInfo ? (
|
||||
<span className="text-darker-info">
|
||||
,{' '}
|
||||
<FontAwesomeIcon
|
||||
title={backfillStatusInfo.message}
|
||||
icon={backfillStatusInfo.icon}
|
||||
color={backfillStatusInfo.color}
|
||||
data-testid={`alert ${alert.id.toString()} sherlock icon`}
|
||||
/>
|
||||
</span>
|
||||
) : null}
|
||||
)
|
||||
{alert.related_summary_id && this.getReassignment(alert)})
|
||||
</React.Fragment>
|
||||
);
|
||||
};
|
||||
|
@ -181,12 +167,34 @@ export default class AlertTableRow extends React.Component {
|
|||
getBackfillStatusInfo = (alert) => {
|
||||
if (!alert.backfill_record || alert.backfill_record.status === undefined)
|
||||
return null;
|
||||
|
||||
const statusesToDisplayTasksCount = ['backfilled', 'successful', 'failed'];
|
||||
const backfillStatus = getStatus(
|
||||
alert.backfill_record.status,
|
||||
alertBackfillResultStatusMap,
|
||||
);
|
||||
return alertBackfillResultVisual[backfillStatus];
|
||||
|
||||
const alertBackfillStatus = alertBackfillResultVisual[backfillStatus];
|
||||
// Added only for testing locally the UI changes
|
||||
// To be removed once this is in production
|
||||
alertBackfillStatus.backfillsFailed =
|
||||
alert.backfill_record.total_backfills_failed || 0;
|
||||
alertBackfillStatus.backfillsSuccessful =
|
||||
alert.backfill_record.total_backfills_successful || 0;
|
||||
alertBackfillStatus.backfillsInProgress =
|
||||
alert.backfill_record.total_backfills_in_progress || 0;
|
||||
|
||||
if (
|
||||
statusesToDisplayTasksCount.includes(backfillStatus) &&
|
||||
// the next checks are here to not confuse users
|
||||
// since we won't have count for tasks right away
|
||||
// to be removed after changes are in prod
|
||||
(alertBackfillStatus.backfillsFailed !== 0 ||
|
||||
alertBackfillStatus.backfillsInProgress !== 0 ||
|
||||
alertBackfillStatus.backfillsSuccessful !== 0)
|
||||
)
|
||||
alertBackfillStatus.displayTasksCount = true;
|
||||
|
||||
return alertBackfillStatus;
|
||||
};
|
||||
|
||||
getTitleText = (alert, alertStatus) => {
|
||||
|
@ -213,6 +221,7 @@ export default class AlertTableRow extends React.Component {
|
|||
const perfdocs = new Perfdocs(frameworkName, suite, platform, title);
|
||||
const hasDocumentation = perfdocs.hasDocumentation();
|
||||
const duplicatedName = suite === test;
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div
|
||||
|
@ -367,6 +376,23 @@ export default class AlertTableRow extends React.Component {
|
|||
? noiseProfiles[alert.noise_profile.replace('/', '')]
|
||||
: noiseProfiles.NA;
|
||||
|
||||
const backfillStatusInfo = this.getBackfillStatusInfo(alert);
|
||||
let sherlockTooltip = backfillStatusInfo && backfillStatusInfo.message;
|
||||
if (backfillStatusInfo && backfillStatusInfo.displayTasksCount) {
|
||||
sherlockTooltip = (
|
||||
<>
|
||||
<i>{backfillStatusInfo.message}</i>
|
||||
<br />
|
||||
In progress: {backfillStatusInfo.backfillsInProgress}
|
||||
<br />
|
||||
Successful: {backfillStatusInfo.backfillsSuccessful}
|
||||
<br />
|
||||
Failed: {backfillStatusInfo.backfillsFailed}
|
||||
<br />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<tr
|
||||
className={
|
||||
|
@ -429,6 +455,21 @@ export default class AlertTableRow extends React.Component {
|
|||
) : (
|
||||
this.getTitleText(alert, alertStatus)
|
||||
)}
|
||||
{backfillStatusInfo && (
|
||||
<span className="text-darker-info">
|
||||
<SimpleTooltip
|
||||
key={alert.id}
|
||||
text={
|
||||
<FontAwesomeIcon
|
||||
icon={backfillStatusInfo.icon}
|
||||
color={backfillStatusInfo.color}
|
||||
data-testid={`alert ${alert.id.toString()} sherlock icon`}
|
||||
/>
|
||||
}
|
||||
tooltipText={sherlockTooltip}
|
||||
/>
|
||||
</span>
|
||||
)}
|
||||
</td>
|
||||
<td className="table-width-lg">
|
||||
<AlertTablePlatform
|
||||
|
|
|
@ -152,14 +152,14 @@ export const alertBackfillResultVisual = {
|
|||
color: '#000000',
|
||||
},
|
||||
successful: {
|
||||
message: 'Sherlock: Backfilled Successfully',
|
||||
message: 'Sherlock: Backfilled successfully some jobs',
|
||||
icon: faHourglassEnd,
|
||||
color: '#2da745',
|
||||
color: '#000000',
|
||||
},
|
||||
failed: {
|
||||
message: 'Sherlock: Failled to backfill',
|
||||
message: 'Sherlock: Backfilling failed for some jobs',
|
||||
icon: faHourglassEnd,
|
||||
color: '#dc3545',
|
||||
color: '#000000',
|
||||
},
|
||||
};
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче