Exemplo n.º 1
0
    def test_get_group_counts(self):
        self.assertEquals(rpc_interface.get_num_groups(['job_name']), 2)

        counts = rpc_interface.get_group_counts(['job_name'])
        groups = counts['groups']
        self.assertEquals(len(groups), 2)
        group1, group2 = groups

        self.assertEquals(group1['group_count'], 2)
        self.assertEquals(group1['job_name'], 'myjob1')
        self.assertEquals(group2['group_count'], 1)
        self.assertEquals(group2['job_name'], 'myjob2')

        extra = {'extra' : 'kernel_hash'}
        counts = rpc_interface.get_group_counts(['job_name'],
                                                header_groups=[('job_name',)],
                                                extra_select_fields=extra)
        groups = counts['groups']
        self.assertEquals(len(groups), 2)
        group1, group2 = groups

        self.assertEquals(group1['group_count'], 2)
        self.assertEquals(group1['header_indices'], [0])
        self.assertEquals(group1['extra'], 'mykernel1')
        self.assertEquals(group2['group_count'], 1)
        self.assertEquals(group2['header_indices'], [1])
        self.assertEquals(group2['extra'], 'mykernel2')
Exemplo n.º 2
0
    def test_get_group_counts(self):
        self.assertEquals(rpc_interface.get_num_groups(['job_name']), 2)

        counts = rpc_interface.get_group_counts(['job_name'])
        groups = counts['groups']
        self.assertEquals(len(groups), 2)
        group1, group2 = groups

        self.assertEquals(group1['group_count'], 2)
        self.assertEquals(group1['job_name'], 'myjob1')
        self.assertEquals(group2['group_count'], 1)
        self.assertEquals(group2['job_name'], 'myjob2')

        extra = {'extra' : 'kernel_hash'}
        counts = rpc_interface.get_group_counts(['job_name'],
                                                header_groups=[('job_name',)],
                                                extra_select_fields=extra)
        groups = counts['groups']
        self.assertEquals(len(groups), 2)
        group1, group2 = groups

        self.assertEquals(group1['group_count'], 2)
        self.assertEquals(group1['header_indices'], [0])
        self.assertEquals(group1['extra'], 'mykernel1')
        self.assertEquals(group2['group_count'], 1)
        self.assertEquals(group2['header_indices'], [1])
        self.assertEquals(group2['extra'], 'mykernel2')
    def test_get_group_counts(self):
        self.assertEquals(rpc_interface.get_num_groups(["job_name"]), 2)

        counts = rpc_interface.get_group_counts(["job_name"])
        groups = counts["groups"]
        self.assertEquals(len(groups), 2)
        group1, group2 = groups

        self.assertEquals(group1["group_count"], 2)
        self.assertEquals(group1["job_name"], "myjob1")
        self.assertEquals(group2["group_count"], 1)
        self.assertEquals(group2["job_name"], "myjob2")

        extra = {"extra": "kernel_hash"}
        counts = rpc_interface.get_group_counts(["job_name"], header_groups=[("job_name",)], extra_select_fields=extra)
        groups = counts["groups"]
        self.assertEquals(len(groups), 2)
        group1, group2 = groups

        self.assertEquals(group1["group_count"], 2)
        self.assertEquals(group1["header_indices"], [0])
        self.assertEquals(group1["extra"], "mykernel1")
        self.assertEquals(group2["group_count"], 1)
        self.assertEquals(group2["header_indices"], [1])
        self.assertEquals(group2["extra"], "mykernel2")
    def test_grouping_with_iteration_result_fields(self):
        num_groups = rpc_interface.get_num_groups(["iteration_result_iresult"], iteration_result_fields=["iresult"])
        self.assertEquals(num_groups, 2)

        counts = rpc_interface.get_group_counts(["iteration_result_iresult"], iteration_result_fields=["iresult"])
        groups = counts["groups"]
        self.assertEquals(len(groups), 2)
        self.assertEquals(groups[0]["iteration_result_iresult"], 1)
        self.assertEquals(groups[0]["group_count"], 1)
        self.assertEquals(groups[1]["iteration_result_iresult"], 3)
        self.assertEquals(groups[1]["group_count"], 1)
    def test_grouping_on_test_label_fields(self):
        num_groups = rpc_interface.get_num_groups(["test_label_testlabel1"], test_label_fields=["testlabel1"])
        self.assertEquals(num_groups, 2)

        counts = rpc_interface.get_group_counts(["test_label_testlabel1"], test_label_fields=["testlabel1"])
        groups = counts["groups"]
        self.assertEquals(len(groups), 2)
        self.assertEquals(groups[0]["test_label_testlabel1"], None)
        self.assertEquals(groups[0]["group_count"], 2)
        self.assertEquals(groups[1]["test_label_testlabel1"], "testlabel1")
        self.assertEquals(groups[1]["group_count"], 1)
    def test_grouping_with_test_attribute_fields(self):
        num_groups = rpc_interface.get_num_groups(["test_attribute_myattr"], test_attribute_fields=["myattr"])
        self.assertEquals(num_groups, 2)

        counts = rpc_interface.get_group_counts(["test_attribute_myattr"], test_attribute_fields=["myattr"])
        groups = counts["groups"]
        self.assertEquals(len(groups), num_groups)
        self.assertEquals(groups[0]["test_attribute_myattr"], None)
        self.assertEquals(groups[0]["group_count"], 2)
        self.assertEquals(groups[1]["test_attribute_myattr"], "myval")
        self.assertEquals(groups[1]["group_count"], 1)
Exemplo n.º 7
0
    def test_grouping_on_test_label_fields(self):
        num_groups = rpc_interface.get_num_groups(
                ['test_label_testlabel1'], test_label_fields=['testlabel1'])
        self.assertEquals(num_groups, 2)

        counts = rpc_interface.get_group_counts(
                ['test_label_testlabel1'], test_label_fields=['testlabel1'])
        groups = counts['groups']
        self.assertEquals(len(groups), 2)
        self.assertEquals(groups[0]['test_label_testlabel1'], None)
        self.assertEquals(groups[0]['group_count'], 2)
        self.assertEquals(groups[1]['test_label_testlabel1'], 'testlabel1')
        self.assertEquals(groups[1]['group_count'], 1)
Exemplo n.º 8
0
    def test_grouping_with_test_attribute_fields(self):
        num_groups = rpc_interface.get_num_groups(
                ['test_attribute_myattr'], test_attribute_fields=['myattr'])
        self.assertEquals(num_groups, 2)

        counts = rpc_interface.get_group_counts(
                ['test_attribute_myattr'], test_attribute_fields=['myattr'])
        groups = counts['groups']
        self.assertEquals(len(groups), num_groups)
        self.assertEquals(groups[0]['test_attribute_myattr'], None)
        self.assertEquals(groups[0]['group_count'], 2)
        self.assertEquals(groups[1]['test_attribute_myattr'], 'myval')
        self.assertEquals(groups[1]['group_count'], 1)
Exemplo n.º 9
0
    def test_grouping_with_iteration_result_fields(self):
        num_groups = rpc_interface.get_num_groups(
            ['iteration_result_iresult'], iteration_result_fields=['iresult'])
        self.assertEquals(num_groups, 2)

        counts = rpc_interface.get_group_counts(
            ['iteration_result_iresult'], iteration_result_fields=['iresult'])
        groups = counts['groups']
        self.assertEquals(len(groups), 2)
        self.assertEquals(groups[0]['iteration_result_iresult'], 1)
        self.assertEquals(groups[0]['group_count'], 1)
        self.assertEquals(groups[1]['iteration_result_iresult'], 3)
        self.assertEquals(groups[1]['group_count'], 1)
Exemplo n.º 10
0
    def test_grouping_on_test_label_fields(self):
        num_groups = rpc_interface.get_num_groups(
                ['test_label_testlabel1'], test_label_fields=['testlabel1'])
        self.assertEquals(num_groups, 2)

        counts = rpc_interface.get_group_counts(
                ['test_label_testlabel1'], test_label_fields=['testlabel1'])
        groups = counts['groups']
        self.assertEquals(len(groups), 2)
        self.assertEquals(groups[0]['test_label_testlabel1'], None)
        self.assertEquals(groups[0]['group_count'], 2)
        self.assertEquals(groups[1]['test_label_testlabel1'], 'testlabel1')
        self.assertEquals(groups[1]['group_count'], 1)
Exemplo n.º 11
0
    def test_grouping_with_test_attribute_fields(self):
        num_groups = rpc_interface.get_num_groups(
                ['test_attribute_myattr'], test_attribute_fields=['myattr'])
        self.assertEquals(num_groups, 2)

        counts = rpc_interface.get_group_counts(
                ['test_attribute_myattr'], test_attribute_fields=['myattr'])
        groups = counts['groups']
        self.assertEquals(len(groups), num_groups)
        self.assertEquals(groups[0]['test_attribute_myattr'], None)
        self.assertEquals(groups[0]['group_count'], 2)
        self.assertEquals(groups[1]['test_attribute_myattr'], 'myval')
        self.assertEquals(groups[1]['group_count'], 1)