def render_metadata_progress(): valid_checks = [ x for x in sorted(get_valid_checks()) if not is_tile_only(x) and not is_logs_only(x) ] total_checks = len(valid_checks) checks_with_metadata = 0 lines = ['## Metadata submission', '', None, '', '??? check "Completed"'] for check in valid_checks: status = ' ' check_file = get_check_file(check) if os.path.exists(check_file): with open(check_file, 'r', encoding='utf-8') as f: contents = f.read() if 'self.set_metadata' in contents: status = 'X' checks_with_metadata += 1 lines.append(f' - [{status}] {check}') percent = checks_with_metadata / total_checks * 100 formatted_percent = f'{percent:.2f}' lines[2] = f'[={formatted_percent}% "{formatted_percent}%"]' lines[4] = f'??? check "Completed {checks_with_metadata}/{total_checks}"' return lines
def render_e2e_progress(): valid_checks = [ x for x in sorted(get_valid_checks()) if not is_tile_only(x) and not is_logs_only(x) ] total_checks = len(valid_checks) checks_with_e2e = 0 lines = ['## E2E tests', '', None, '', '??? check "Completed"'] for check in valid_checks: if has_e2e(check): status = 'X' checks_with_e2e += 1 else: status = ' ' lines.append(f' - [{status}] {check}') percent = checks_with_e2e / total_checks * 100 formatted_percent = f'{percent:.2f}' lines[2] = f'[={formatted_percent}% "{formatted_percent}%"]' lines[4] = f'??? check "Completed {checks_with_e2e}/{total_checks}"' return lines
def test_is_logs_only(get_root): get_root.return_value = os.path.abspath( os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../..')) assert is_logs_only('flink')