Skip to content

Want to pass additional data in "items" beside test-result counts and not show them all on same pie chart #146

Open
@jimklimov

Description

@jimklimov

What feature do you want to see added?

Our JSON test summaries are parsed from maven verdicts lines and include the time consumption of a test.

Currently the plugin treats all numbers equally, so the pie chart has (say) a small section for 10 passed tests and big section for 200 sec the tests took to execute - which is not really useful. It also displays the info in a table, which is helpful to compare different suites (maybe notice run-away tests that had to time out) and gauge evolution over time.

This RFE is about choosing the best idea to move forward. Notably it seems partially overlapped with earlier issues like #55

  • Note: actual timings are fractional like "123.45s" - per Improve number handling #108 I suppose they are rounded/truncated to integers, not ignored - right?

One idea I've had was to add an optional map (similar to "color" map) to define a list of pie charts and which item keys go where (possibly some columns get represented in several charts; maybe some columns are not exposed anywhere); if this map is absent - default is to put everything on same chart as it is now.

A loose example below aims to render one chart with just the verdicts, no times:

{
  "id": "my report",
  "items": [
    { "id": "testSuite1", "results": {"passed": 3, "failed": 0, "skipped": 1, "timesec": 25} },
    { "id": "testSuite2", "results": {"passed": 8, "failed": 3, "skipped": 0, "timesec": 1200} },
    { "id": "testSuite3", "results": {"passed": 1, "failed": 0, "skipped": 4, "timesec": 5} },
    { "id": "testSuite4", "results": {"passed": 10, "failed": 0, "skipped": 0, "timesec": 250} }
  ],
  "colors": {
    "passed": "GREEN",
    "failed": "RED",
    "skipped": "YELLOW"
  },
  "charts": [
    { "id": "chart1", "keys": ["passed", "failed", "skipped"]}
  ]
}

I suppose a useful other chart would map the id's of each item vs. timesec spent by each, so there would be a pie with 4 slices for this example, but wording that as a map may need some thinking.

Maybe if there is one entry in "keys" - iterate over "id" (or "name") of each "item" for the chart, e.g. to compare how many tests passed in each suite? This would be consistent with "Aktie/Rente" example from the README:

  "charts": [
    { "id": "chart2", "keys": ["passed"]},
    { "id": "chart3", "keys": ["timesec"]}
  ]

Yet another useful chart could be a run-time summary to compare the total amount of tests across suites (so treated as a single "keys" with a value calculated from a list of results columns for each item), somewhat like:

  "charts": [
    { "id": "chart4", "sum-of": ["passed", "failed", "skipped"]}
  ]

(this approach seems extensible to other predefined formulas named reasonably like sum-of is here).

Upstream changes

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementEnhancement of existing functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions