-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
201 testing implement mock interfaces for external dependencies #204
201 testing implement mock interfaces for external dependencies #204
Conversation
- Added `github.com/stretchr/testify` for improved testing capabilities. - Added indirect dependencies: `github.com/davecgh/go-spew`, `github.com/pmezard/go-difflib`, `github.com/stretchr/objx`, and `gopkg.in/yaml.v3`. - Updated `go.mod` and `go.sum` to reflect these changes. - Modified `setting.go` to ensure environment loading functionality. - Enhanced tests in `document_test.go` to utilize the new `testify` assertions and improved structure for CRUD operations. - Refactored `document.go` to support context in database operations and introduced caching strategies. This commit enhances the testing framework and improves the overall structure of the codebase.
- Upgraded Go version from 1.22.8 to 1.23.5. - Updated various dependencies including: - `agones.dev/agones` to v1.46.0 - `firebase.google.com/go/v4` to v4.15.1 - `github.com/ThreeDotsLabs/watermill` to v1.4.4 - `github.com/aws/aws-sdk-go-v2` to v1.33.0 and related modules - `google.golang.org/api` to v0.217.0 - Enhanced README documentation for clarity and consistency. - Minor formatting improvements in README_CN.md. This commit ensures the project is using the latest dependencies and improves the overall documentation for better understanding.
- Introduced a detailed architecture layers diagram in both README.md and README_CN.md. - The diagram illustrates the various layers of the application, including Application, Server, Middleware, Storage, and Integration layers. - Enhanced documentation clarity by visually representing the relationships between components. This update improves the understanding of the project's structure and components for developers.
…ternal-dependencies
"github.com/gstones/moke-kit/orm/nosql/mock/internal" | ||
) | ||
|
||
func NewMockDriverProvider( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint-pr-review] reported by reviewdog 🐶
exported function NewMockDriverProvider should have comment or be unexported
"github.com/gstones/moke-kit/orm/nosql/noptions" | ||
) | ||
|
||
type MockCollection struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint-pr-review] reported by reviewdog 🐶
exported type MockCollection should have comment or be unexported
version noptions.Version | ||
} | ||
|
||
func NewMockCollection(name string) *MockCollection { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint-pr-review] reported by reviewdog 🐶
exported function NewMockCollection should have comment or be unexported
return mc | ||
} | ||
|
||
func (m *MockCollection) GetName() string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint-pr-review] reported by reviewdog 🐶
exported method MockCollection.GetName should have comment or be unexported
return r0 | ||
} | ||
|
||
func (m *MockCollection) Set(ctx context.Context, key key.Key, opts ...noptions.Option) (noptions.Version, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint-pr-review] reported by reviewdog 🐶
exported method MockCollection.Set should have comment or be unexported
return r0 | ||
} | ||
|
||
func (m *MockCollection) Incr(ctx context.Context, key key.Key, field string, amount int32) (int64, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint-pr-review] reported by reviewdog 🐶
exported method MockCollection.Incr should have comment or be unexported
"github.com/gstones/moke-kit/orm/nosql/diface" | ||
) | ||
|
||
type MockDriverProvider struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint-pr-review] reported by reviewdog 🐶
exported type MockDriverProvider should have comment or be unexported
logger *zap.Logger | ||
} | ||
|
||
func (dp *MockDriverProvider) Shutdown() error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint-pr-review] reported by reviewdog 🐶
exported method MockDriverProvider.Shutdown should have comment or be unexported
return nil | ||
} | ||
|
||
func (dp *MockDriverProvider) OpenDbDriver(name string) (diface.ICollection, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint-pr-review] reported by reviewdog 🐶
exported method MockDriverProvider.OpenDbDriver should have comment or be unexported
return mc, nil | ||
} | ||
|
||
func NewMockDriverProvider( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint-pr-review] reported by reviewdog 🐶
exported function NewMockDriverProvider should have comment or be unexported
return nerrors.ErrTooManyRetries | ||
if err := u(); err == nil { | ||
return nil | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[golint-pr-review] reported by reviewdog 🐶
if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary)
No description provided.