Esempio 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'])
    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'])
Esempio 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'))
    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'))
    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)
Esempio 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)
    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)
Esempio 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)
Esempio 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)
Esempio 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)
Esempio 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)
Esempio 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)
Esempio 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)
Esempio 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)
Esempio 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)
Esempio 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)
Esempio 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)
Esempio 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)
Esempio 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'])
Esempio 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'])
Esempio 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)
Esempio 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)