Skip to content

use more modern test assertions in some places#825

Merged
wagnerd3 merged 5 commits intomasterfrom
test-refactoring
Jan 29, 2026
Merged

use more modern test assertions in some places#825
wagnerd3 merged 5 commits intomasterfrom
test-refactoring

Conversation

@majewsky
Copy link
Contributor

I looked at every t.Fatal(f) and t.Error(f) to check if we can replace those with more appropriate assertions from go-bits/assert or go-bits/must. There are probably other places where those functions could be used, but I decided to limit myself to however much I could get done before the end of the day.

@majewsky majewsky requested a review from a team as a code owner January 28, 2026 16:15
@github-actions
Copy link

Merging this branch will increase overall coverage

Impacted Packages Coverage Δ 🤖
github.com/sapcc/limes/internal/api 78.07% (ø)
github.com/sapcc/limes/internal/collector 82.40% (ø)
github.com/sapcc/limes/internal/core 78.35% (ø)
github.com/sapcc/limes/internal/datamodel 85.92% (ø)
github.com/sapcc/limes/internal/test 92.07% (+1.96%) 👍
github.com/sapcc/limes/internal/util 83.52% (ø)

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/sapcc/limes/internal/test/setup.go 91.87% (+2.56%) 738 (-48) 678 (-24) 60 (-24) 👍

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • github.com/sapcc/limes/internal/api/api_test.go
  • github.com/sapcc/limes/internal/api/commitment_test.go
  • github.com/sapcc/limes/internal/collector/capacity_scrape_test.go
  • github.com/sapcc/limes/internal/collector/commitment_cleanup_test.go
  • github.com/sapcc/limes/internal/collector/consistency_test.go
  • github.com/sapcc/limes/internal/collector/expiring_commitments_test.go
  • github.com/sapcc/limes/internal/collector/keystone_test.go
  • github.com/sapcc/limes/internal/collector/mail_delivery_test.go
  • github.com/sapcc/limes/internal/collector/quota_overrides_test.go
  • github.com/sapcc/limes/internal/collector/scrape_test.go
  • github.com/sapcc/limes/internal/core/config_test.go
  • github.com/sapcc/limes/internal/datamodel/allocation_stats_test.go
  • github.com/sapcc/limes/internal/datamodel/apply_computed_project_quota_test.go
  • github.com/sapcc/limes/internal/datamodel/quota_overrides_test.go
  • github.com/sapcc/limes/internal/util/timeseries_test.go

@wagnerd3 wagnerd3 merged commit 2ebc4d0 into master Jan 29, 2026
6 checks passed
@wagnerd3 wagnerd3 deleted the test-refactoring branch January 29, 2026 07:51
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.

3 participants