Skip to content

FixGetRecordingTest #50222

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

Merged
merged 7 commits into from
May 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "net",
"TagPrefix": "net/communication/Azure.Communication.CallAutomation",
"Tag": "net/communication/Azure.Communication.CallAutomation_fdf269ce94"
"Tag": "net/communication/Azure.Communication.CallAutomation_9cd8b0cf91"
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ public async Task RemoveAUserCallTest()
};
Response<RemoveParticipantResult> removePartResponse = await response.CallConnection.RemoveParticipantAsync(removeParticipantsOptions);
Assert.IsTrue(!removePartResponse.GetRawResponse().IsError);
Assert.AreEqual(operationContext1, removePartResponse.Value.OperationContext);
string expectedOperationContext = Mode == RecordedTestMode.Playback ? "Sanitized" : operationContext1;
Assert.AreEqual(expectedOperationContext, removePartResponse.Value.OperationContext);

// call should be disconnected after removing participant
var disconnectedEvent = await WaitForEvent<CallDisconnected>(callConnectionId, TimeSpan.FromSeconds(20));
Expand Down Expand Up @@ -157,7 +158,9 @@ public async Task CancelAddParticipantTest()
OperationContext = operationContext,
};
var addParticipantResponse = await callConnection.AddParticipantAsync(addParticipantOptions);
Assert.AreEqual(operationContext, addParticipantResponse.Value.OperationContext);

string expectedOperationContext = Mode == RecordedTestMode.Playback ? "Sanitized" : operationContext;
Assert.AreEqual(expectedOperationContext, addParticipantResponse.Value.OperationContext);
Assert.IsNotNull(addParticipantResponse.Value.InvitationId);

// ensure invitation has arrived
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,6 @@ public async Task StartRecordingWithCallConnectionIdTest()
}
}

[Ignore(reason: "Skipping this currently getrecording api taking more than 2 mints to get the recording result")]
[RecordedTest]
public async Task GetRecordingTest()
{
Expand All @@ -418,6 +417,7 @@ public async Task GetRecordingTest()
* 7. hang up the call.
* 8. once call is hung up, verify disconnected event
*/

// create caller and receiver
CommunicationUserIdentifier target = await CreateIdentityUserAsync().ConfigureAwait(false);
CommunicationUserIdentifier user = await CreateIdentityUserAsync().ConfigureAwait(false);
Expand Down Expand Up @@ -472,10 +472,19 @@ public async Task GetRecordingTest()
Assert.AreEqual(StatusCodes.Status200OK, startRecordingResponse.GetRawResponse().Status);
Assert.NotNull(startRecordingResponse.Value.RecordingId);

var playSource = new FileSource(new Uri(TestEnvironment.FileSourceUrl)) { PlaySourceCacheId = "test-audio" };
var playResponse = await response.CallConnection.GetCallMedia().PlayToAllAsync(playSource);
Assert.NotNull(playResponse);
Assert.AreEqual(202, playResponse.GetRawResponse().Status);

await Task.Delay(TimeSpan.FromSeconds(5)).ConfigureAwait(false);

// try stop recording
var stopRecordingResponse = await client.GetCallRecording().StopAsync(startRecordingResponse.Value.RecordingId);
Assert.AreEqual(StatusCodes.Status204NoContent, stopRecordingResponse.Status);

await Task.Delay(TimeSpan.FromSeconds(5)).ConfigureAwait(false);

// get call recording result
var recordingResult = await client.GetCallRecording().GetRecordingAsync(startRecordingResponse.Value.RecordingId).ConfigureAwait(false);
Assert.NotNull(recordingResult.Value);
Expand All @@ -486,7 +495,7 @@ public async Task GetRecordingTest()

// try hangup
await response.CallConnection.HangUpAsync(true).ConfigureAwait(false);
var disconnectedEvent = await WaitForEvent<CallDisconnected>(callConnectionId, TimeSpan.FromSeconds(20));
var disconnectedEvent = await WaitForEvent<CallDisconnected>(callConnectionId, TimeSpan.FromSeconds(5));
Assert.IsNotNull(disconnectedEvent);
Assert.IsTrue(disconnectedEvent is CallDisconnected);
Assert.IsTrue(((CallDisconnected)disconnectedEvent!).CallConnectionId == callConnectionId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ public CallAutomationClientAutomatedLiveTestsBase(bool isAsync, RecordedTestMode
BodyKeySanitizers.Add(new BodyKeySanitizer("..recordingStateCallbackUri") { Value = @"https://sanitized.skype.com/api/servicebuscallback/events" });
BodyKeySanitizers.Add(new BodyKeySanitizer("..transportUrl") { Value = @"wss://sanitized.skype.com" });
BodyKeySanitizers.Add(new BodyKeySanitizer("..cognitiveServicesEndpoint") { Value = @"https://sanitized.skype.com" });
BodyKeySanitizers.Add(new BodyKeySanitizer("$..file.uri") { Value = @"https://sanitized.skype.com/prompt.wav" });
BodyKeySanitizers.Add(new BodyKeySanitizer("$..operationContext") { Value = "Sanitized" });
BodyKeySanitizers.Add(new BodyKeySanitizer("$..file.uri") { Value = @"https://sanitized.skype.com/prompt.wav" });
BodyRegexSanitizers.Add(new BodyRegexSanitizer(TestDispatcherRegEx) { Value = "https://sanitized.skype.com" });
UriRegexSanitizers.Add(new UriRegexSanitizer(URIDomainRegEx) { Value = "https://sanitized.skype.com" });
UriRegexSanitizers.Add(new UriRegexSanitizer(TestDispatcherQNameRegEx) { Value = SanitizeValue });
Expand Down
Loading
Loading