Exemple #1
0
def _LogToFlakinessDashboard(results, test_type, test_package,
                             flakiness_server):
    """Upload results to the flakiness dashboard"""
    logging.info('Upload results for test type "%s", test package "%s" to %s',
                 test_type, test_package, flakiness_server)

    try:
        # TODO(jbudorick): remove Instrumentation once instrumentation tests
        # switch to platform mode.
        if test_type in ('instrumentation', 'Instrumentation'):
            if flakiness_server == constants.UPSTREAM_FLAKINESS_SERVER:
                assert test_package in [
                    'ContentShellTest', 'ChromePublicTest',
                    'ChromeSyncShellTest', 'SystemWebViewShellLayoutTest',
                    'WebViewInstrumentationTest'
                ]
                dashboard_test_type = ('%s_instrumentation_tests' %
                                       test_package.lower().rstrip('test'))
            # Downstream server.
            else:
                dashboard_test_type = 'Chromium_Android_Instrumentation'

        elif test_type == 'gtest':
            dashboard_test_type = test_package

        else:
            logging.warning('Invalid test type')
            return

        results_uploader.Upload(results, flakiness_server, dashboard_test_type)

    except Exception:  # pylint: disable=broad-except
        logging.exception('Failure while logging to %s', flakiness_server)
Exemple #2
0
def _LogToFlakinessDashboard(results, test_type, test_package,
                             flakiness_server):
    """Upload results to the flakiness dashboard"""
    logging.info('Upload results for test type "%s", test package "%s" to %s' %
                 (test_type, test_package, flakiness_server))

    try:
        if test_type == 'Instrumentation':
            if flakiness_server == constants.UPSTREAM_FLAKINESS_SERVER:
                assert test_package in [
                    'ContentShellTest', 'ChromePublicTest', 'ChromeShellTest',
                    'ChromeSyncShellTest', 'AndroidWebViewTest'
                ]
                dashboard_test_type = ('%s_instrumentation_tests' %
                                       test_package.lower().rstrip('test'))
            # Downstream server.
            else:
                dashboard_test_type = 'Chromium_Android_Instrumentation'

        elif test_type == 'Unit test':
            dashboard_test_type = test_package

        else:
            logging.warning('Invalid test type')
            return

        results_uploader.Upload(results, flakiness_server, dashboard_test_type)

    except Exception as e:
        logging.error(e)