def setUp(self):
        helpers.patch(self, [
            'build_management.build_manager.setup_production_build',
            'system.environment.get_value',
            'bot.testcase_manager.get_command_line_for_application',
            'bot.testcase_manager.test_for_crash_with_retries',
        ])
        self.env = {
            'APP_PATH': 'app',
            'TEST_TIMEOUT': '9',
            'JOB_NAME': 'linux_asan_chrome',
            'TOOL_NAME': 'ASAN'
        }
        self.result = mock.Mock()
        self.result.is_crash = mock.Mock()
        self.result.get_stacktrace = mock.Mock()

        self.mock.setup_production_build.return_value = (
            build_manager.ProductionBuild('/base', '52', None, 'stable'))
        self.mock.get_value.side_effect = self.env.get
        self.mock.test_for_crash_with_retries.return_value = self.result
        self.result.is_crash.return_value = True
        self.result.get_stacktrace.return_value = 'crashed-trace'

        self.testcase = data_types.Testcase()
Esempio n. 2
0
def setup_production_build(request):
    """Setup a production build."""
    build = build_manager.ProductionBuild(request.base_build_dir,
                                          request.version, request.build_url,
                                          request.build_type)
    return _build_response(build.setup())