Unit Tests #9
No reviewers
Labels
No labels
action
check-aws
action
discussion-needed
action
for-external-contributors
action
for-newcomers
action
more-info-needed
action
need-funding
action
triage-required
kind
correctness
kind
ideas
kind
improvement
kind
performance
kind
testing
kind
usability
kind
wrong-behavior
prio
critical
prio
low
scope
admin-api
scope
background-healing
scope
build
scope
documentation
scope
k8s
scope
layout
scope
metadata
scope
ops
scope
rpc
scope
s3-api
scope
security
scope
telemetry
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Deuxfleurs/garage#9
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/unit-tests"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
There are (at least) 3 class of tests in Rust:
When reading the code, I wanted to really understand how
parse_bucket_key
works and it appears that tests are really great at explaining such things.Ideally, I wanted to write a documentation tests, to explain at the same time with a natural language how it works. However it appears that documentation tests can not easily be used with private functions, which explains why I fell back to unit tests.
I don't know how we want to work: merge unit tests one by one or in a batch? With or without PR?
So let's start the discussion here!
It's probably better to do a PR so that I can check that the test is correct. If you're done writing tests for now, don't wait to make a PR. If you're writing a series of tests for a bunch of functions in the same module, make a single PR for them.
WIP: Unit Teststo Unit TestsDone for today, I added a second test, you can merge.
What is the point of returning a result in this function as there is no way this function can fail?
Because there is a bug. The function should fail if bucket is the empty string.