Ejemplo n.º 1
0
    def test_get_test_views_filter_on_attributes(self):
        tests = rpc_interface.get_test_views(
            include_attributes_where='attribute = "myattr" '
            'and value = "myval"')
        self._check_test_names(tests, ['mytest1'])

        tests = rpc_interface.get_test_views(
            exclude_attributes_where='attribute="myattr2"')
        self._check_test_names(tests, ['mytest2', 'kernbench'])
Ejemplo n.º 2
0
    def test_get_test_views_filter_on_attributes(self):
        tests = rpc_interface.get_test_views(
            include_attributes_where='attribute = "myattr" '
            'and value = "myval"')
        self._check_test_names(tests, ['mytest1'])

        tests = rpc_interface.get_test_views(
            exclude_attributes_where='attribute="myattr2"')
        self._check_test_names(tests, ['mytest2', 'kernbench'])
Ejemplo n.º 3
0
    def test_get_test_views(self):
        tests = rpc_interface.get_test_views()

        self.assertEqual(len(tests), 3)
        test = rpc_interface.get_test_views(
            job_name='myjob1', test_name='mytest1')[0]
        self.assertEqual(tests[0], test)

        self._check_for_get_test_views(test)

        self.assertEqual(
            [], rpc_interface.get_test_views(hostname='fakehost'))
Ejemplo n.º 4
0
    def test_get_test_views(self):
        tests = rpc_interface.get_test_views()

        self.assertEquals(len(tests), 3)
        test = rpc_interface.get_test_views(
            job_name='myjob1', test_name='mytest1')[0]
        self.assertEquals(tests[0], test)

        self._check_for_get_test_views(test)

        self.assertEquals([],
                          rpc_interface.get_test_views(hostname='fakehost'))
Ejemplo n.º 5
0
    def test_filtering_on_machine_label_fields(self):
        self._setup_machine_labels()

        tests = rpc_interface.get_test_views(
            extra_where='machine_label_label1 = "label1"',
            machine_label_fields=['label1'])
        self.assertEquals(len(tests), 1)
Ejemplo n.º 6
0
    def test_filtering_on_machine_label_fields(self):
        self._setup_machine_labels()

        tests = rpc_interface.get_test_views(
            extra_where='machine_label_label1 = "label1"',
            machine_label_fields=['label1'])
        self.assertEqual(len(tests), 1)
Ejemplo n.º 7
0
    def test_get_test_attribute_fields(self):
        tests = rpc_interface.get_test_views(
            test_attribute_fields=['myattr', 'myattr2'])
        self.assertEquals(len(tests), 3)

        self.assertEquals(tests[0]['test_attribute_myattr'], 'myval')
        self.assertEquals(tests[0]['test_attribute_myattr2'], 'myval2')

        for index in (1, 2):
            self.assertEquals(tests[index]['test_attribute_myattr'], None)
            self.assertEquals(tests[index]['test_attribute_myattr2'], None)
Ejemplo n.º 8
0
    def test_get_test_label_fields(self):
        tests = rpc_interface.get_test_views(
            test_label_fields=['testlabel2', 'testlabel3'])
        self.assertEqual(len(tests), 3)

        self.assertEqual(tests[0]['test_label_testlabel2'], 'testlabel2')
        self.assertEqual(tests[0]['test_label_testlabel3'], 'testlabel3')

        for index in (1, 2):
            self.assertEqual(tests[index]['test_label_testlabel2'], None)
            self.assertEqual(tests[index]['test_label_testlabel3'], None)
Ejemplo n.º 9
0
    def test_get_test_attribute_fields(self):
        tests = rpc_interface.get_test_views(
            test_attribute_fields=['myattr', 'myattr2'])
        self.assertEqual(len(tests), 3)

        self.assertEqual(tests[0]['test_attribute_myattr'], 'myval')
        self.assertEqual(tests[0]['test_attribute_myattr2'], 'myval2')

        for index in (1, 2):
            self.assertEqual(tests[index]['test_attribute_myattr'], None)
            self.assertEqual(tests[index]['test_attribute_myattr2'], None)
Ejemplo n.º 10
0
    def test_get_test_label_fields(self):
        tests = rpc_interface.get_test_views(
            test_label_fields=['testlabel2', 'testlabel3'])
        self.assertEquals(len(tests), 3)

        self.assertEquals(tests[0]['test_label_testlabel2'], 'testlabel2')
        self.assertEquals(tests[0]['test_label_testlabel3'], 'testlabel3')

        for index in (1, 2):
            self.assertEquals(tests[index]['test_label_testlabel2'], None)
            self.assertEquals(tests[index]['test_label_testlabel3'], None)
Ejemplo n.º 11
0
    def test_get_machine_label_fields(self):
        self._setup_machine_labels()

        tests = rpc_interface.get_test_views(
            machine_label_fields=['label1', 'otherlabel'])
        self.assertEqual(len(tests), 3)

        self.assertEqual(tests[0]['machine_label_label1'], 'label1')
        self.assertEqual(tests[0]['machine_label_otherlabel'], None)

        for index in (1, 2):
            self.assertEqual(tests[index]['machine_label_label1'], None)
            self.assertEqual(tests[index]['machine_label_otherlabel'], None)
Ejemplo n.º 12
0
    def test_get_machine_label_fields(self):
        self._setup_machine_labels()

        tests = rpc_interface.get_test_views(
            machine_label_fields=['label1', 'otherlabel'])
        self.assertEquals(len(tests), 3)

        self.assertEquals(tests[0]['machine_label_label1'], 'label1')
        self.assertEquals(tests[0]['machine_label_otherlabel'], None)

        for index in (1, 2):
            self.assertEquals(tests[index]['machine_label_label1'], None)
            self.assertEquals(tests[index]['machine_label_otherlabel'], None)
Ejemplo n.º 13
0
    def test_get_iteration_result_fields(self):
        num_iterations = rpc_interface.get_num_test_views(
            iteration_result_fields=['iresult', 'iresult2'])
        self.assertEqual(num_iterations, 2)

        iterations = rpc_interface.get_test_views(
            iteration_result_fields=['iresult', 'iresult2'])
        self.assertEqual(len(iterations), 2)

        for index in (0, 1):
            self.assertEqual(iterations[index]['test_idx'], 1)

        self.assertEqual(iterations[0]['iteration_index'], 1)
        self.assertEqual(iterations[0]['iteration_result_iresult'], 1)
        self.assertEqual(iterations[0]['iteration_result_iresult2'], 2)

        self.assertEqual(iterations[1]['iteration_index'], 2)
        self.assertEqual(iterations[1]['iteration_result_iresult'], 3)
        self.assertEqual(iterations[1]['iteration_result_iresult2'], 4)
Ejemplo n.º 14
0
    def test_get_iteration_result_fields(self):
        num_iterations = rpc_interface.get_num_test_views(
            iteration_result_fields=['iresult', 'iresult2'])
        self.assertEquals(num_iterations, 2)

        iterations = rpc_interface.get_test_views(
            iteration_result_fields=['iresult', 'iresult2'])
        self.assertEquals(len(iterations), 2)

        for index in (0, 1):
            self.assertEquals(iterations[index]['test_idx'], 1)

        self.assertEquals(iterations[0]['iteration_index'], 1)
        self.assertEquals(iterations[0]['iteration_result_iresult'], 1)
        self.assertEquals(iterations[0]['iteration_result_iresult2'], 2)

        self.assertEquals(iterations[1]['iteration_index'], 2)
        self.assertEquals(iterations[1]['iteration_result_iresult'], 3)
        self.assertEquals(iterations[1]['iteration_result_iresult2'], 4)
Ejemplo n.º 15
0
 def test_filtering_on_test_attribute_fields(self):
     tests = rpc_interface.get_test_views(
         extra_where='test_attribute_myattr.value = "myval"',
         test_attribute_fields=['myattr'])
     self.assertEquals(len(tests), 1)
Ejemplo n.º 16
0
 def test_filtering_on_iteration_result_fields(self):
     iterations = rpc_interface.get_test_views(
         extra_where='iteration_result_iresult.value = 1',
         iteration_result_fields=['iresult'])
     self.assertEqual(len(iterations), 1)
Ejemplo n.º 17
0
 def test_filtering_on_test_label_fields(self):
     tests = rpc_interface.get_test_views(
         extra_where='test_label_testlabel2 = "testlabel2"',
         test_label_fields=['testlabel2'])
     self.assertEqual(len(tests), 1)
Ejemplo n.º 18
0
 def test_filtering_on_test_attribute_fields(self):
     tests = rpc_interface.get_test_views(
         extra_where='test_attribute_myattr.value = "myval"',
         test_attribute_fields=['myattr'])
     self.assertEqual(len(tests), 1)
Ejemplo n.º 19
0
    def test_get_test_views_filter_on_labels(self):
        tests = rpc_interface.get_test_views(include_labels=['testlabel2'])
        self._check_test_names(tests, ['mytest1'])

        tests = rpc_interface.get_test_views(exclude_labels=['testlabel2'])
        self._check_test_names(tests, ['mytest2', 'kernbench'])
Ejemplo n.º 20
0
    def test_get_test_views_filter_on_labels(self):
        tests = rpc_interface.get_test_views(include_labels=['testlabel2'])
        self._check_test_names(tests, ['mytest1'])

        tests = rpc_interface.get_test_views(exclude_labels=['testlabel2'])
        self._check_test_names(tests, ['mytest2', 'kernbench'])
Ejemplo n.º 21
0
 def test_filtering_on_test_label_fields(self):
     tests = rpc_interface.get_test_views(
         extra_where='test_label_testlabel2 = "testlabel2"',
         test_label_fields=['testlabel2'])
     self.assertEquals(len(tests), 1)
Ejemplo n.º 22
0
 def test_filtering_on_iteration_result_fields(self):
     iterations = rpc_interface.get_test_views(
         extra_where='iteration_result_iresult.value = 1',
         iteration_result_fields=['iresult'])
     self.assertEquals(len(iterations), 1)