mirror of https://github.com/OpenVidu/openvidu.git
openvidu-test-e2e: manifest group of the tracks of a chosen-tracks request
A Participant Passthrough request that chooses its tracks (screen_share, a MediaSource) puts every track in the requested file. The manifest entries copied the group of that file, so a screen share was reported as "group": "camera" next to "source": "screen_share", and no test looked at it. egress-pro now labels such a track by what it is (a screen share and its audio "screen", the camera and the microphone "camera", a track without a source "other") while "file" still names the requested file. assertChosenTracksManifest reads the manifest of the egress and checks that it lists the expected number of tracks, that each one is in the requested file and that its group is "screen" for a source starting with screen_share and "camera" otherwise. It is called from screenShareTest (1 track: the screen share), screenShareModeWithTabAudioTest (2: the screen share and its audio) and mediaSourceMicrophoneAndTabAudioTest (3: the tab audio, the microphone and the screen the request implies, as the test already asserts for the file). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>chore/update-openvidu-actions-1.0.25
parent
ca9a90b17b
commit
396c98d336
|
|
@ -1988,6 +1988,7 @@ public class OpenViduTestAppE2eEgressProTest extends AbstractOpenViduTestappE2eT
|
|||
recording.assertAvSync(5);
|
||||
recording.assertDefaults("screen_share", "screen_share_audio");
|
||||
recording.named("screen_share").assertReachedSize(SCREEN_WIDTH, SCREEN_HEIGHT);
|
||||
assertChosenTracksManifest(egressId, 2);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -2013,6 +2014,7 @@ public class OpenViduTestAppE2eEgressProTest extends AbstractOpenViduTestappE2eT
|
|||
recording.assertDefaults("screen_share", "microphone");
|
||||
recording.named("screen_share_audio").assertMarkers(6);
|
||||
recording.named("microphone").assertMarkers(6);
|
||||
assertChosenTracksManifest(egressId, 3);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -2368,6 +2370,7 @@ public class OpenViduTestAppE2eEgressProTest extends AbstractOpenViduTestappE2eT
|
|||
recording.assertHealthy();
|
||||
recording.video(0).assertMarkers(6);
|
||||
recording.video(0).assertReachedSize(SCREEN_WIDTH, SCREEN_HEIGHT);
|
||||
assertChosenTracksManifest(egressId, 1);
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
|
|
@ -3707,6 +3710,26 @@ public class OpenViduTestAppE2eEgressProTest extends AbstractOpenViduTestappE2eT
|
|||
return JsonParser.parseString(new String(Files.readAllBytes(local), StandardCharsets.UTF_8)).getAsJsonObject();
|
||||
}
|
||||
|
||||
/**
|
||||
* The manifest of a request for chosen tracks (screen_share, a MediaSource):
|
||||
* every track is in the requested file, and its group says what the track is
|
||||
* (a screen share is "screen"), not which file the request put it in.
|
||||
*/
|
||||
private void assertChosenTracksManifest(String egressId, int tracks) throws Exception {
|
||||
JsonObject manifest = getManifest(egressId);
|
||||
String key = fileKey(getEgress(egressId));
|
||||
JsonArray entries = manifest.getAsJsonArray("tracks");
|
||||
Assertions.assertEquals(tracks, entries.size(), "Manifest tracks: " + manifest);
|
||||
for (JsonElement entry : entries) {
|
||||
JsonObject track = entry.getAsJsonObject();
|
||||
String source = track.get("source").getAsString();
|
||||
Assertions.assertEquals(key, track.get("file").getAsString(),
|
||||
"Every track is in the requested file: " + manifest);
|
||||
Assertions.assertEquals(source.startsWith("screen_share") ? "screen" : "camera",
|
||||
track.get("group").getAsString(), "The group of the " + source + " track: " + manifest);
|
||||
}
|
||||
}
|
||||
|
||||
/** The first manifest track of a file and kind. */
|
||||
private static JsonObject manifestTrack(JsonObject manifest, String group, String kind) {
|
||||
JsonArray tracks = manifest.getAsJsonArray("tracks");
|
||||
|
|
|
|||
Loading…
Reference in New Issue