| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """Task queue endpoints for creating and updating issues on issue tracker.""" | 5 """Task queue endpoints for creating and updating issues on issue tracker.""" |
| 6 | 6 |
| 7 import datetime | 7 import datetime |
| 8 import json | 8 import json |
| 9 import logging | 9 import logging |
| 10 import urllib2 | 10 import urllib2 |
| (...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 if step_name in IGNORED_STEPS: | 516 if step_name in IGNORED_STEPS: |
| 517 continue | 517 continue |
| 518 | 518 |
| 519 # Custom (non-trivial) rules for ignoring flakes in certain steps: | 519 # Custom (non-trivial) rules for ignoring flakes in certain steps: |
| 520 # - [swarming] ...: summary step would also be red (do not double count) | 520 # - [swarming] ...: summary step would also be red (do not double count) |
| 521 # - Patch failure: ingore non-infra failures as they are typically due to | 521 # - Patch failure: ingore non-infra failures as they are typically due to |
| 522 # changes in the code on HEAD | 522 # changes in the code on HEAD |
| 523 # - bot_update PATCH FAILED: Duplicates failure in 'Patch failure' step. | 523 # - bot_update PATCH FAILED: Duplicates failure in 'Patch failure' step. |
| 524 # - ... (retry summary): this is an artificial step to fail the build due | 524 # - ... (retry summary): this is an artificial step to fail the build due |
| 525 # to another step that has failed earlier (do not double count). | 525 # to another step that has failed earlier (do not double count). |
| 526 print step_name, '1', build_result | |
| 527 if (step_name.startswith('[swarming]') or | 526 if (step_name.startswith('[swarming]') or |
| 528 step_name.endswith(' (retry summary)') or | 527 step_name.endswith(' (retry summary)') or |
| 529 (step_name == 'Patch failure' and result != build_result.EXCEPTION) or | 528 (step_name == 'Patch failure' and result != build_result.EXCEPTION) or |
| 530 (step_name == 'bot_update' and 'PATCH FAILED' in step_text)): | 529 (step_name == 'bot_update' and 'PATCH FAILED' in step_text)): |
| 531 continue | 530 continue |
| 532 print step_name, '2' | |
| 533 | 531 |
| 534 failed_steps.append(step) | 532 failed_steps.append(step) |
| 535 | 533 |
| 536 steps_to_ignore = [] | 534 steps_to_ignore = [] |
| 537 for step in failed_steps: | 535 for step in failed_steps: |
| 538 step_name = step['name'] | 536 step_name = step['name'] |
| 539 if ' (with patch)' in step_name: | 537 if ' (with patch)' in step_name: |
| 540 # Android instrumentation tests add a prefix before the step name, which | 538 # Android instrumentation tests add a prefix before the step name, which |
| 541 # doesn't appear on the summary step (without suffixes). To make sure we | 539 # doesn't appear on the summary step (without suffixes). To make sure we |
| 542 # correctly ignore duplicate failures, we remove the prefix. | 540 # correctly ignore duplicate failures, we remove the prefix. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 562 failure_run.buildnumber, step) | 560 failure_run.buildnumber, step) |
| 563 for flake in flakes: | 561 for flake in flakes: |
| 564 flake_occurrence = FlakeOccurrence(name=step_name, failure=flake) | 562 flake_occurrence = FlakeOccurrence(name=step_name, failure=flake) |
| 565 flaky_run.flakes.append(flake_occurrence) | 563 flaky_run.flakes.append(flake_occurrence) |
| 566 flakes_to_update.append(flake) | 564 flakes_to_update.append(flake) |
| 567 | 565 |
| 568 flaky_run_key = flaky_run.put() | 566 flaky_run_key = flaky_run.put() |
| 569 for flake in flakes_to_update: | 567 for flake in flakes_to_update: |
| 570 self.add_failure_to_flake(flake, flaky_run_key, failure_time) | 568 self.add_failure_to_flake(flake, flaky_run_key, failure_time) |
| 571 self.flaky_runs.increment_by(1) | 569 self.flaky_runs.increment_by(1) |
| OLD | NEW |