Repository navigation
fix(test): restore compilation of analytics integration tests - #1139
Merged
Merged
Conversation
golangci-lint v2 (#1137) now type-checks //go:build integration files, which exposed that internal/analytics' integration tests were written against a removed QueryRequest.AccountID API and the old single-string account signatures of QueryByProvider/QueryByService/QueryMonthlyTotals, so they had not compiled since the account-filter model changed. CI Lint on main is red as a result. Restore compilation: - dedup getMigrationsPath (keep the db_test.go copy; both files are package analytics_test) and drop its now-unused runtime/path/filepath imports - add an f64ptr helper and wrap the *float64 fields TotalUsage and CoveragePercentage - remap the removed QueryRequest.AccountID and the string-account args of QueryByProvider/QueryByService/QueryMonthlyTotals to the current AccountUUIDs/AccountExternalIDsByProvider model These tests run only under Docker/testcontainers; CI Lint just type-checks them. Runtime correctness of the remapped account filters is NOT verified here and is tracked in #1138. Refs #1138
Member
Author
|
@coderabbitai review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Restores compilation of the
internal/analyticsintegration tests so the Lint job (and the rest of CI) passes again. After #1137 merged, golangci-lint v2 type-checks//go:build integrationfiles; this exposed that these tests were written against a removedQueryRequest.AccountIDAPI and the old single-string account signatures ofQueryByProvider/QueryByService/QueryMonthlyTotals, so they had not compiled since the account-filter model changed. Main's Lint is currently red, which blocks every open PR from going green.Changes
getMigrationsPath(keep thedb_test.gocopy; both files arepackage analytics_test) and drop its now-unusedruntime/path/filepathimports.f64ptrhelper and wrap the*float64fieldsTotalUsageandCoveragePercentage.QueryRequest.AccountIDand the string-account args ofQueryByProvider/QueryByService/QueryMonthlyTotalsto the currentAccountUUIDs/AccountExternalIDsByProvidermodel.Scope / verification
go vet -tags=integration ./internal/analytics/-> cleango build ./...-> cleangofmt-> cleanThese tests run only under Docker/testcontainers (CI Lint just type-checks them). This PR restores compilation only - the runtime correctness of the remapped account filters is intentionally not verified here (the account-filter area has a documented history of silent breakage) and is tracked in LeanerCloud/cloud-commitments-platform#32.
Refs #1137, LeanerCloud/cloud-commitments-platform#32