Skip to content
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

Fix false positive web tests #128

Merged
merged 50 commits into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
17fdeda
Test e2e
logist322 Jul 17, 2023
bd0847d
Fix branch
logist322 Jul 17, 2023
d4689f2
Fix branch
logist322 Jul 17, 2023
f959791
Test
logist322 Jul 18, 2023
7c30445
Fix CI
logist322 Jul 18, 2023
8e005d1
Fix Makefile
logist322 Jul 18, 2023
374b575
Fix Makefile
logist322 Jul 18, 2023
7f86114
FIx Makefile
logist322 Jul 18, 2023
7acfacc
Fix Makefile
logist322 Jul 18, 2023
8bf9847
Fix e2e
logist322 Jul 20, 2023
e68de72
WIP
logist322 Jul 20, 2023
bbdd4af
WIP
logist322 Jul 20, 2023
f7c9635
Fix CI
logist322 Jul 20, 2023
a1872dc
Fix fmt
logist322 Jul 20, 2023
99d8aca
Comment broken test
logist322 Jul 25, 2023
c8b9ddc
Merge branch 'master' into sfu-e2e
alexlapa Jul 25, 2023
4631189
fix unit tests
alexlapa Jul 26, 2023
a250b07
empty
alexlapa Jul 26, 2023
9e775d2
enable more tests for sfu
alexlapa Aug 9, 2023
06f511e
disable some tests for sfu
alexlapa Aug 9, 2023
40954f7
Merge branch 'master' into sfu-e2e
alexlapa Aug 9, 2023
4972ea8
fix
rogurotus Aug 14, 2023
8d793a9
fix
rogurotus Aug 14, 2023
b4d1313
fix locacl tracks sfu test
rogurotus Aug 14, 2023
a865078
fix test
rogurotus Aug 25, 2023
7ed0a18
Merge remote-tracking branch 'origin/master' into fix-sfu-connection-…
rogurotus Aug 25, 2023
60beb77
fmt
rogurotus Aug 25, 2023
fc3f725
fix features
rogurotus Aug 25, 2023
f2e1eb2
fix clippy
rogurotus Aug 25, 2023
eeee5fa
fix web test
rogurotus Aug 25, 2023
bdb873b
fmt
rogurotus Aug 25, 2023
710a92e
fix merge
rogurotus Aug 25, 2023
b7cd1a2
fix web merge
rogurotus Aug 25, 2023
951319a
fix test race
rogurotus Aug 25, 2023
82ab2dc
fix
rogurotus Aug 31, 2023
90a13d3
mesh
rogurotus Aug 31, 2023
94010c1
enable all tests
rogurotus Sep 1, 2023
6501502
Merge branch 'master' into fix-web-connection-loss
alexlapa Sep 19, 2023
64900a6
corrections
alexlapa Sep 19, 2023
b6f1db7
corrections
alexlapa Sep 19, 2023
5526506
Merge branch 'master' into fix-web-connection-loss
alexlapa Nov 17, 2023
3477b5c
Merge branch 'master' into fix-web-connection-loss
alexlapa Nov 29, 2023
06f7ee8
corrections
alexlapa Nov 30, 2023
5829c65
corrections
alexlapa Nov 30, 2023
b5419b8
error refact
rogurotus Dec 1, 2023
dac1d7d
fix fmt
rogurotus Dec 1, 2023
48b6e1b
corrections
alexlapa Dec 1, 2023
39d825c
trigger ci
alexlapa Dec 4, 2023
32e3f2e
corrections
alexlapa Dec 4, 2023
3e3be6a
Corrections
tyranron Dec 5, 2023
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
29 changes: 13 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ android_logger = "0.13"
simple_logger = "4.0"

[target.'cfg(not(target_family = "wasm"))'.dependencies]
anyhow = "1.0"
dart-sys = "4.0"
flutter_rust_bridge = { version = "=1.82.4", default-features = false }
libc = "0.2"
Expand Down
10 changes: 3 additions & 7 deletions e2e/src/browser/mock/websocket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,14 @@ impl<'a> WebSocket<'a> {
self.0
.execute(Statement::new(
// language=JavaScript
r#"
"
async () => {
const [code] = args;
for (socket of window.wsMock.allSockets) {
window.wsMock.isClosed = true;
window.wsMock.closeCode = code;
socket.dispatchEvent(
new CloseEvent("close", { code: code })
);
socket.close(code);
}
}
"#,
",
[code.into()],
))
.await
Expand Down
3 changes: 0 additions & 3 deletions e2e/tests/features/state_synchronization.feature
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ Feature: State synchronization
And Alice restores WS connection
Then Bob's audio remote track from Alice is enabled

@mesh
Scenario: Audio endpoint added while disconnected
Given room with joined member Alice and Bob with no WebRTC endpoints
When Alice loses WS connection
Expand All @@ -36,7 +35,6 @@ Feature: State synchronization
Then Alice has audio remote tracks from Bob
And Bob has audio remote tracks from Alice

@mesh
Scenario: Video endpoint added while disconnected
Given room with joined member Alice and Bob with no WebRTC endpoints
When Alice loses WS connection
Expand All @@ -45,7 +43,6 @@ Feature: State synchronization
Then Alice has video remote tracks from Bob
And Bob has video remote tracks from Alice

@mesh
Scenario: New endpoint creates new tracks
Given room with joined member Alice and Bob with no WebRTC endpoints
When Alice loses WS connection
Expand Down
6 changes: 5 additions & 1 deletion e2e/tests/steps/websocket.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
use std::time::Duration;

use cucumber::{then, when};
use tokio::time::sleep;

use crate::World;

#[when(regex = r"^(\S+) loses WS connection$")]
async fn ws_connection_loss(world: &mut World, id: String) {
let member = world.get_member(&id).unwrap();
member.ws_mock().enable_connection_loss(9999).await;
member.ws_mock().enable_connection_loss(3999).await;
sleep(Duration::from_millis(500)).await;
}

#[when(regex = r"^(\S+) restores WS connection$")]
Expand Down
10 changes: 5 additions & 5 deletions flutter/example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -318,10 +318,10 @@ packages:
dependency: "direct main"
description:
name: medea_flutter_webrtc
sha256: f4d5aa921795d8509dbeeafe83b38e7e7441e2a7d0542a7f4e5c5b723616501e
sha256: "5b308b88d7eba6279971c218cfddb374e2f60977811cc9b5cf30f26379a66a97"
url: "https://pub.dev"
source: hosted
version: "0.8.3-dev+rev.d5a07ce262833b307e4b0e5d39badd55eadf812a"
version: "0.8.3-dev+rev.0fe64b4610154ddb7e8774a952b6ecf6369b7633"
medea_jason:
dependency: "direct main"
description:
Expand Down Expand Up @@ -365,10 +365,10 @@ packages:
dependency: transitive
description:
name: petitparser
sha256: eeb2d1428ee7f4170e2bd498827296a18d4e7fc462b71727d111c0ac7707cfa6
sha256: c15605cd28af66339f8eb6fbe0e541bfe2d1b72d5825efc6598f3e0a31b9ad27
url: "https://pub.dev"
source: hosted
version: "6.0.1"
version: "6.0.2"
platform:
dependency: transitive
description:
Expand Down Expand Up @@ -615,5 +615,5 @@ packages:
source: hosted
version: "3.1.2"
sdks:
dart: ">=3.2.0-194.0.dev <4.0.0"
dart: ">=3.2.0 <4.0.0"
flutter: ">=3.10.0"
2 changes: 1 addition & 1 deletion flutter/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ dependencies:
faker_dart: ^0.1.11
freezed_annotation: ^2.2.0
http: ^0.13.6
medea_flutter_webrtc: 0.8.3-dev+rev.d5a07ce262833b307e4b0e5d39badd55eadf812a
medea_flutter_webrtc: 0.8.3-dev+rev.0fe64b4610154ddb7e8774a952b6ecf6369b7633
retry: ^3.1.2

dev_dependencies:
Expand Down
72 changes: 19 additions & 53 deletions flutter/lib/src/native/connection_handle.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import 'package:flutter_rust_bridge/flutter_rust_bridge.dart';

import 'package:medea_jason/src/native/remote_media_track.dart';
import '../interface/connection_handle.dart';
import '../interface/media_track.dart';
Expand All @@ -22,45 +20,29 @@ class NativeConnectionHandle implements ConnectionHandle {

@override
String getRemoteMemberId() {
try {
return api.connectionHandleGetRemoteMemberId(
connection: opaque.innerOpaque);
} on FfiException catch (anyhow) {
throw anyhow.parse();
}
return api.connectionHandleGetRemoteMemberId(
connection: opaque.innerOpaque);
}

@override
void onClose(void Function() f) {
try {
api.connectionHandleOnClose(connection: opaque.innerOpaque, f: f);
} on FfiException catch (anyhow) {
throw anyhow.parse();
}
api.connectionHandleOnClose(connection: opaque.innerOpaque, f: f);
}

@override
void onRemoteTrackAdded(void Function(RemoteMediaTrack) f) {
try {
api.connectionHandleOnRemoteTrackAdded(
connection: opaque.innerOpaque,
f: (t) {
f(NativeRemoteMediaTrack(
api.remoteMediaTrackFromPtr(ptr: t.address)));
});
} on FfiException catch (anyhow) {
throw anyhow.parse();
}
api.connectionHandleOnRemoteTrackAdded(
connection: opaque.innerOpaque,
f: (t) {
f(NativeRemoteMediaTrack(
api.remoteMediaTrackFromPtr(ptr: t.address)));
});
}

@override
void onQualityScoreUpdate(void Function(int) f) {
try {
api.connectionHandleOnQualityScoreUpdate(
connection: opaque.innerOpaque, f: f);
} on FfiException catch (anyhow) {
throw anyhow.parse();
}
api.connectionHandleOnQualityScoreUpdate(
connection: opaque.innerOpaque, f: f);
}

@moveSemantics
Expand All @@ -75,41 +57,25 @@ class NativeConnectionHandle implements ConnectionHandle {

@override
Future<void> enableRemoteAudio() async {
try {
await (api.connectionHandleEnableRemoteAudio(
connection: opaque.innerOpaque) as Future);
} on FfiException catch (anyhow) {
throw anyhow.parse();
}
await (api.connectionHandleEnableRemoteAudio(connection: opaque.innerOpaque)
as Future);
}

@override
Future<void> disableRemoteAudio() async {
try {
await (api.connectionHandleDisableRemoteAudio(
connection: opaque.innerOpaque) as Future);
} on FfiException catch (anyhow) {
throw anyhow.parse();
}
await (api.connectionHandleDisableRemoteAudio(
connection: opaque.innerOpaque) as Future);
}

@override
Future<void> enableRemoteVideo([MediaSourceKind? kind]) async {
try {
await (api.connectionHandleEnableRemoteVideo(
connection: opaque.innerOpaque, sourceKind: kind) as Future);
} on FfiException catch (anyhow) {
throw anyhow.parse();
}
await (api.connectionHandleEnableRemoteVideo(
connection: opaque.innerOpaque, sourceKind: kind) as Future);
}

@override
Future<void> disableRemoteVideo([MediaSourceKind? kind]) async {
try {
await (api.connectionHandleDisableRemoteVideo(
connection: opaque.innerOpaque, sourceKind: kind) as Future);
} on FfiException catch (anyhow) {
throw anyhow.parse();
}
await (api.connectionHandleDisableRemoteVideo(
connection: opaque.innerOpaque, sourceKind: kind) as Future);
}
}
Loading
Loading