コード例 #1
0
ファイル: test_publisher.py プロジェクト: worldofchris/jlf
    def testAboutReport(self):

        """
        Add a bit of blurb to the report
        """

        report_config = {'name':     'reports',
                         'reports':  [{'metric':     'cumulative-throughput',
                                       'description': 'All about flow',
                                       'categories': 'foreach',
                                       'types':      'foreach'}],
                         'format':   'xlsx',
                         'counts_towards_throughput': [],
                         'location': self.workspace,
                         'types': {'failure': ['Bug', 'Fault'],
                                   'value': ['New Feature', 'Story', 'Improvement'],
                                   'oo': ['Task', 'Decision', 'User Support', 'Spike']}}

        publisher.publish(report_config,
                          self.mock_metrics,
                          from_date=date(2012, 10, 8),
                          to_date=date(2012, 11, 12))

        expected_filename = 'reports.xlsx'
        actual_output = os.path.join(self.workspace, expected_filename)

        self.assertTrue(os.path.isfile(actual_output), "Spreadsheet not published:{spreadsheet}".format(spreadsheet=actual_output))

        workbook = xlrd.open_workbook(actual_output)
        expected_sheet_name = 'cumulative-throughput'
        self.assertEqual(expected_sheet_name, workbook.sheet_names()[0])
        worksheet = workbook.sheet_by_name(expected_sheet_name)
        actual = worksheet.cell_value(rowx=0, colx=5)
        expected = report_config['reports'][0]['description']
        self.assertEqual(actual, expected)
コード例 #2
0
ファイル: test_publisher.py プロジェクト: worldofchris/jlf
    def testOutputFailureDemandToExcel(self):

        report_config = {'name':     'reports',
                         'reports':  [{'metric':     'demand',
                                       'categories': 'foreach',
                                       'types':      ['failure']}],
                         'format':   'xlsx',
                         'location': self.workspace,
                         'counts_towards_throughput': [],
                         'types': {'failure': ['Bug', 'Fault'],
                                   'value': ['New Feature', 'Story', 'Improvement'],
                                   'oo': ['Task', 'Decision', 'User Support', 'Spike']}}

        publisher.publish(report_config,
                          self.mock_metrics,
                          from_date=date(2012, 10, 8),
                          to_date=date(2012, 11, 12))

        expected_filename = 'reports.xlsx'
        actual_output = os.path.join(self.workspace, expected_filename)

        self.assertTrue(os.path.isfile(actual_output), "Spreadsheet not published:{spreadsheet}".format(spreadsheet=actual_output))

        # with a sheet containing the throughput data

        workbook = xlrd.open_workbook(actual_output)
        self.assertEqual('failure-demand', workbook.sheet_names()[0])
コード例 #3
0
ファイル: test_publisher.py プロジェクト: fikander/jlf
    def testOutputCycleTimeToExcel(self):

        report_config = {
            'name':
            'reports',
            'reports': [{
                'metric': 'cycle-time',
                'categories': 'foreach',
                'types': ['value'],
                'cycles': ['develop']
            }],
            'format':
            'xlsx',
            'location':
            self.workspace
        }

        publisher.publish(report_config,
                          self.mock_metrics,
                          from_date=date(2012, 10, 8),
                          to_date=date(2012, 11, 12))

        expected_filename = 'reports.xlsx'
        actual_output = os.path.join(self.workspace, expected_filename)

        self.assertTrue(
            os.path.isfile(actual_output),
            "Spreadsheet not published:{spreadsheet}".format(
                spreadsheet=actual_output))

        # with a sheet containing the throughput data

        workbook = xlrd.open_workbook(actual_output)
        self.assertEqual('value-develop-cycle-time', workbook.sheet_names()[0])
コード例 #4
0
ファイル: test_publisher.py プロジェクト: fikander/jlf
    def testOutputArrivalRateToExcel(self):

        report_config = {
            'name': 'reports',
            'reports': [{
                'metric': 'arrival-rate'
            }],
            'format': 'xlsx',
            'location': self.workspace
        }

        publisher.publish(report_config,
                          self.mock_metrics,
                          from_date=date(2012, 10, 8),
                          to_date=date(2012, 11, 12))

        expected_filename = 'reports.xlsx'
        actual_output = os.path.join(self.workspace, expected_filename)

        self.assertTrue(
            os.path.isfile(actual_output),
            "Spreadsheet not published:{spreadsheet}".format(
                spreadsheet=actual_output))

        workbook = xlrd.open_workbook(actual_output)

        expected_sheet_name = 'arrival-rate'
        self.assertEqual(expected_sheet_name, workbook.sheet_names()[0])
        worksheet = workbook.sheet_by_name(expected_sheet_name)
        header_row = worksheet.row(0)
        expected_headers = ['one', 'two', 'three']
コード例 #5
0
ファイル: test_publisher.py プロジェクト: fikander/jlf
    def testOutputCFDToExcel(self):

        report_config = {
            'name': 'reports',
            'states': [],
            'reports': [{
                'metric': 'cfd'
            }],
            'format': 'xlsx',
            'counts_towards_throughput': [],
            'location': self.workspace
        }

        publisher.publish(report_config,
                          self.mock_metrics,
                          from_date=date(2012, 10, 8),
                          to_date=date(2012, 11, 12))

        expected_filename = 'reports.xlsx'
        actual_output = os.path.join(self.workspace, expected_filename)

        self.assertTrue(
            os.path.isfile(actual_output),
            "Spreadsheet not published:{spreadsheet}".format(
                spreadsheet=actual_output))

        # with a sheet containing the throughput data

        workbook = xlrd.open_workbook(actual_output)
        self.assertEqual('cfd', workbook.sheet_names()[0])
コード例 #6
0
ファイル: test_publisher.py プロジェクト: fikander/jlf
    def testCfdDefaultColours(self):

        report_config = {
            'name': 'reports_default',
            'states': ['open', 'in progress', 'closed'],
            'reports': [{
                'metric': 'cfd'
            }],
            'format': 'xlsx',
            'location': self.workspace
        }

        publisher.publish(report_config,
                          self.mock_metrics,
                          from_date=date(2012, 10, 8),
                          to_date=date(2012, 11, 12))

        expected_filename = 'reports_default.xlsx'
        actual_output = os.path.join(self.workspace, expected_filename)

        self.assertTrue(
            os.path.isfile(actual_output),
            "Spreadsheet not published:{spreadsheet}".format(
                spreadsheet=actual_output))

        self.compareExcelFiles(actual_output, expected_filename)
コード例 #7
0
ファイル: test_publisher.py プロジェクト: fikander/jlf
    def testCumulativeThroughputGraph(self):
        report_config = {
            'name':
            'reports',
            'reports': [{
                'metric': 'cumulative-throughput',
                'categories': 'foreach',
                'types': 'foreach',
                'graph': 'yes'
            }],
            'format':
            'xlsx',
            'counts_towards_throughput': [],
            'location':
            self.workspace,
            'types': {
                'failure': ['Bug', 'Fault'],
                'value': ['New Feature', 'Story', 'Improvement'],
                'oo': ['Task', 'Decision', 'User Support', 'Spike']
            }
        }

        publisher.publish(report_config,
                          self.mock_metrics,
                          from_date=date(2012, 10, 8),
                          to_date=date(2012, 11, 12))
コード例 #8
0
ファイル: test_publisher.py プロジェクト: fikander/jlf
    def testOutputMultipleTypesOfThroughput(self):

        report_config = {
            'name':
            'reports',
            'reports': [{
                'metric': 'throughput',
                'categories': 'foreach',
                'types': 'foreach'
            }],
            'format':
            'xlsx',
            'location':
            self.workspace,
            'counts_towards_throughput': [],
            'categories': {
                'one': 'project = "one"',
                'two': 'project = "two"',
                'three': 'project = "three"'
            },
            'types': {
                'failure': ['Bug', 'Fault'],
                'value': ['New Feature', 'Story', 'Improvement'],
                'oo': ['Task', 'Decision', 'User Support', 'Spike']
            }
        }

        publisher.publish(report_config,
                          self.mock_metrics,
                          from_date=date(2012, 10, 8),
                          to_date=date(2012, 11, 12))

        expected_filename = 'reports.xlsx'
        actual_output = os.path.join(self.workspace, expected_filename)

        self.assertTrue(
            os.path.isfile(actual_output),
            "Spreadsheet not published:{spreadsheet}".format(
                spreadsheet=actual_output))

        workbook = xlrd.open_workbook(actual_output)

        expected_sheet_name = 'throughput'
        self.assertEqual(expected_sheet_name, workbook.sheet_names()[0])
        worksheet = workbook.sheet_by_name(expected_sheet_name)
        header_row = worksheet.row(0)
        expected_headers = ['one', 'two', 'three']

        for cell in header_row[1:]:
            self.assertEqual(cell.value,
                             expected_headers[header_row[1:].index(cell)])
コード例 #9
0
ファイル: test_publisher.py プロジェクト: fikander/jlf
    def testOutputThroughputToExcel(self):

        # Given this report config:

        report_config = {
            'name':
            'reports',
            'reports': [{
                'metric': 'throughput',
                'categories': 'foreach',
                'types': 'foreach'
            }],
            'format':
            'xlsx',
            'location':
            self.workspace,
            'counts_towards_throughput': [],
            'types': {
                'failure': ['Bug', 'Fault'],
                'value': ['New Feature', 'Story', 'Improvement'],
                'oo': ['Task', 'Decision', 'User Support', 'Spike']
            }
        }

        # Specify categories and types to report on or:
        # foreach - to report on each category separately
        # combine - to aggregate totals together

        # when we publish the metrics for the data in our jira

        publisher.publish(report_config,
                          self.mock_metrics,
                          from_date=date(2012, 10, 8),
                          to_date=date(2012, 11, 12))

        # Then we should get an Excel workbook

        expected_filename = 'reports.xlsx'
        actual_output = os.path.join(self.workspace, expected_filename)

        self.assertTrue(
            os.path.isfile(actual_output),
            "Spreadsheet not published:{spreadsheet}".format(
                spreadsheet=actual_output))

        # with a sheet containing the throughput data

        workbook = xlrd.open_workbook(actual_output)
        self.assertEqual('throughput', workbook.sheet_names()[0])
コード例 #10
0
ファイル: test_publisher.py プロジェクト: fikander/jlf
    def testOutputDetailToExcel(self):

        report_config = {
            'name':
            'reports',
            'reports': [{
                'metric': 'detail',
                'fields': ['this', 'that', 'the other'],
                'categories': 'foreach',
                'types': 'foreach',
                'sort': 'week-done'
            }],
            'format':
            'xlsx',
            'counts_towards_throughput': [],
            'location':
            self.workspace,
            'types': {
                'failure': ['Bug', 'Fault'],
                'value': ['New Feature', 'Story', 'Improvement'],
                'oo': ['Task', 'Decision', 'User Support', 'Spike']
            }
        }

        publisher.publish(report_config,
                          self.mock_metrics,
                          from_date=date(2012, 10, 8),
                          to_date=date(2012, 11, 12))

        expected_filename = 'reports.xlsx'
        actual_output = os.path.join(self.workspace, expected_filename)

        self.assertTrue(
            os.path.isfile(actual_output),
            "Spreadsheet not published:{spreadsheet}".format(
                spreadsheet=actual_output))

        # with a sheet containing the throughput data

        workbook = xlrd.open_workbook(actual_output)

        self.assertEqual('detail', workbook.sheet_names()[0])

        sheet = workbook.sheet_by_name('detail')

        fields = report_config['reports'][0]['fields']
        for i in range(len(fields)):
            self.assertEqual(sheet.cell_value(0, i + 1), fields[i])
コード例 #11
0
ファイル: test_publisher.py プロジェクト: worldofchris/jlf
    def testCumulativeThroughputGraph(self):
        report_config = {'name':     'reports',
                         'reports':  [{'metric':     'cumulative-throughput',
                                       'categories': 'foreach',
                                       'types':      'foreach',
                                       'graph':      'yes'}],
                         'format':   'xlsx',
                         'counts_towards_throughput': [],
                         'location': self.workspace,
                         'types': {'failure': ['Bug', 'Fault'],
                                   'value': ['New Feature', 'Story', 'Improvement'],
                                   'oo': ['Task', 'Decision', 'User Support', 'Spike']}}

        publisher.publish(report_config,
                          self.mock_metrics,
                          from_date=date(2012, 10, 8),
                          to_date=date(2012, 11, 12))
コード例 #12
0
ファイル: test_publisher.py プロジェクト: fikander/jlf
    def testAboutReport(self):
        """
        Add a bit of blurb to the report
        """

        report_config = {
            'name':
            'reports',
            'reports': [{
                'metric': 'cumulative-throughput',
                'description': 'All about flow',
                'categories': 'foreach',
                'types': 'foreach'
            }],
            'format':
            'xlsx',
            'counts_towards_throughput': [],
            'location':
            self.workspace,
            'types': {
                'failure': ['Bug', 'Fault'],
                'value': ['New Feature', 'Story', 'Improvement'],
                'oo': ['Task', 'Decision', 'User Support', 'Spike']
            }
        }

        publisher.publish(report_config,
                          self.mock_metrics,
                          from_date=date(2012, 10, 8),
                          to_date=date(2012, 11, 12))

        expected_filename = 'reports.xlsx'
        actual_output = os.path.join(self.workspace, expected_filename)

        self.assertTrue(
            os.path.isfile(actual_output),
            "Spreadsheet not published:{spreadsheet}".format(
                spreadsheet=actual_output))

        workbook = xlrd.open_workbook(actual_output)
        expected_sheet_name = 'cumulative-throughput'
        self.assertEqual(expected_sheet_name, workbook.sheet_names()[0])
        worksheet = workbook.sheet_by_name(expected_sheet_name)
        actual = worksheet.cell_value(rowx=0, colx=5)
        expected = report_config['reports'][0]['description']
        self.assertEqual(actual, expected)
コード例 #13
0
ファイル: test_publisher.py プロジェクト: worldofchris/jlf
    def testCfdDefaultColours(self):

        report_config = {'name':     'reports_default',
                         'states':   ['open', 'in progress', 'closed'],
                         'reports':  [{'metric': 'cfd'}],
                         'format':   'xlsx',
                         'location': self.workspace}

        publisher.publish(report_config,
                          self.mock_metrics,
                          from_date=date(2012, 10, 8),
                          to_date=date(2012, 11, 12))

        expected_filename = 'reports_default.xlsx'
        actual_output = os.path.join(self.workspace, expected_filename)

        self.assertTrue(os.path.isfile(actual_output), "Spreadsheet not published:{spreadsheet}".format(spreadsheet=actual_output))
        self.compareExcelFiles(actual_output, expected_filename)
コード例 #14
0
ファイル: test_publisher.py プロジェクト: fikander/jlf
    def testOutputFailureDemandToExcel(self):

        report_config = {
            'name':
            'reports',
            'reports': [{
                'metric': 'demand',
                'categories': 'foreach',
                'types': ['failure']
            }],
            'format':
            'xlsx',
            'location':
            self.workspace,
            'counts_towards_throughput': [],
            'types': {
                'failure': ['Bug', 'Fault'],
                'value': ['New Feature', 'Story', 'Improvement'],
                'oo': ['Task', 'Decision', 'User Support', 'Spike']
            }
        }

        publisher.publish(report_config,
                          self.mock_metrics,
                          from_date=date(2012, 10, 8),
                          to_date=date(2012, 11, 12))

        expected_filename = 'reports.xlsx'
        actual_output = os.path.join(self.workspace, expected_filename)

        self.assertTrue(
            os.path.isfile(actual_output),
            "Spreadsheet not published:{spreadsheet}".format(
                spreadsheet=actual_output))

        # with a sheet containing the throughput data

        workbook = xlrd.open_workbook(actual_output)
        self.assertEqual('failure-demand', workbook.sheet_names()[0])
コード例 #15
0
ファイル: test_publisher.py プロジェクト: worldofchris/jlf
    def testOutputCFDToExcel(self):

        report_config = {'name':     'reports',
                         'states':   [],
                         'reports':  [{'metric': 'cfd'}],
                         'format':   'xlsx',
                         'counts_towards_throughput': [],
                         'location': self.workspace}

        publisher.publish(report_config,
                          self.mock_metrics,
                          from_date=date(2012, 10, 8),
                          to_date=date(2012, 11, 12))

        expected_filename = 'reports.xlsx'
        actual_output = os.path.join(self.workspace, expected_filename)

        self.assertTrue(os.path.isfile(actual_output), "Spreadsheet not published:{spreadsheet}".format(spreadsheet=actual_output))

        # with a sheet containing the throughput data

        workbook = xlrd.open_workbook(actual_output)
        self.assertEqual('cfd', workbook.sheet_names()[0])
コード例 #16
0
ファイル: test_publisher.py プロジェクト: worldofchris/jlf
    def testOutputThroughputToExcel(self):

        # Given this report config:

        report_config = {'name':     'reports',
                         'reports':  [{'metric':    'throughput',
                                      'categories': 'foreach',
                                      'types':      'foreach'}],
                         'format':   'xlsx',
                         'location': self.workspace,
                         'counts_towards_throughput': [],
                         'types': {'failure': ['Bug', 'Fault'],
                                   'value': ['New Feature', 'Story', 'Improvement'],
                                   'oo': ['Task', 'Decision', 'User Support', 'Spike']}}

        # Specify categories and types to report on or:
        # foreach - to report on each category separately
        # combine - to aggregate totals together

        # when we publish the metrics for the data in our jira

        publisher.publish(report_config,
                          self.mock_metrics,
                          from_date=date(2012, 10, 8),
                          to_date=date(2012, 11, 12))

        # Then we should get an Excel workbook

        expected_filename = 'reports.xlsx'
        actual_output = os.path.join(self.workspace, expected_filename)

        self.assertTrue(os.path.isfile(actual_output), "Spreadsheet not published:{spreadsheet}".format(spreadsheet=actual_output))

        # with a sheet containing the throughput data

        workbook = xlrd.open_workbook(actual_output)
        self.assertEqual('throughput', workbook.sheet_names()[0])
コード例 #17
0
ファイル: test_publisher.py プロジェクト: worldofchris/jlf
    def testOutputDetailToExcel(self):

        report_config = {'name':     'reports',
                         'reports':  [{'metric':     'detail',
                                       'fields': ['this', 'that', 'the other'],
                                       'categories': 'foreach',
                                       'types':      'foreach',
                                       'sort':       'week-done'}],
                         'format':   'xlsx',
                         'counts_towards_throughput': [],
                         'location': self.workspace,
                         'types': {'failure': ['Bug', 'Fault'],
                                   'value': ['New Feature', 'Story', 'Improvement'],
                                   'oo': ['Task', 'Decision', 'User Support', 'Spike']}}

        publisher.publish(report_config,
                          self.mock_metrics,
                          from_date=date(2012, 10, 8),
                          to_date=date(2012, 11, 12))

        expected_filename = 'reports.xlsx'
        actual_output = os.path.join(self.workspace, expected_filename)

        self.assertTrue(os.path.isfile(actual_output), "Spreadsheet not published:{spreadsheet}".format(spreadsheet=actual_output))

        # with a sheet containing the throughput data

        workbook = xlrd.open_workbook(actual_output)

        self.assertEqual('detail', workbook.sheet_names()[0])

        sheet = workbook.sheet_by_name('detail')

        fields = report_config['reports'][0]['fields']
        for i in range(len(fields)):
            self.assertEqual(sheet.cell_value(0, i+1), fields[i])
コード例 #18
0
ファイル: test_publisher.py プロジェクト: worldofchris/jlf
    def testOutputCycleTimeToExcel(self):

        report_config = {'name':    'reports',
                         'reports': [{'metric':     'cycle-time',
                                      'categories': 'foreach',
                                      'types':      ['value'],
                                      'cycles':     ['develop']}],
                         'format':   'xlsx',
                         'location': self.workspace}

        publisher.publish(report_config,
                          self.mock_metrics,
                          from_date=date(2012, 10, 8),
                          to_date=date(2012, 11, 12))

        expected_filename = 'reports.xlsx'
        actual_output = os.path.join(self.workspace, expected_filename)

        self.assertTrue(os.path.isfile(actual_output), "Spreadsheet not published:{spreadsheet}".format(spreadsheet=actual_output))

        # with a sheet containing the throughput data

        workbook = xlrd.open_workbook(actual_output)
        self.assertEqual('value-develop-cycle-time', workbook.sheet_names()[0])
コード例 #19
0
ファイル: test_publisher.py プロジェクト: worldofchris/jlf
    def testOutputMultipleTypesOfThroughput(self):

        report_config = {'name':     'reports',
                         'reports':  [{'metric':     'throughput',
                                       'categories': 'foreach',
                                       'types':      'foreach'}],
                         'format':   'xlsx',
                         'location': self.workspace,
                         'counts_towards_throughput': [],
                         'categories': {'one': 'project = "one"',
                                        'two': 'project = "two"',
                                        'three': 'project = "three"'},
                         'types': {'failure': ['Bug', 'Fault'],
                                   'value': ['New Feature', 'Story', 'Improvement'],
                                   'oo': ['Task', 'Decision', 'User Support', 'Spike']}}

        publisher.publish(report_config,
                          self.mock_metrics,
                          from_date=date(2012, 10, 8),
                          to_date=date(2012, 11, 12))

        expected_filename = 'reports.xlsx'
        actual_output = os.path.join(self.workspace, expected_filename)

        self.assertTrue(os.path.isfile(actual_output), "Spreadsheet not published:{spreadsheet}".format(spreadsheet=actual_output))

        workbook = xlrd.open_workbook(actual_output)

        expected_sheet_name = 'throughput'
        self.assertEqual(expected_sheet_name, workbook.sheet_names()[0])
        worksheet = workbook.sheet_by_name(expected_sheet_name)
        header_row = worksheet.row(0)
        expected_headers = ['one', 'two', 'three']

        for cell in header_row[1:]:
            self.assertEqual(cell.value, expected_headers[header_row[1:].index(cell)])
コード例 #20
0
ファイル: test_publisher.py プロジェクト: worldofchris/jlf
    def testOutputArrivalRateToExcel(self):

        report_config = {'name':     'reports',
                         'reports':  [{'metric':     'arrival-rate'}],
                         'format':   'xlsx',
                         'location': self.workspace}

        publisher.publish(report_config,
                          self.mock_metrics,
                          from_date=date(2012, 10, 8),
                          to_date=date(2012, 11, 12))

        expected_filename = 'reports.xlsx'
        actual_output = os.path.join(self.workspace, expected_filename)

        self.assertTrue(os.path.isfile(actual_output), "Spreadsheet not published:{spreadsheet}".format(spreadsheet=actual_output))

        workbook = xlrd.open_workbook(actual_output)

        expected_sheet_name = 'arrival-rate'
        self.assertEqual(expected_sheet_name, workbook.sheet_names()[0])
        worksheet = workbook.sheet_by_name(expected_sheet_name)
        header_row = worksheet.row(0)
        expected_headers = ['one', 'two', 'three']