Unit Tests #9
No reviewers
Labels
No Label
AdminAPI
Bug
Check AWS
CI
Correctness
Critical
Documentation
Ideas
Improvement
Low priority
Newcomer
Performance
S3 Compatibility
Testing
Usability
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Deuxfleurs/garage#9
Loading…
Reference in 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.