Skip to content

Conversation

@johnf
Copy link

@johnf johnf commented Jun 2, 2023

No description provided.

johnf added 17 commits May 27, 2023 15:58
stat was only used by exists. Exists makes more sense in an S3 context
and stat doesn't.
Due to the way S3 works you need to await that the stream is completed
and then also await the S3 API call as it users multipart uploads and
needs to finalise things before it's done.
We pass a storeConfig and helper to the tests.

The storeConfig is because for S3 we use local S3 server when testing so
we need to pass in an s3 object to the tests (similar to the fs object
than can be used for the filesystem backing).

We also pass a helper in to the tests. This helper has one method right
now getFile. It is used to get raw objects from the repository. The
current tests assume a filesystem so the helper allows the tests to
fetch from whatever the backend store happens to be.
On S3 it comes back as a buffer.
From what I can tell this logic was the wrong way around. I don't think
it was caught by the tests since ocfl-fs implements readFile itself.
importFile was reading the source using the store, while this happens to
work for ocfl-fs it won't for S3. As importFile source should be the
the local filesystem, not the catalog.
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.

1 participant