Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Testing.individual_test_case_health() API method #2537

Merged
merged 2 commits into from
Sep 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions kiwi_lint/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,7 @@ def flatten(urlpatterns, prefix="^", result=None):
return flatten(root_urlpatterns)

def visit_module(self, node):
if node.name in self.views_by_module.keys() and not node.name.endswith(
".admin"
):
if node.name in self.views_by_module and not node.name.endswith(".admin"):
self.view_module = node.name

def leave_module(self, node): # pylint: disable=unused-argument
Expand Down
16 changes: 16 additions & 0 deletions tcms/telemetry/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,22 @@ def test_case_health(query=None):
return data


@http_basic_auth_login_required
@rpc_method(name="Testing.individual_test_case_health")
def individual_test_case_health_simple(query=None):

if query is None:
query = {}

res = (
TestExecution.objects.filter(**query)
.values("run__plan", "case_id", "status__name", "status__weight")
.order_by("case", "run__plan", "status__weight")
)

return list(res)


def _remove_all_excellent_executions(data):
for key in dict.fromkeys(data):
if data[key]["count"]["fail"] == 0:
Expand Down