Skip to content

[Add] --add-status-column flag for an aggregated, colour-coded outcome column#10

Merged
samatstariongroup merged 1 commit intoSTARIONGROUP:developmentfrom
fabiantax:feature/status-column
Apr 24, 2026
Merged

[Add] --add-status-column flag for an aggregated, colour-coded outcome column#10
samatstariongroup merged 1 commit intoSTARIONGROUP:developmentfrom
fabiantax:feature/status-column

Conversation

@fabiantax
Copy link
Copy Markdown
Contributor

Summary

Adds a --add-status-column (-st) CLI flag to the spreadsheet report. When enabled, vcdg appends a STATUS column with one of:

Cell Condition Background
(empty) No test cases — uncovered (default state) none
Passed Every test case has Result == \"Passed\" light green (#C6EFCE)
Failed Any test case has Result == \"Failed\" (failures dominate) light red (#FFC7CE)
Mixed At least one Passed and at least one non-Passed non-Failed light orange (#FFEB9C)
Inconclusive No Passed and no Failed (only Skipped/Inconclusive) light grey (#D9D9D9)

Why

Today the TESTCASES column embeds outcome as free text (\"Foo - Passed\\nBar - Failed\"), which makes filtering "show me what's not green" awkward. A dedicated STATUS column with a colour fill turns the report into a one-glance status dashboard.

This is a strictly additive change — --add-status-column defaults to false so existing CLI invocations and downstream consumers (parsers, dashboards) see no schema change.

What changed

  • IReportGenerator.Generate — appended optional bool addStatusColumn = false. Source-compatible with all current callers.
  • ReportGenerator.GenerateSpreadsheetReport — when the flag is set, appends a STATUS column to the DataTable, and after InsertTable walks the new column to apply the per-status background fill.
  • ReportGenerator.DeriveStatus(Requirement) — new public static helper that exposes the aggregation rule so external consumers can reuse it.
  • GenerateCommand — registers --add-status-column / -st and forwards to the handler.
  • Tests — five new tests cover every branch of DeriveStatus, plus a smoke test for the spreadsheet path with the flag enabled. The existing Moq Verify(... Generate(...)) was updated to the new four-parameter signature.

Validation

  • dotnet test19 passed, 0 failed (was 13 passed; +6 new).

Notes

  • Colours match Excel's built-in "Good/Bad/Neutral" palette so they render cleanly under default themes.
  • I wired the same logic locally (in the EMS repo's PowerShell post-processor) before opening this PR — the in-repo workaround is documented in a decision record (private link). Once this lands and a release ships, that workaround goes away.

@sonarqubecloud
Copy link
Copy Markdown

…e column

Adds a `--add-status-column` (`-st`) flag to the spreadsheet report. When
enabled, vcdg appends a `STATUS` column with one of:

  (empty)        no test cases       — uncovered, default state
  Passed         all test cases pass — green cell
  Failed         any test case fails — red cell
  Mixed          some Passed + some non-Passed non-Failed — orange
  Inconclusive   no Passed and no Failed (only Skipped/Inconclusive) — grey

Backwards compatible: the flag defaults to `false`, so existing CLI
invocations and downstream consumers see no schema change. The status
aggregation rule is exposed as a static helper (`ReportGenerator.DeriveStatus`)
so callers that build their own reports can reuse it.

Aggregation tests cover all five branches; the existing `Verify_..._Generate`
mock is updated to match the new four-parameter signature.

Motivation: today the TESTCASES column embeds outcome as free text
("Foo - Passed\nBar - Failed"), which makes filtering "show me what's
not green" awkward. A dedicated Status column with a colour fill is a
single-line CLI flip that turns the report into a one-glance status
dashboard.
@fabiantax fabiantax force-pushed the feature/status-column branch from a166119 to 2ff5e0d Compare April 24, 2026 09:51
@fabiantax fabiantax marked this pull request as ready for review April 24, 2026 09:53
@samatstariongroup samatstariongroup merged commit 1a2ff89 into STARIONGROUP:development Apr 24, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants