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

Test bevy signaling #354

Merged
merged 3 commits into from
Oct 28, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
uses: Swatinem/[email protected]

- name: Run cargo test
run: cargo test --all-targets
run: cargo test --features signaling --all-targets

# Should be upgraded to test when possible
check-wasm:
Expand Down
33 changes: 33 additions & 0 deletions bevy_matchbox/src/signaling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,36 @@ impl MatchboxServer {
SignalingServer::client_server_builder(socket_addr)
}
}

#[cfg(test)]
mod tests {
use crate::matchbox_signaling::topologies::client_server::{ClientServer, ClientServerState};
use crate::prelude::*;
use bevy::prelude::*;
use std::net::Ipv4Addr;

fn start_signaling(mut commands: Commands) {
let server: MatchboxServer = SignalingServerBuilder::new(
(Ipv4Addr::UNSPECIFIED, 3536),
ClientServer,
ClientServerState::default(),
)
.into();

commands.insert_resource(MatchboxServer::from(server));
}

#[test]
#[ignore]
// https://github.com/johanhelsing/matchbox/issues/350
fn start_signaling_without_panics() {
let mut app = App::new();

app.add_plugins(MinimalPlugins)
.add_systems(Startup, start_signaling);

app.update();

assert_eq!(0, 1);
}
}
Loading