Skip to content

Commit a59c286

Browse files
prathikrPrathik Rao
andauthored
[sdk_v2] share testdata across cs/js sdks (#395)
* impl * calculate complete path * rev --------- Co-authored-by: Prathik Rao <prathikrao@microsoft.com>
1 parent 8aea91f commit a59c286

File tree

5 files changed

+5
-4
lines changed

5 files changed

+5
-4
lines changed

sdk_v2/cs/test/FoundryLocal.Tests/AudioClientTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public async Task AudioTranscription_NoStreaming_Succeeds()
3434
await Assert.That(audioClient).IsNotNull();
3535

3636

37-
var audioFilePath = "testdata/Recording.mp3";
37+
var audioFilePath = Path.Combine(AppContext.BaseDirectory, "testdata/Recording.mp3");
3838

3939
var response = await audioClient.TranscribeAudioAsync(audioFilePath).ConfigureAwait(false);
4040

@@ -52,7 +52,7 @@ public async Task AudioTranscription_Streaming_Succeeds()
5252
await Assert.That(audioClient).IsNotNull();
5353

5454

55-
var audioFilePath = "testdata/Recording.mp3";
55+
var audioFilePath = Path.Combine(AppContext.BaseDirectory, "testdata/Recording.mp3");
5656

5757
var updates = audioClient.TranscribeAudioStreamingAsync(audioFilePath, CancellationToken.None).ConfigureAwait(false);
5858

sdk_v2/cs/test/FoundryLocal.Tests/Microsoft.AI.Foundry.Local.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
</ItemGroup>
3333

3434
<ItemGroup>
35-
<None Update="testdata\Recording.mp3">
35+
<None Include="../../../testdata/Recording.mp3" Link="testdata/Recording.mp3">
3636
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
3737
</None>
3838
</ItemGroup>

sdk_v2/js/test/openai/audioClient.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import { describe, it } from 'mocha';
22
import { expect } from 'chai';
33
import { getTestManager } from '../testUtils.js';
4+
import path from 'path';
45

56
describe('Audio Client Tests', () => {
67
const WHISPER_MODEL_ALIAS = 'whisper-tiny';
7-
const AUDIO_FILE_PATH = 'testdata/Recording.mp3';
8+
const AUDIO_FILE_PATH = path.join(process.cwd(), '..', 'testdata', 'Recording.mp3');
89
const EXPECTED_TEXT = ' And lots of times you need to give people more than one link at a time. You a band could give their fans a couple new videos from the live concert behind the scenes photo gallery and album to purchase like these next few links.';
910

1011
it('should transcribe audio without streaming', async function() {

sdk_v2/js/testdata/Recording.mp3

-322 KB
Binary file not shown.

sdk_v2/cs/test/FoundryLocal.Tests/testdata/Recording.mp3 renamed to sdk_v2/testdata/Recording.mp3

File renamed without changes.

0 commit comments

Comments
 (0)