Skip to content
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

fix(varlogtest): validate log stream descriptor to create it #593

Merged
merged 1 commit into from
Oct 4, 2023

Conversation

ijsong
Copy link
Member

@ijsong ijsong commented Sep 25, 2023

What this PR does

This PR adds a validator to the AddLogStream API in the varlogtest.
Especially the validator checks the replicas requested. For example, if they
have duplicate storage nodes, their length is less than the replication factor,
or they have unknown storage nodes.

Although the real varlogadm server's AddLogStream API is tested, the same thing
in the varlogtest package has not been tested, surprisingly. To fix it, all the
implementations in the internal/admin and pkg/varlogtest have to use the
same test suite. However, it will lead to a quite big refactoring. Therefore,
this PR fixes the bug and adds some unit tests in the varlogtest package.

Later we will revisit it to resolve #592.

@ijsong ijsong force-pushed the varlogtest_create_new_instance branch from 2b31e74 to e1216ab Compare September 25, 2023 14:38
@ijsong ijsong force-pushed the varlogtest_add_logstream branch from ddaf338 to 2867ea4 Compare September 25, 2023 14:38
@ijsong ijsong force-pushed the varlogtest_create_new_instance branch from e1216ab to 2c98f7f Compare September 26, 2023 11:59
This PR adds a validator to the AddLogStream API in the varlogtest.
Especially the validator checks the replicas requested. For example, if they have duplicate storage
nodes, their length is less than the replication factor, or they have unknown storage nodes.

Although the real varlogadm server's AddLogStream API is tested, the same thing in the varlogtest
package has not been tested, surprisingly. To fix it, all the implementations in the
`internal/admin` and `pkg/varlogtest` have to use the same test suite. However, it will lead to a
quite big refactoring. Therefore, this PR fixes the bug and adds some unit tests in the varlogtest
package.

Later we will revisit it to resolve #592.
@ijsong ijsong force-pushed the varlogtest_add_logstream branch from 2867ea4 to 73d6a91 Compare September 26, 2023 12:57
@codecov-commenter
Copy link

Codecov Report

Attention: 26 lines in your changes are missing coverage. Please review.

Comparison is base (2c98f7f) 61.19% compared to head (73d6a91) 61.14%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@                        Coverage Diff                         @@
##           varlogtest_create_new_instance     #593      +/-   ##
==================================================================
- Coverage                           61.19%   61.14%   -0.05%     
==================================================================
  Files                                 144      144              
  Lines                               19182    19217      +35     
==================================================================
+ Hits                                11739    11751      +12     
- Misses                               6858     6881      +23     
  Partials                              585      585              
Files Coverage Δ
pkg/varlogtest/admin.go 47.88% <100.00%> (+2.56%) ⬆️
proto/varlogpb/metadata.go 1.52% <0.00%> (-0.11%) ⬇️

... and 4 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ijsong
Copy link
Member Author

ijsong commented Oct 4, 2023

Merge Activity

  • Oct 4, 3:30 AM: @ijsong started a stack merge that includes this pull request via Graphite.
  • Oct 4, 3:32 AM: @ijsong merged this pull request with Graphite.

Base automatically changed from varlogtest_create_new_instance to main October 4, 2023 07:32
@ijsong ijsong merged commit 27cd3bb into main Oct 4, 2023
@ijsong ijsong deleted the varlogtest_add_logstream branch October 4, 2023 07:32
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.

varlogtest: rich-featured toolkit for testing the Varlog
2 participants