diff options
author | Yongqin Liu <yongqin.liu@linaro.org> | 2019-01-14 01:12:41 +0800 |
---|---|---|
committer | Yongqin Liu <yongqin.liu@linaro.org> | 2019-01-14 01:12:41 +0800 |
commit | 145a4b1487c878a5d1589475af053c17a32d530e (patch) | |
tree | 5b384c67b3a4a2f29aac436759989452b216b142 /lkft | |
parent | d6bb35af9344c8e66ca98be01313d54ad1e8abc1 (diff) |
fixed some problem for filing bugs
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
Diffstat (limited to 'lkft')
-rw-r--r-- | lkft/templates/lkft-file-bug.html | 4 | ||||
-rw-r--r-- | lkft/templates/lkft-jobs.html | 43 | ||||
-rw-r--r-- | lkft/templates/lkft-projects.html | 2 | ||||
-rw-r--r-- | lkft/views.py | 79 |
4 files changed, 93 insertions, 35 deletions
diff --git a/lkft/templates/lkft-file-bug.html b/lkft/templates/lkft-file-bug.html index b20a237..fe84661 100644 --- a/lkft/templates/lkft-file-bug.html +++ b/lkft/templates/lkft-file-bug.html @@ -7,11 +7,11 @@ {% block content %} <div align="center"> {% if not from.errors and submit_result %} -<div>Bug created successfully <a href="{{build_info.bugzilla_show_bug_prefix}}{{build_info.bug_id}}">{{build_info.bug_id}}</a></div> +<div>Bug created successfully <a href="{{bug_info.bugzilla_show_bug_prefix}}{{bug_info.bug_id}}">{{bug_info.bug_id}}</a></div> {% else %} <div>{{ form.errors }}</div> -<form action="/report/file-bug/" method="post"> +<form action="/lkft/file-bug/" method="post"> {% csrf_token %} <table border="2" > {{ form.as_table }} diff --git a/lkft/templates/lkft-jobs.html b/lkft/templates/lkft-jobs.html index 2f56337..ff5ced8 100644 --- a/lkft/templates/lkft-jobs.html +++ b/lkft/templates/lkft-jobs.html @@ -1,6 +1,9 @@ {% extends '_layouts/base.html' %} + {% load static%} {% load escapesharp %} +{% load startswith %} + {% block title %} Jobs for {{ project.name }} {{ build.version }} {% endblock %} {% block headline %}<h1>Jobs for {{ project.name }} {{ build.version }}</h1>{% endblock %} @@ -11,12 +14,13 @@ {% block content %} <div> +<h2>Job List:</h2> <table border="1"> <tr> - <td> Index</td> - <td> Job Id(Job Link)</a> </td> - <td> Job Name(Result Attachment Link) </a></td> - <td> Job Status </td> + <th> Index</th> + <th> Job Id(Job Link)</a> </th> + <th> Job Name(Result Attachment Link) </a></th> + <th> Job Status </th> </tr> {% for job in jobs %} <tr> @@ -34,6 +38,7 @@ </div> <hr/> +<div> <h2>Bug Status:</h2> {% if open_bugs %} <table border=2> @@ -57,10 +62,11 @@ {% else %} Excellent build, no open bugs on it at the moment. {% endif %} - +</div> <hr/> <div align="left"> +<h2>Summary of Failures</h2> <table class="testdetails"> <tbody> <tr> @@ -80,7 +86,13 @@ Excellent build, no open bugs on it at the moment. {% with failure.abis as abis %} {% for abi in abis %} {% if not forloop.first %}<br/>{% endif %} - {{ abi }} + {% if failure.module_name|startswith:'Vts' %} + <a href="https://qa-reports.linaro.org/android-lkft/{{ project.name }}/tests/vts-test/{{abi}}.{{failure.module_name}}/{{failure.test_class}}.{{failure.test_method}}">{{ abi }}</a> + {% elif failure.module_name == "CtsOnGsiTrebleFrameworkVintfTest" %} + <a href="https://qa-reports.linaro.org/android-lkft/{{ project.name }}/tests/vts-test/{{abi}}.{{failure.module_name}}/{{failure.test_class}}.{{failure.test_method}}">{{ abi }}</a> + {% else %} + <a href="https://qa-reports.linaro.org/android-lkft/{{ project.name }}/tests/cts-lkft-{{abi}}/{{abi}}.{{failure.module_name}}/{{failure.test_class}}.{{failure.test_method}}">{{ abi }}</a> + {% endif %} {% endfor %} {% endwith %} </td> @@ -96,9 +108,9 @@ Excellent build, no open bugs on it at the moment. {% with failure.bugs as bugs %} {% for bug in bugs %} {% if not forloop.first %}<br/>{% endif %} - <a target="_blank" href="{{build_info.bugzilla_show_bug_prefix}}{{bug.id}}"> + <a target="_blank" href="{{bugzilla_show_bug_prefix}}{{bug.id}}"> {% if bug.status == 'RESOLVED' %} - <del> {{ bug.id }} </del> + <del style="background-color:lightgrey; color:white"> {{ bug.id }} </del> {% else %} {{ bug.id }} {% endif %} @@ -116,12 +128,13 @@ Excellent build, no open bugs on it at the moment. <hr/> <hr/> <div align="left"> +<h2>Details of Failures</h2> {% for module_name, module_failures in failures.items %} {% if module_failures|length > 0 %} <table class="testdetails"> <tbody> <tr> - <td class="module" colspan="8"> + <td class="module" colspan="9"> <a name="{{module_name}}">{{module_name}} has {{ module_failures|length }} failures</a> </td> </tr> @@ -144,7 +157,13 @@ Excellent build, no open bugs on it at the moment. {% with failure.abis as abis %} {% for abi in abis %} {% if not forloop.first %}<br/>{% endif %} - {{ abi }} + {% if failure.module_name|startswith:'Vts' %} + <a href="https://qa-reports.linaro.org/android-lkft/{{ project.name }}/tests/vts-test/{{abi}}.{{failure.module_name}}/{{failure.test_class}}.{{failure.test_method}}">{{ abi }}</a> + {% elif failure.module_name == "CtsOnGsiTrebleFrameworkVintfTest" %} + <a href="https://qa-reports.linaro.org/android-lkft/{{ project.name }}/tests/vts-test/{{abi}}.{{failure.module_name}}/{{failure.test_class}}.{{failure.test_method}}">{{ abi }}</a> + {% else %} + <a href="https://qa-reports.linaro.org/android-lkft/{{ project.name }}/tests/cts-lkft-{{abi}}/{{abi}}.{{failure.module_name}}/{{failure.test_class}}.{{failure.test_method}}">{{ abi }}</a> + {% endif %} {% endfor %} {% endwith %} </td> @@ -163,13 +182,13 @@ Excellent build, no open bugs on it at the moment. {% if not forloop.first %}<br/>{% endif %} <a target="_blank" href="{{bugzilla_show_bug_prefix}}{{bug.id}}"> {% if bug.status == 'RESOLVED' %} - <del> {{ bug.id }} </del> + <del style="background-color:lightgrey; color:white"> {{ bug.id }} </del> {% else %} {{ bug.id }} {% endif %} </a> {% empty %} - <a target='_blank' href="/lkft/file-bug?build_name={{ build_info.build_name}}&build_no={{build_info.build_no}}&module_name={{module_name}}&test_name={{failure.test_name|escapesharp}}&qa_job_ids={{failure.qa_job_ids|join:','}}">Report Android Bug</a> + <a target='_blank' href="/lkft/file-bug?module_name={{module_name}}&test_name={{failure.test_name|escapesharp}}&qa_job_ids={{failure.qa_job_ids|join:','}}">Report Android Bug</a> {% endfor %} {% endwith %} </td> diff --git a/lkft/templates/lkft-projects.html b/lkft/templates/lkft-projects.html index fc5c076..4cb19b5 100644 --- a/lkft/templates/lkft-projects.html +++ b/lkft/templates/lkft-projects.html @@ -29,6 +29,7 @@ <th>Index</th> <th>Bug Id</th> <th>Summary</th> + <th>Version</th> <th>Status</th> </tr> {% for bug in open_bugs %} @@ -37,6 +38,7 @@ <td>{{ forloop.counter }}</td> <td><a href="https://bugs.linaro.org/show_bug.cgi?id={{ bug.id }}">{{ bug.id }}</a></td> <td>{{ bug.summary }}</td> + <td>{{ bug.version }}</td> <td>{{ bug.status }}</td> </tr> {% endifnotequal %} diff --git a/lkft/views.py b/lkft/views.py index 8939706..83a80eb 100644 --- a/lkft/views.py +++ b/lkft/views.py @@ -190,6 +190,8 @@ def extract(result_zip_path, failed_testcases_all={}, metadata={}): failed_tests_module[test_name]= { 'test_name': test_name, 'module_name': module_name, + 'test_class': test_case.get("name"), + 'test_method': failed_test.get("name"), 'abi_stacktrace': {abi: stacktrace}, 'qa_job_ids': [ qa_job_id ], 'kernel_versions': [ kernel_version ], @@ -260,7 +262,6 @@ def get_lkft_bugs(): {u'component': 'General'}, {u'platform': 'HiKey'}, {u'op_sys': 'Android'}, - #{u'version': get_bug_version_from_build_name(build_name)}, {u'keywords': 'LKFT'} ] @@ -320,8 +321,10 @@ def list_jobs(request): bugs = get_lkft_bugs() failures_list = [] - for module_name, failures_in_module in failures.items(): - for test_name, failure in failures_in_module.items(): + for module_name in sorted(failures.keys()): + failures_in_module = failures.get(module_name) + for test_name in sorted(failures_in_module.keys()): + failure = failures_in_module.get(test_name) abi_stacktrace = failure.get('abi_stacktrace') abis = sorted(abi_stacktrace.keys()) @@ -350,13 +353,17 @@ def list_jobs(request): else: failure['bugs'] = [bug] - + android_version = get_bug_android_version_from_project_name(project_name=project.get('name')) open_bugs = [] for bug in bugs: - if bug.status== 'VERIFIED' or bug.status== 'RESOLVED': + if bug.status == 'VERIFIED' or bug.status == 'RESOLVED': + continue + + if bug.version != android_version: continue - else: - open_bugs.append(bug) + + open_bugs.append(bug) + # sort failures for module_name, failures_in_module in failures.items(): @@ -427,14 +434,16 @@ def file_bug(request): bug.keywords = cd['keywords'] bug_id = bugzilla_instance.post_bug(bug).id - + bug_info = { + 'bugzilla_show_bug_prefix': bugzilla_show_bug_prefix, + 'bug_id': bug_id, + } submit_result = True return render(request, 'lkft-file-bug.html', { "submit_result": submit_result, - 'bugzilla_show_bug_prefix': bugzilla_show_bug_prefix, - 'bug_id': bug_id, - 'form': 'form' + 'bug_info': bug_info, + 'form': form, }) else: @@ -475,6 +484,7 @@ def file_bug(request): project_api_url = qa_jobs[0].get('target') project = qa_report_get_with_full_api(request_url=project_api_url) + build_api_url = qa_jobs[0].get('target_build') build = qa_report_get_with_full_api(request_url=build_api_url) @@ -499,12 +509,6 @@ def file_bug(request): 'version': get_bug_android_version_from_project_name(project.get('name')), } - if test_name.find(module_name) >=0: - form_initial['summary'] = '%s' % (test_name) - description = '%s' % (test_name) - else: - form_initial['summary'] = '%s %s' % (module_name, test_name) - description = '%s %s' % (module_name, test_name) def extract_abi_stacktrace(result_zip_path, module_name='', test_name=''): failures = {} @@ -531,33 +535,66 @@ def file_bug(request): logger.info('Please Check %s manually' % result_zip_path) return failures + project_kernel_version = None + if project.get('name').startswith('android-hikey-linaro-') or project.get('name').startswith('android-x15-linux-'): + project_kernel_version = project.get('name').split('-')[3] + else: + # aosp-master-tracking and aosp-8.1-tracking + pass + abis = [] stacktrace_msg = None failures = {} + failed_kernels = [] for qa_job in qa_jobs: lava_job_id = qa_job.get('job_id') lava_url = qa_job.get('external_url') lava_config = find_lava_config(lava_url) result_file_path = get_result_file_path(qa_job) - failures.update(extract_abi_stacktrace(result_file_path, module_name=module_name, test_name=test_name)) + + if project_kernel_version is None: + environment = qa_job.get('environment') + if environment.startswith('hi6220-hikey_'): + kernel_version = environment.replace('hi6220-hikey_', '') + else: + # impossible path for hikey + pass + else: + kernel_version = project_kernel_version + + qa_job['kernel_version'] = kernel_version + job_failures = extract_abi_stacktrace(result_file_path, module_name=module_name, test_name=test_name) + failures.update(job_failures) + if not kernel_version in failed_kernels: + # assuming the job specified mush have the failure for the module and test + failed_kernels.append(kernel_version) abis = sorted(failures.keys()) stacktrace_msg = '' if len(abis) == 0: - logger.error('Failed to get stacktrace information for %s %s form jobs: '% (module_name, test_name, str(job_ids))) + logger.error('Failed to get stacktrace information for %s %s form jobs: '% (module_name, test_name, str(qa_job_ids_str))) elif (len(abis) == 2) and (failures.get(abis[0]) != failures.get(abis[1])): for abi in abis: stacktrace_msg = '%s\n\n%s:\n%s' % (stacktrace_msg, abi, failures.get(abi)) else: stacktrace_msg = failures.get(abis[0]) + if test_name.find(module_name) >=0: + form_initial['summary'] = '%s %s' % (' '.join(sorted(failed_kernels)), test_name) + description = '%s' % (test_name) + else: + form_initial['summary'] = '%s %s %s' % (' '.join(sorted(failed_kernels)), module_name, test_name) + description = '%s %s' % ( module_name, test_name) + + description += '\n\nABIs:\n%s' % (' '.join(abis)) + description += '\n\nKernels:\n%s' % (' '.join(sorted(failed_kernels))) description += '\n\nStackTrace: \n%s' % (stacktrace_msg.strip()) - description += '\n\nLava Job:' + description += '\n\nLava Jobs:' for qa_job in qa_jobs: description += '\n%s' % (qa_job.get('external_url')) - description += '\n\nResult File Url:' + description += '\n\nResult File Urls:' for qa_job in qa_jobs: description += '\n%s' % qa_job.get('attachment_url') |