-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: integration tests #47
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ import { decode as aggregateDecode } from '../data/aggregate.js' | |
* @param {import('@web3-storage/filecoin-client/types').InvocationConfig} props.invocationConfig | ||
* @param {import('@ucanto/principal/ed25519').ConnectionView<any>} props.dealerServiceConnection | ||
*/ | ||
export async function dealerAdd ({ | ||
export async function dealerQueue ({ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. rename to what this actually does, which is queuing the deal for the dealer to handle |
||
bufferStoreClient, | ||
aggregateStoreClient, | ||
aggregateRecord, | ||
|
@@ -36,7 +36,7 @@ export async function dealerAdd ({ | |
}) | ||
|
||
// Add aggregate to dealer | ||
const add = await Dealer.dealAdd( | ||
const dealQueue = await Dealer.dealQueue( | ||
invocationConfig, | ||
aggregate.link, | ||
bufferReference.ok.pieces.map(p => p.piece), | ||
|
@@ -45,29 +45,29 @@ export async function dealerAdd ({ | |
{ connection: dealerServiceConnection } | ||
) | ||
|
||
if (add.out.error) { | ||
if (dealQueue.out.error) { | ||
return { | ||
error: add.out.error | ||
error: dealQueue.out.error | ||
} | ||
} | ||
|
||
// Save aggregate | ||
const aggregateStored = await aggregateStoreClient.put({ | ||
piece: aggregate.link, | ||
buffer: bufferRef.buffer, | ||
task: add.ran.link(), | ||
invocation: add.ran.link(), | ||
task: dealQueue.ran.link(), | ||
invocation: dealQueue.ran.link(), | ||
insertedAt: Date.now(), | ||
storefront: bufferReference.ok.storefront, | ||
group: bufferReference.ok.group, | ||
stat: 0 | ||
}) | ||
|
||
if (aggregateStored.error) { | ||
return { | ||
error: aggregateStored.error | ||
} | ||
} | ||
|
||
return { | ||
ok: 1 | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -123,8 +123,8 @@ test('can reduce received buffers by creating an aggregate and remaining buffer' | |
|
||
const bucketName = await createBucket(s3) | ||
const { buffers, bufferRecords } = await getBuffers(2, { | ||
length: 100, | ||
size: 128 | ||
length: 10, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just changed to use same values as integration tests and be able to catch potential issues faster there |
||
size: 1024 | ||
}) | ||
|
||
const storeClient = createBucketStoreClient(s3, { | ||
|
@@ -152,7 +152,7 @@ test('can reduce received buffers by creating an aggregate and remaining buffer' | |
aggregateQueueClient, | ||
bufferRecords, | ||
minAggregateSize: 2 ** 13, | ||
maxAggregateSize: 2 ** 22 | ||
maxAggregateSize: 2 ** 15 | ||
}) | ||
|
||
t.falsy(reduceBufferResp.error) | ||
|
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.
added new index so that we can query all aggregates by a given storefront. We currently use this for the integration tests, given we create a new storefront did per integration test run, it will always be a new one.
This will likely not be needed in the day to day of operating this system. However, it might be a query important to also do ad hoc.