abctl: the casefold breakdown test's second assertion is unreachable on its own fixture
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 86/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- go
- Domain
- cli, testing-qa
Research direction
Read cmd/abctl/cmd_cost_test.go and inspect TestRunCost_ByCurrencyMatchesAUnitSpelledADifferentWay, especially its one-entry Credits fixture and both assertions. Confirm which assertion is unreachable, then make the test's single claim legible by either adding a genuinely mixed fixture or removing the dead assertion; the test should accurately cover the casefold behavior without implying an untested path.
Written by the indexing model from the issue text.
Description
Found by the round-3 strict review of #1153, in a test that PR's round 2 added.
cmd/abctl/cmd_cost_test.go, TestRunCost_ByCurrencyMatchesAUnitSpelledADifferentWay:
if strings.Contains(row, mixedCostCell) {
t.Errorf("a real configured unit was withheld as unrecognised:\n%s", row)
}
The fixture carries "currencies":["Credits"] — one entry — so windowUnit returns labelled=true and writeCostBreakdown's default: cost = mixedCostCell arm is unreachable for a priced row. The assertion cannot fire on this input, and its stated reason ("withheld as unrecognised") describes a path the fixture does not reach.
The test's first assertion is live and does pin the property that matters (a unit spelled differently from the reported set keeps its label, i.e. isReportedUnit folds case). Only the negative twin is dead.
Fix is either a second fixture whose window is genuinely mixed, or dropping the assertion and saying in the comment that the single-unit fixture cannot produce (mixed). Prefer whichever keeps the test's one claim legible.
Assisted-By: Claude (Anthropic AI) [email protected]
- Dominant language
- Go
- Stars
- 13
- Forks
- 40
- Avg merge
- 11h 31m
- Merged PRs (30d)
- 204
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rossoctl/cortex
-
feedback laptop
Difficulty 1/5 Under an hour Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
documentation
Difficulty 1/5 Under an hour Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
status: ready for dev
Difficulty 1/5 1-3 hours Newbie friendliness 92/100
hyperledger-labs/fabric-smart-client#2004 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
apache/datasketches-go#189 ·
Maintainers usually reply within 1 day