Skip to content
Open
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
85 changes: 85 additions & 0 deletions bublik/data/schemas/per_conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,91 @@
"uniqueItems": true,
"default": ["Configuration"]
},
"RUN_STATS_COLUMNS_DEFAULT": {
"description": "Column names to display by default in the run stats table, in display order",
"type": "array",
"items": {
"type": "string",
"oneOf": [
{
"const": "objective",
"title": "Objective",
"description": "Test objective"
},
{
"const": "comments",
"title": "Notes",
"description": "User-provided comment for the test"
},
{
"const": "total",
"title": "Total",
"description": "Total number of iterations"
},
{
"const": "run",
"title": "Run",
"description": "Number of iterations actually run (all except skipped)"
},
{
"const": "total_expected",
"title": "Expected Total",
"description": "Total number of expected iterations"
},
{
"const": "passed",
"title": "Expected Passed",
"description": "Number of iterations that passed as expected"
},
{
"const": "failed",
"title": "Expected Failed",
"description": "Number of iterations that failed as expected"
},
{
"const": "total_unexpected",
"title": "Unexpected Total",
"description": "Total number of unexpected iterations"
},
{
"const": "passed_unexpected",
"title": "Unexpected Passed",
"description": "Number of iterations that passed unexpectedly"
},
{
"const": "failed_unexpected",
"title": "Unexpected Failed",
"description": "Number of iterations that failed unexpectedly"
},
{
"const": "skipped",
"title": "Expected Skipped",
"description": "Number of iterations that were skipped as expected"
},
{
"const": "skipped_unexpected",
"title": "Unexpected Skipped",
"description": "Number of iterations that were skipped unexpectedly"
},
{
"const": "abnormal",
"title": "Abnormal",
"description": "Number of iterations that terminated abnormally"
}
]
},
"uniqueItems": true,
"default": [
"run",
"passed",
"failed",
"passed_unexpected",
"failed_unexpected",
"skipped",
"skipped_unexpected",
"abnormal"
]
},
"RUN_STATUS_META": {
"description": "Represents meta name in meta_data.json that defines run status",
"type": "string",
Expand Down
14 changes: 13 additions & 1 deletion bublik/interfaces/api_v2/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@
from rest_framework.viewsets import ModelViewSet

from bublik.core.cache import RunCache
from bublik.core.config.services import ConfigServices
from bublik.core.result import ResultService
from bublik.core.run.services import RunsChartGroupBy, RunService
from bublik.core.run.stats import (
generate_results_details,
generate_runs_details,
)
from bublik.core.utils import get_difference
from bublik.data.models import GlobalConfigs, TestIterationResult
from bublik.data.serializers import (
RunCommentSerializer,
TestIterationResultSerializer,
Expand Down Expand Up @@ -98,7 +100,17 @@ def details(self, _request, pk=None):
@action(detail=True, methods=['get'])
def stats(self, _request, pk=None):
requirements = self.request.query_params.get('requirements')
return Response({'results': RunService.get_run_stats(pk, requirements)})
project_id = TestIterationResult.objects.get(id=pk).project.id
return Response(
{
'results': RunService.get_run_stats(pk, requirements),
'default_columns': ConfigServices.getattr_from_global(
GlobalConfigs.PER_CONF.name,
'RUN_STATS_COLUMNS_DEFAULT',
project_id,
),
},
)

@action(detail=True, methods=['get'])
def requirements(self, _request, pk=None):
Expand Down
Loading