Skip to content

Conversation

@mwbrooks
Copy link
Member

Summary

Related #315 and #316

This pull request updates our existing Table Tests using the Slice Pattern to the Map Pattern.

While the Slice Pattern is the chosen format in Golang documentation and many Golang projects, we prefer the Map Pattern for the following reasons:

  • Map order is not guaranteed, so the tests are randomized each run. This prevents state from carrying over into the next tests, but can make debugging tests more difficult.
  • Test Case names are displayed on a single line improving readability

There is wrong answer (as far as we know), but we're going with maps for readability and reliability.

Reviewers

This only updates the simple use-cases in order to keep the PR an easy read. We have 47 remaining Table Tests using the Slice Pattern that will need to be handled later. Over half should be on the low-to-medium risk.

Requirements

@mwbrooks mwbrooks added this to the Next Release milestone Jan 31, 2026
@mwbrooks mwbrooks self-assigned this Jan 31, 2026
@mwbrooks mwbrooks requested a review from a team as a code owner January 31, 2026 05:59
@mwbrooks mwbrooks added code health M-T: Test improvements and anything that improves code health semver:patch Use on pull requests to describe the release version increment labels Jan 31, 2026
@codecov
Copy link

codecov bot commented Jan 31, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.61%. Comparing base (66766a9) to head (7a210a8).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #320      +/-   ##
==========================================
+ Coverage   64.59%   64.61%   +0.02%     
==========================================
  Files         212      212              
  Lines       17755    17755              
==========================================
+ Hits        11469    11473       +4     
+ Misses       5210     5206       -4     
  Partials     1076     1076              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mwbrooks mwbrooks changed the title refactor(tests): update slice pattern table tests to map pattern (only low risk tests) refactor(tests): update slice pattern table tests to map pattern (low risk tests) Jan 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code health M-T: Test improvements and anything that improves code health semver:patch Use on pull requests to describe the release version increment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants