Skip to content

refactor(tests): convert the higher risk slice-to-map table tests#324

Merged
mwbrooks merged 14 commits intomainfrom
mwbrooks-table-test-consistent-p7-high-risk
Feb 4, 2026
Merged

refactor(tests): convert the higher risk slice-to-map table tests#324
mwbrooks merged 14 commits intomainfrom
mwbrooks-table-test-consistent-p7-high-risk

Conversation

@mwbrooks
Copy link
Member

Summary

Related to #315, #316, #320, #321, #322, #323

This pull request refactors the remaining higher risk Table Tests from the Slice-to-Map Pattern. It's focused on tests with OS mocks, HTTP mocks, and nested logic.

Reviewers

This is the last one! Congrats, you've reached the end of the Slice-to-Map Conversion Book 📚

Requirements

@mwbrooks mwbrooks added this to the Next Release milestone Jan 31, 2026
@mwbrooks mwbrooks self-assigned this Jan 31, 2026
@mwbrooks mwbrooks added docs M-T: Documentation work only 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.65%. Comparing base (ca9db20) to head (856b3c6).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #324      +/-   ##
==========================================
- Coverage   64.66%   64.65%   -0.02%     
==========================================
  Files         212      212              
  Lines       17771    17771              
==========================================
- Hits        11492    11489       -3     
- Misses       5204     5205       +1     
- Partials     1075     1077       +2     

☔ 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.

Comment on lines +461 to +462
`Standalone workspace, AAA is requested \
(workspace ID passed into apps.approvals.requests.create)`: {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: This naming convention is a little strange, but I decided to keep it 1-to-1 with current implementation.

if len(deployedApps) == 0 {
require.ErrorIs(t, err, os.ErrNotExist, "apps.json was not deleted")
} else {
for name, tc := range tests {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: This ---/+++ looks scary, but it's just fixing this test by wrapping each iteration in a t.Run function.

Base automatically changed from mwbrooks-table-test-consistent-p6-medium-high-risk to main February 4, 2026 23:32
@mwbrooks mwbrooks marked this pull request as ready for review February 4, 2026 23:45
@mwbrooks mwbrooks requested a review from a team as a code owner February 4, 2026 23:45
Copy link
Member

@zimeg zimeg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mwbrooks This has been such an impressive changeset of refactors to brings tests to a new and better level. Huge thanks for these efforts! 🏆 ✨

@mwbrooks
Copy link
Member Author

mwbrooks commented Feb 4, 2026

Thanks a bunch and appreciate the reviews! They're dry reads but now we have some consistent test formats to use going forward! 🙇🏻

@mwbrooks mwbrooks merged commit 3cc0305 into main Feb 4, 2026
8 checks passed
@mwbrooks mwbrooks deleted the mwbrooks-table-test-consistent-p7-high-risk branch February 4, 2026 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs M-T: Documentation work only 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