Go SDK: add unit tests for ClusterNodeStatus
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 86/100
Research direction
Read TryFrom, MarshalBinary, UnmarshalBinary and String in foreign/go/contracts/node_status.go, then copy the structure of compression_algorithm_test.go in the same folder. Create foreign/go/contracts/node_status_test.go in package iggcon with a table test over bytes 0 to 5 and 255, round trips for the valid statuses, and checks that an empty slice and byte 5 are rejected. Done when go test ./contracts/... and go vet ./... pass in foreign/go.
Written by the indexing model from the issue text.
Description
Description
TryFrom, MarshalBinary, UnmarshalBinary and String in foreign/go/contracts/node_status.go have no test of their own. TryFrom accepts 0 to 4 (healthy, starting, stopping, unreachable, maintenance) and returns ierror.ErrInvalidCommand for anything else. That includes 5, the Unknown constant, which can be used in code but is not accepted off the wire. String returns a lowercase name for each valid status and unknown otherwise.
Affected area / component
Go SDK
Proposed solution
Add foreign/go/contracts/node_status_test.go in package iggcon, modelled on compression_algorithm_test.go in the same folder.
- A table test over bytes 0 to 5 and 255 for
TryFrom, checking the value or the error. - A round trip for each valid status through
MarshalBinaryandUnmarshalBinary. - Check that an empty slice and byte 5 are rejected by
UnmarshalBinary. - Check each
Stringoutput, includingunknown.
How to test: go test ./contracts/... and go vet ./... pass in foreign/go.
Good first issue
- I think this could be a good first issue for a new contributor
- Dominant language
- Rust
- Stars
- 5.3k
- Forks
- 548
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 194
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/iggy
-
go good first issue test
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 2 days
-
go good first issue test
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 2 days
-
good first issue java test
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 2 days
-
good first issue javascript test
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 2 days
-
good first issue javascript test
Difficulty 2/5 Half a day Newbie friendliness 85/100
Maintainers usually reply within 2 days
Similar issues
-
bug triaged tui ux wontfix
Difficulty 2/5 Half a day Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
bevyengine/bevy#26642 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day