Skip to content

Commit

Permalink
[ews-build.webkit.org] Don't consult results.webkit.org for non-main PRs
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=249166

Reviewed by Aakash Jain.

* Tools/CISupport/ews-build/results_db.py:
(ResultsDatabase.get_results_summary): Catch all exceptions when making a request
to be more resiliant to failures.
* Tools/CISupport/ews-build/steps.py:
(RunWebKitTests.runCommand): Skip results.webkit.org checkout for non-main PRs.
(ReRunWebKitTests.runCommand): Ditto.

Canonical link: https://commits.webkit.org/257819@main
  • Loading branch information
JonWBedard committed Dec 14, 2022
1 parent 0def43d commit 14dcf9a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
12 changes: 6 additions & 6 deletions Tools/CISupport/ews-build/results_db.py
Expand Up @@ -96,18 +96,18 @@ def get_results_summary(cls, test, commit=None, configuration=None, logger=None)
response.deliverBody(cls.JsonPrinter(finished))
data = yield finished
defer.returnValue(json.loads(data))
else:
logger(f'Failed to query results summary with status code {response.code}\n')
defer.returnValue({})
return
logger(f'Failed to query results summary with status code {response.code}\n')
except error.ConnectError as e:
logger(f'Failed to connect to {cls.HOSTNAME}: {e}\n')
defer.returnValue({})
except ResponseFailed:
logger(f'No response from {cls.HOSTNAME}\n')
defer.returnValue({})
except json.decoder.JSONDecodeError:
logger('Non-json response from results summary query\n')
defer.returnValue({})
except Exception as e:
logger(f'Unknown exception when consulting results database:\n{e}\n')

defer.returnValue({})

@classmethod
@defer.inlineCallbacks
Expand Down
6 changes: 4 additions & 2 deletions Tools/CISupport/ews-build/steps.py
Expand Up @@ -3278,6 +3278,7 @@ def runCommand(self, command):
logTextJson = self.log_observer_json.getStdout()

first_results = LayoutTestFailures.results_from_string(logTextJson)
is_main = self.getProperty('github.base.ref', DEFAULT_BRANCH) == DEFAULT_BRANCH

if first_results:
self.setProperty('first_results_exceed_failure_limit', first_results.did_exceed_test_failure_limit)
Expand All @@ -3286,7 +3287,7 @@ def runCommand(self, command):
if first_results.failing_tests:
self._addToLog(self.test_failures_log_name, '\n'.join(first_results.failing_tests))

if first_results.failing_tests and not first_results.did_exceed_test_failure_limit:
if is_main and first_results.failing_tests and not first_results.did_exceed_test_failure_limit:
yield self.filter_failures_using_results_db(first_results.failing_tests)
self.setProperty('first_run_failures_filtered', sorted(self.failing_tests_filtered))
self.setProperty('results-db_first_run_pre_existing', sorted(self.preexisting_failures_in_results_db))
Expand Down Expand Up @@ -3504,6 +3505,7 @@ def runCommand(self, command):
logTextJson = self.log_observer_json.getStdout()

second_results = LayoutTestFailures.results_from_string(logTextJson)
is_main = self.getProperty('github.base.ref', DEFAULT_BRANCH) == DEFAULT_BRANCH

if second_results:
self.setProperty('second_results_exceed_failure_limit', second_results.did_exceed_test_failure_limit)
Expand All @@ -3512,7 +3514,7 @@ def runCommand(self, command):
if second_results.failing_tests:
self._addToLog(self.test_failures_log_name, '\n'.join(second_results.failing_tests))

if second_results.failing_tests and not second_results.did_exceed_test_failure_limit:
if is_main and second_results.failing_tests and not second_results.did_exceed_test_failure_limit:
yield self.filter_failures_using_results_db(second_results.failing_tests)
self.setProperty('second_run_failures_filtered', sorted(self.failing_tests_filtered))
self.setProperty('results-db_second_run_pre_existing', sorted(self.preexisting_failures_in_results_db))
Expand Down

0 comments on commit 14dcf9a

Please sign in to comment.