-
Notifications
You must be signed in to change notification settings - Fork 0
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
Get cognitarium
address on new dataverse
client
#18
Conversation
WalkthroughThe changes involve the introduction of mock generation commands in the Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant DataverseClient
participant Proxy
participant MockClient
Client->>DataverseClient: NewDataverseClient()
activate DataverseClient
DataverseClient-->>Client: Return Client instance
deactivate DataverseClient
Client->>Proxy: Read()
activate Proxy
Proxy->>DataverseClient: GetResourceGovAddr()
activate DataverseClient
DataverseClient-->>Proxy: Return resource address
deactivate DataverseClient
Proxy-->>Client: Return data
deactivate Proxy
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
Codecov ReportAttention: Patch coverage is
|
cognitarium
address on new dataverse
client
02c6d05
to
9b2e1e3
Compare
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.
Actionable comments posted: 4
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (2)
go.mod
is excluded by!**/*.mod
go.sum
is excluded by!**/*.sum
,!**/*.sum
Files selected for processing (7)
- Makefile (1 hunks)
- dataverse/client.go (1 hunks)
- dataverse/client_test.go (1 hunks)
- provider/storage/proxy.go (2 hunks)
- testutil/cognitarium_client_mocks.go (1 hunks)
- testutil/dataverse_client_mocks.go (1 hunks)
- testutil/dataverse_mocks.go (1 hunks)
Additional context used
GitHub Check: codecov/patch
dataverse/client.go
[warning] 36-39: dataverse/client.go#L36-L39
Added lines #L36 - L39 were not covered by tests
[warning] 42-42: dataverse/client.go#L42
Added line #L42 was not covered by tests
[warning] 45-46: dataverse/client.go#L45-L46
Added lines #L45 - L46 were not covered by tests
[warning] 49-50: dataverse/client.go#L49-L50
Added lines #L49 - L50 were not covered by teststestutil/dataverse_mocks.go
[warning] 58-58: testutil/dataverse_mocks.go#L58
Added line #L58 was not covered by tests
[warning] 60-60: testutil/dataverse_mocks.go#L60
Added line #L60 was not covered by tests
[warning] 67-67: testutil/dataverse_mocks.go#L67
Added line #L67 was not covered by tests
[warning] 69-69: testutil/dataverse_mocks.go#L69
Added line #L69 was not covered by testsprovider/storage/proxy.go
[warning] 41-41: provider/storage/proxy.go#L41
Added line #L41 was not covered by tests
[warning] 66-66: provider/storage/proxy.go#L66
Added line #L66 was not covered by teststestutil/dataverse_client_mocks.go
[warning] 33-36: testutil/dataverse_client_mocks.go#L33-L36
Added lines #L33 - L36 were not covered by tests
[warning] 40-41: testutil/dataverse_client_mocks.go#L40-L41
Added lines #L40 - L41 were not covered by tests
[warning] 45-49: testutil/dataverse_client_mocks.go#L45-L49
Added lines #L45 - L49 were not covered by tests
[warning] 51-54: testutil/dataverse_client_mocks.go#L51-L54
Added lines #L51 - L54 were not covered by tests
[warning] 58-61: testutil/dataverse_client_mocks.go#L58-L61
Added lines #L58 - L61 were not covered by teststestutil/cognitarium_client_mocks.go
[warning] 33-36: testutil/cognitarium_client_mocks.go#L33-L36
Added lines #L33 - L36 were not covered by tests
[warning] 40-41: testutil/cognitarium_client_mocks.go#L40-L41
Added lines #L40 - L41 were not covered by tests
[warning] 45-49: testutil/cognitarium_client_mocks.go#L45-L49
Added lines #L45 - L49 were not covered by tests
[warning] 51-54: testutil/cognitarium_client_mocks.go#L51-L54
Added lines #L51 - L54 were not covered by tests
[warning] 58-61: testutil/cognitarium_client_mocks.go#L58-L61
Added lines #L58 - L61 were not covered by tests
[warning] 65-69: testutil/cognitarium_client_mocks.go#L65-L69
Added lines #L65 - L69 were not covered by tests
[warning] 71-74: testutil/cognitarium_client_mocks.go#L71-L74
Added lines #L71 - L74 were not covered by tests
[warning] 78-81: testutil/cognitarium_client_mocks.go#L78-L81
Added lines #L78 - L81 were not covered by tests
[warning] 85-89: testutil/cognitarium_client_mocks.go#L85-L89
Added lines #L85 - L89 were not covered by tests
[warning] 91-94: testutil/cognitarium_client_mocks.go#L91-L94
Added lines #L91 - L94 were not covered by tests
[warning] 98-101: testutil/cognitarium_client_mocks.go#L98-L101
Added lines #L98 - L101 were not covered by tests
[warning] 105-109: testutil/cognitarium_client_mocks.go#L105-L109
Added lines #L105 - L109 were not covered by tests
[warning] 111-114: testutil/cognitarium_client_mocks.go#L111-L114
Added lines #L111 - L114 were not covered by tests
[warning] 118-121: testutil/cognitarium_client_mocks.go#L118-L121
Added lines #L118 - L121 were not covered by tests
Additional comments not posted (21)
dataverse/client.go (5)
3-9
: LGTM!The import statements are correct and necessary for the functionality.
The code changes are approved.
12-14
: LGTM!The renaming of the method
GetGovAddr
toGetResourceGovAddr
improves clarity and aligns with the new resource management context.The code changes are approved.
16-19
: LGTM!The
client
struct is correctly defined to hold necessary client information.The code changes are approved.
21-31
: LGTM!The
NewDataverseClient
function is correctly implemented and handles errors appropriately.The code changes are approved.
53-61
: LGTM!The
getCognitariumAddr
function is correctly implemented and handles errors appropriately.The code changes are approved.
dataverse/client_test.go (3)
3-13
: LGTM!The import statements are correct and necessary for the functionality.
The code changes are approved.
15-34
: LGTM!The test cases for
NewDataverseClient
are well-defined and cover the necessary scenarios.The code changes are approved.
36-68
: LGTM!The test implementation for
NewDataverseClient
is correct and verifies the necessary scenarios.The code changes are approved.
provider/storage/proxy.go (2)
41-41
: LGTM! But add a test for the new line.The change improves the specificity of the governance address retrieval process. However, the new line is not covered by tests.
Consider adding a test to cover this line.
Tools
GitHub Check: codecov/patch
[warning] 41-41: provider/storage/proxy.go#L41
Added line #L41 was not covered by tests
66-66
: LGTM! But add a test for the new line.The change improves the specificity of the governance address retrieval process. However, the new line is not covered by tests.
Consider adding a test to cover this line.
Tools
GitHub Check: codecov/patch
[warning] 66-66: provider/storage/proxy.go#L66
Added line #L66 was not covered by teststestutil/dataverse_client_mocks.go (4)
33-36
: LGTM! But add a test for the function.The function is correctly implemented, but it is not covered by tests.
Consider adding a test to cover this function.
Tools
GitHub Check: codecov/patch
[warning] 33-36: testutil/dataverse_client_mocks.go#L33-L36
Added lines #L33 - L36 were not covered by tests
40-41
: LGTM! But add a test for the function.The function is correctly implemented, but it is not covered by tests.
Consider adding a test to cover this function.
Tools
GitHub Check: codecov/patch
[warning] 40-41: testutil/dataverse_client_mocks.go#L40-L41
Added lines #L40 - L41 were not covered by tests
45-49
: LGTM! But add a test for the method.The method is correctly implemented, but it is not covered by tests.
Consider adding a test to cover this method.
Also applies to: 51-54
Tools
GitHub Check: codecov/patch
[warning] 45-49: testutil/dataverse_client_mocks.go#L45-L49
Added lines #L45 - L49 were not covered by tests
58-61
: LGTM! But add a test for the method recorder.The method recorder is correctly implemented, but it is not covered by tests.
Consider adding a test to cover this method recorder.
Tools
GitHub Check: codecov/patch
[warning] 58-61: testutil/dataverse_client_mocks.go#L58-L61
Added lines #L58 - L61 were not covered by testsMakefile (2)
82-82
: LGTM!The command is correctly implemented and enhances the testing capabilities.
The code changes are approved.
83-83
: LGTM!The command is correctly implemented and enhances the testing capabilities.
The code changes are approved.
testutil/cognitarium_client_mocks.go (5)
1-11
: LGTM!The file header comments and package declaration are appropriate for an auto-generated file.
The code changes are approved.
12-19
: LGTM!The import statements include necessary packages for context handling, reflection, schema definitions, and mocking utilities.
The code changes are approved.
21-30
: LGTM!The mock struct definitions follow the standard pattern for GoMock-generated code.
The code changes are approved.
32-42
: LGTM!The mock constructor and
EXPECT
method follow the standard pattern for GoMock-generated code.The code changes are approved.
Tools
GitHub Check: codecov/patch
[warning] 33-36: testutil/cognitarium_client_mocks.go#L33-L36
Added lines #L33 - L36 were not covered by tests
[warning] 40-41: testutil/cognitarium_client_mocks.go#L40-L41
Added lines #L40 - L41 were not covered by tests
44-122
: LGTM!The mock methods for
Construct
,Describe
,Select
, andStore
follow the standard pattern for GoMock-generated code. Note that the lack of test coverage is expected for auto-generated code.The code changes are approved.
Tools
GitHub Check: codecov/patch
[warning] 45-49: testutil/cognitarium_client_mocks.go#L45-L49
Added lines #L45 - L49 were not covered by tests
[warning] 51-54: testutil/cognitarium_client_mocks.go#L51-L54
Added lines #L51 - L54 were not covered by tests
[warning] 58-61: testutil/cognitarium_client_mocks.go#L58-L61
Added lines #L58 - L61 were not covered by tests
[warning] 65-69: testutil/cognitarium_client_mocks.go#L65-L69
Added lines #L65 - L69 were not covered by tests
[warning] 71-74: testutil/cognitarium_client_mocks.go#L71-L74
Added lines #L71 - L74 were not covered by tests
[warning] 78-81: testutil/cognitarium_client_mocks.go#L78-L81
Added lines #L78 - L81 were not covered by tests
[warning] 85-89: testutil/cognitarium_client_mocks.go#L85-L89
Added lines #L85 - L89 were not covered by tests
[warning] 91-94: testutil/cognitarium_client_mocks.go#L91-L94
Added lines #L91 - L94 were not covered by tests
[warning] 98-101: testutil/cognitarium_client_mocks.go#L98-L101
Added lines #L98 - L101 were not covered by tests
[warning] 105-109: testutil/cognitarium_client_mocks.go#L105-L109
Added lines #L105 - L109 were not covered by tests
[warning] 111-114: testutil/cognitarium_client_mocks.go#L111-L114
Added lines #L111 - L114 were not covered by tests
[warning] 118-121: testutil/cognitarium_client_mocks.go#L118-L121
Added lines #L118 - L121 were not covered by tests
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.
Great :)
Thanks for maintaining the mocks, we gain in testability 💪
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.
Great 👍
First PR that initiate the dataverse client by requesting cognitarium address on dataverse contract and return a new Client. Including mock of dataverse client generated by
axone-contract-schema
.