Example #1
0
 def setUp(self):
     fltrs = [
         filters.String('string_field', 'string_param'),
         filters.Int('int_field', 'int_param')
     ]
     self.filter = filters.Keyword(fltrs, 'field', 'param')
     self.query = mock.Mock()
Example #2
0
 def setUp(self):
     self.params = {}
     self.query = mock.Mock()
     self.filters = [
         filters.String('string_field', 'string_param'),
         filters.Int('int_field', 'int_param'),
         filters.Boolean('bool_field', 'bool_param'),
     ]
Example #3
0
    def __init__(self):
        self.param_key = 'group'

    def add(self, query, params):
        """Add group filter."""
        value = params.get(self.param_key, '')
        if filters.is_empty(value):
            query.filter('is_leader', True)
            return
        query.filter('group_id',
                     helpers.cast(value, int, "'group' must be int."))


KEYWORD_FILTERS = [
    GroupFilter(),
    filters.String('bug_indices', 'issue'),
    filters.String('platform', 'platform'),
    filters.String('impact_stable_version_indices', 'stable'),
    filters.String('impact_beta_version_indices', 'beta'),
    filters.String('fuzzer_name_indices', 'fuzzer'),
    filters.String('job_type', 'job'),
]

FILTERS = [
    filters.String('impact_version_indices', 'impact'),
    filters.Boolean('has_bug_flag', 'issue'),
    filters.Boolean('open', 'open'),
    filters.Boolean('security_flag', 'security'),
    filters.Keyword(KEYWORD_FILTERS, 'keywords', 'q'),
    filters.NegativeBoolean('one_time_crasher_flag', 'reproducible'),
    filters.String('job_type', 'job'),
Example #4
0
    for keyword in value.split(' '):
      query.raw_filter(
          '(LOWER(crash_state) LIKE %s OR LOWER(crash_type) LIKE %s)' %
          (json.dumps('%%%s%%' % keyword.lower()),
           json.dumps('%%%s%%' % keyword.lower())))


GROUP_FILTERS = [
    filters.Boolean('is_new', 'new'),
]

FILTERS = [
    TimeFilter(),
    filters.Boolean('security_flag', 'security'),
    filters.Boolean('reproducible_flag', 'reproducible'),
    filters.String('job_type', 'job'),
    filters.String('project', 'project'),
    FuzzerFilter(),
    PlatformFilter(),
    KeywordFilter(),
]


def query_testcase(project_name, crash_type, crash_state, security_flag,
                   is_open):
  """Start a query for an associated testcase."""
  return data_types.Testcase.query(
      data_types.Testcase.project_name == project_name,
      data_types.Testcase.crash_type == crash_type,
      data_types.Testcase.crash_state == crash_state,
      data_types.Testcase.security_flag == security_flag,
Example #5
0
 def setUp(self):
     self.filter = filters.String('field', 'param')
     self.query = mock.Mock()