From ae412a5f12e701e07e71bd9791c55a56858e8383 Mon Sep 17 00:00:00 2001 From: Stainless Bot <107565488+stainless-bot@users.noreply.github.com> Date: Fri, 12 Jan 2024 15:11:15 -0500 Subject: [PATCH] chore(ecosystem-tests): fix flaky vercel-edge, cloudflare-worker, and deno tests (#626) --- .../cloudflare-worker/src/uploadWebApiTestCases.ts | 10 +++++----- ecosystem-tests/deno/main_test.ts | 8 ++++---- .../vercel-edge/src/uploadWebApiTestCases.ts | 10 +++++----- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/ecosystem-tests/cloudflare-worker/src/uploadWebApiTestCases.ts b/ecosystem-tests/cloudflare-worker/src/uploadWebApiTestCases.ts index f7651a992..39225fb8d 100644 --- a/ecosystem-tests/cloudflare-worker/src/uploadWebApiTestCases.ts +++ b/ecosystem-tests/cloudflare-worker/src/uploadWebApiTestCases.ts @@ -116,31 +116,31 @@ export function uploadWebApiTestCases({ // @ts-expect-error we don't type support for `string` to avoid a footgun with passing the file path const file = await toFile(fineTune, 'finetune.jsonl'); const result = await client.files.create({ file, purpose: 'fine-tune' }); - expectEqual(result.status, 'uploaded'); + expectEqual(result.filename, 'finetune.jsonl'); }); it('toFile handles Blob', async () => { const result = await client.files.create({ file: await toFile(new Blob([fineTune]), 'finetune.jsonl'), purpose: 'fine-tune' }); - expectEqual(result.status, 'uploaded'); + expectEqual(result.filename, 'finetune.jsonl'); }); it('toFile handles Uint8Array', async () => { const result = await client.files.create({ file: await toFile(new TextEncoder().encode(fineTune), 'finetune.jsonl'), purpose: 'fine-tune', }); - expectEqual(result.status, 'uploaded'); + expectEqual(result.filename, 'finetune.jsonl'); }); it('toFile handles ArrayBuffer', async () => { const result = await client.files.create({ file: await toFile(new TextEncoder().encode(fineTune).buffer, 'finetune.jsonl'), purpose: 'fine-tune', }); - expectEqual(result.status, 'uploaded'); + expectEqual(result.filename, 'finetune.jsonl'); }); it('toFile handles DataView', async () => { const result = await client.files.create({ file: await toFile(new DataView(new TextEncoder().encode(fineTune).buffer), 'finetune.jsonl'), purpose: 'fine-tune', }); - expectEqual(result.status, 'uploaded'); + expectEqual(result.filename, 'finetune.jsonl'); }); } diff --git a/ecosystem-tests/deno/main_test.ts b/ecosystem-tests/deno/main_test.ts index 988b03d84..61b478cc5 100644 --- a/ecosystem-tests/deno/main_test.ts +++ b/ecosystem-tests/deno/main_test.ts @@ -105,26 +105,26 @@ Deno.test(async function toFileHandlesBlob() { file: await toFile(new Blob([fineTune]), 'finetune.jsonl'), purpose: 'fine-tune', }); - assertEquals(result.status, 'uploaded'); + assertEquals(result.filename, 'finetune.jsonl'); }); Deno.test(async function toFileHandlesUint8Array() { const result = await client.files.create({ file: await toFile(new TextEncoder().encode(fineTune), 'finetune.jsonl'), purpose: 'fine-tune', }); - assertEquals(result.status, 'uploaded'); + assertEquals(result.filename, 'finetune.jsonl'); }); Deno.test(async function toFileHandlesArrayBuffer() { const result = await client.files.create({ file: await toFile(new TextEncoder().encode(fineTune).buffer, 'finetune.jsonl'), purpose: 'fine-tune', }); - assertEquals(result.status, 'uploaded'); + assertEquals(result.filename, 'finetune.jsonl'); }); Deno.test(async function toFileHandlesDataView() { const result = await client.files.create({ file: await toFile(new DataView(new TextEncoder().encode(fineTune).buffer), 'finetune.json'), purpose: 'fine-tune', }); - assertEquals(result.status, 'uploaded'); + assertEquals(result.filename, 'finetune.jsonl'); }); diff --git a/ecosystem-tests/vercel-edge/src/uploadWebApiTestCases.ts b/ecosystem-tests/vercel-edge/src/uploadWebApiTestCases.ts index 865aa86a5..3f2c6b468 100644 --- a/ecosystem-tests/vercel-edge/src/uploadWebApiTestCases.ts +++ b/ecosystem-tests/vercel-edge/src/uploadWebApiTestCases.ts @@ -147,28 +147,28 @@ export function uploadWebApiTestCases({ // @ts-ignore this only doesn't error in vercel build... const file = await toFile(fineTune, 'finetune.jsonl'); const result = await client.files.create({ file, purpose: 'fine-tune' }); - expectEqual(result.status, 'uploaded'); + expectEqual(result.filename, 'finetune.jsonl'); }); it('toFile handles Blob', async () => { const result = await client.files.create({ file: await toFile(new Blob([fineTune]), 'finetune.jsonl'), purpose: 'fine-tune', }); - expectEqual(result.status, 'uploaded'); + expectEqual(result.filename, 'finetune.jsonl'); }); it('toFile handles Uint8Array', async () => { const result = await client.files.create({ file: await toFile(new TextEncoder().encode(fineTune), 'finetune.jsonl'), purpose: 'fine-tune', }); - expectEqual(result.status, 'uploaded'); + expectEqual(result.filename, 'finetune.jsonl'); }); it('toFile handles ArrayBuffer', async () => { const result = await client.files.create({ file: await toFile(new TextEncoder().encode(fineTune).buffer, 'finetune.jsonl'), purpose: 'fine-tune', }); - expectEqual(result.status, 'uploaded'); + expectEqual(result.filename, 'finetune.jsonl'); }); if (runtime !== 'edge') { // this fails in edge for some reason @@ -177,7 +177,7 @@ export function uploadWebApiTestCases({ file: await toFile(new DataView(new TextEncoder().encode(fineTune).buffer), 'finetune.jsonl'), purpose: 'fine-tune', }); - expectEqual(result.status, 'uploaded'); + expectEqual(result.filename, 'finetune.jsonl'); }); } }