forked from Manuel/meeting-assistant
Merge reviewed dependency updates and test synchronization
This commit is contained in:
commit
76ab48bb9e
5 files changed
+41
-6
No files matched your search
@@ -14,7 +14,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="coverlet.collector" Version="10.0.1" />
|
||||
<PackageReference Include="coverlet.collector" Version="10.1.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="10.0.12" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.10.1" />
|
||||
<PackageReference Include="xunit" Version="2.9.3" />
|
||||
|
||||
@@ -53,8 +53,14 @@ public sealed class RecordingCoordinatorTests
|
||||
{
|
||||
try
|
||||
{
|
||||
return File.Exists(path) &&
|
||||
File.ReadAllText(path).Contains(text, StringComparison.Ordinal);
|
||||
if (!File.Exists(path))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
using var stream = File.Open(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite | FileShare.Delete);
|
||||
using var reader = new StreamReader(stream);
|
||||
return reader.ReadToEnd().Contains(text, StringComparison.Ordinal);
|
||||
}
|
||||
catch (IOException)
|
||||
{
|
||||
@@ -3336,6 +3342,7 @@ public sealed class RecordingCoordinatorTests
|
||||
|
||||
await coordinator.StartAsync(CancellationToken.None);
|
||||
await audioSource.WaitUntilCapturedAsync();
|
||||
await artifactStore.WaitUntilTranscribingAsync();
|
||||
|
||||
await coordinator.StopAsync(CancellationToken.None);
|
||||
|
||||
@@ -3479,6 +3486,7 @@ public sealed class RecordingCoordinatorTests
|
||||
{
|
||||
var audioSource = new CapturedChunkThenCancelAudioSource(new AudioChunk([1, 0, 2, 0], 16000, 1));
|
||||
var artifactStore = new InMemoryMeetingArtifactStore();
|
||||
var metadataProvider = new BlockingMeetingMetadataProvider(new MeetingMetadata("Summary failure", [], "", null));
|
||||
var coordinator = new MeetingRecordingCoordinator(
|
||||
audioSource,
|
||||
new TestSpeechRecognitionPipelineFactory(new FinalSegmentOnAudioCompletionProvider()),
|
||||
@@ -3489,11 +3497,15 @@ public sealed class RecordingCoordinatorTests
|
||||
new InMemoryRecordedAudioStore(),
|
||||
new CapturingMeetingSummaryPipeline(succeeded: false),
|
||||
Options.Create(CreateOptionsWithoutFinalizer()),
|
||||
NullLogger<MeetingRecordingCoordinator>.Instance);
|
||||
NullLogger<MeetingRecordingCoordinator>.Instance,
|
||||
meetingMetadataProvider: metadataProvider);
|
||||
|
||||
await coordinator.StartAsync(CancellationToken.None);
|
||||
await metadataProvider.WaitUntilRequestedAsync();
|
||||
await audioSource.WaitUntilCapturedAsync();
|
||||
|
||||
metadataProvider.Release();
|
||||
await artifactStore.WaitUntilTranscribingAsync();
|
||||
await coordinator.StopAsync(CancellationToken.None);
|
||||
|
||||
Assert.Equal(
|
||||
@@ -3527,6 +3539,7 @@ public sealed class RecordingCoordinatorTests
|
||||
|
||||
await coordinator.StartAsync(CancellationToken.None);
|
||||
await audioSource.WaitUntilCapturedAsync();
|
||||
await artifactStore.WaitUntilTranscribingAsync();
|
||||
|
||||
await coordinator.StopAsync(CancellationToken.None);
|
||||
|
||||
@@ -4543,6 +4556,7 @@ public sealed class RecordingCoordinatorTests
|
||||
|
||||
private sealed class InMemoryMeetingArtifactStore : IMeetingArtifactStore
|
||||
{
|
||||
private readonly TaskCompletionSource transcribing = new(TaskCreationOptions.RunContinuationsAsynchronously);
|
||||
private readonly bool createAssistantContextFile;
|
||||
private bool failNextMetadataUpdate;
|
||||
|
||||
@@ -4558,6 +4572,11 @@ public sealed class RecordingCoordinatorTests
|
||||
|
||||
public List<AssistantContextState> States { get; } = [];
|
||||
|
||||
public Task WaitUntilTranscribingAsync()
|
||||
{
|
||||
return transcribing.Task.WaitAsync(TimeSpan.FromSeconds(15));
|
||||
}
|
||||
|
||||
public string? Agenda { get; private set; }
|
||||
|
||||
public DateTimeOffset? ScheduledEnd { get; private set; }
|
||||
@@ -4599,6 +4618,10 @@ public sealed class RecordingCoordinatorTests
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
States.Add(state);
|
||||
if (state == AssistantContextState.Transcribing)
|
||||
{
|
||||
transcribing.TrySetResult();
|
||||
}
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user