This repository has been archived by the owner on Oct 23, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 163
test: common fs and mem pinstore tests #360
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this is implemented using a blockstore alike sharding implementation. for recursive pins, a json Vec<String> is stored and used mostly linearly (eh, something to improve). for direct pins, empty files are used. the pin files have different file extensions. lets see if this works in windows as well.
this allows using the owned permit and more importantly moving it to the threadpool thread, which is not necessarily bound to the task lifetime. there is just one permit per datastore at the moment, but making this per cid for example shouldn't be too difficult. having a global lock will be needed later on, not sure how to implement it though.
358: feat: fs pinstore r=aphelionz a=koivunej Adds filesystem based pin store. See adec0a8 for TL;DR. Builds upon rs-ipfs#357. Only last N commits are new after including 159a1c5. Even windows seems ok. base32lower is used to encode the cid names. TODO: - [x] at least the tests written for ipfs::repo::mem but will post another PR The differences to other impls are not explained as I am not sure if I am up to date with the other implementations. Co-authored-by: Joonas Koivunen <joonas@equilibrium.co>
my first attempt with macro generated tests: lots of quite confusing to debug compiler errors but the final outcome looks ok.
koivunej
force-pushed
the
align_fs_and_mem_pinstore_tests
branch
from
September 4, 2020 15:30
11ab6dc
to
2b82d88
Compare
aphelionz
approved these changes
Sep 4, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bors r+
Build succeeded: |
Closed
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Continues the long chain of pin PRs from #358. Refactors the previously custom tempdir hack and system polluting repo tests into a macro based which can be re-generated for each datastore implementation. Of course this revealed issues on both fs and mem pinstores but they were more about me not understanding the rules before three implementations :) Lets fix later if we find out more inconsistencies.
The macro approach is the only one I can see, looks pretty bad and if there are errors those will be even uglier.