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

test(proto): add unit tests for LogStreamReplica #934

Merged
merged 5 commits into from
Feb 3, 2025

Conversation

ijsong
Copy link
Member

@ijsong ijsong commented Dec 11, 2024

What this PR does

  • Added proto/varlogpb/replica_test.go to test EqualReplicas and
    ValidReplicas functions.
  • Included various test cases to ensure correct functionality.

@ijsong ijsong requested a review from hungryjang as a code owner December 11, 2024 10:34
Copy link

codecov bot commented Dec 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.11%. Comparing base (2c3818a) to head (12997f3).
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #934      +/-   ##
==========================================
+ Coverage   79.08%   80.11%   +1.02%     
==========================================
  Files         180      179       -1     
  Lines       21615    21587      -28     
==========================================
+ Hits        17094    17294     +200     
+ Misses       3711     3510     -201     
+ Partials      810      783      -27     

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

@ijsong ijsong force-pushed the test_proto_add_and_update_tests_for_proto_varlogpb_metadata.go branch from faec5d6 to d43ca78 Compare December 13, 2024 01:53
@ijsong ijsong force-pushed the test_proto_add_unit_tests_for_logstreamreplica branch from ed796f3 to f953940 Compare December 13, 2024 01:53
@ijsong ijsong force-pushed the test_proto_add_and_update_tests_for_proto_varlogpb_metadata.go branch from d43ca78 to cd27630 Compare December 13, 2024 02:01
@ijsong ijsong force-pushed the test_proto_add_unit_tests_for_logstreamreplica branch from f953940 to 6e0ea77 Compare December 13, 2024 02:01
@ijsong ijsong force-pushed the test_proto_add_and_update_tests_for_proto_varlogpb_metadata.go branch from cd27630 to b59c8ad Compare January 16, 2025 04:19
@ijsong ijsong force-pushed the test_proto_add_unit_tests_for_logstreamreplica branch from 6e0ea77 to bcae3fc Compare January 16, 2025 04:19
@ijsong ijsong force-pushed the test_proto_add_and_update_tests_for_proto_varlogpb_metadata.go branch from b59c8ad to 7c6bd99 Compare February 3, 2025 10:57
@ijsong ijsong force-pushed the test_proto_add_unit_tests_for_logstreamreplica branch from bcae3fc to 8292f4a Compare February 3, 2025 10:58
- Add tests for StorageNodeMetadataDescriptor and LogStreamReplicaMetadataDescriptor
- Test methods: ToStorageNodeDescriptor, GetLogStream, Head, and Tail
- Ensure proper coverage for edge cases and nil values
- Add comments for SyncPosition.InvalidSyncPosition, SyncPosition.Invalid,
  SyncPosition.LessThan, SyncRange.InvalidSyncRange, and SyncRange.Validate
  methods.
- Add unit tests for SyncRange validation and invalid cases.
- replaced InvalidLogEntry with an empty LogEntry across the codebase
- removed proto/varlogpb/log_entry.go as it contained unused code
- updated related files to reflect these changes
- Removed unused functions from metadata.go
- Added comprehensive unit tests for metadata.go and metadata_test.go
- Improved test coverage for various scenarios
- Added `proto/varlogpb/replica_test.go` to test `EqualReplicas` and
  `ValidReplicas` functions.
- Included various test cases to ensure correct functionality.
@ijsong ijsong force-pushed the test_proto_add_and_update_tests_for_proto_varlogpb_metadata.go branch from 7c6bd99 to 40499c7 Compare February 3, 2025 11:24
@ijsong ijsong force-pushed the test_proto_add_unit_tests_for_logstreamreplica branch from 8292f4a to 12997f3 Compare February 3, 2025 11:24
@ijsong ijsong force-pushed the test_proto_add_and_update_tests_for_proto_varlogpb_metadata.go branch from 40499c7 to 8e7c04b Compare February 3, 2025 11:47
Base automatically changed from test_proto_add_and_update_tests_for_proto_varlogpb_metadata.go to main February 3, 2025 12:05
@ijsong ijsong merged commit d997fbc into main Feb 3, 2025
10 checks passed
@ijsong ijsong deleted the test_proto_add_unit_tests_for_logstreamreplica branch February 3, 2025 12:06
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.

None yet

2 participants