chore(release): final release commit for 0.1.0
this commit includes a whole lotta fuck yeah, a whole lotta we fuckin got this, and a lot of "please change the future." i hope it works. Signed-off-by: Sienna Meridian Satterwhite <sienna@r3t.io>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
[package]
|
||||
name = "app"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
edition.workspace = true
|
||||
|
||||
[features]
|
||||
default = ["desktop"]
|
||||
@@ -12,45 +12,45 @@ headless = []
|
||||
[dependencies]
|
||||
libmarathon = { path = "../libmarathon" }
|
||||
macros = { path = "../macros" }
|
||||
inventory = { workspace = true }
|
||||
rkyv = { workspace = true }
|
||||
bevy = { version = "0.17", default-features = false, features = [
|
||||
inventory.workspace = true
|
||||
rkyv.workspace = true
|
||||
bevy = { version = "0.17.2", default-features = false, features = [
|
||||
# bevy_render, bevy_core_pipeline, bevy_pbr are now vendored in libmarathon
|
||||
"bevy_ui",
|
||||
"bevy_text",
|
||||
"png",
|
||||
] }
|
||||
egui = { version = "0.33", default-features = false, features = ["bytemuck", "default_fonts"] }
|
||||
glam = "0.29"
|
||||
winit = "0.30"
|
||||
egui.workspace = true
|
||||
glam.workspace = true
|
||||
winit.workspace = true
|
||||
raw-window-handle = "0.6"
|
||||
uuid = { version = "1.0", features = ["v4", "serde"] }
|
||||
anyhow = "1.0"
|
||||
tokio = { version = "1", features = ["full"] }
|
||||
tracing = "0.1"
|
||||
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
|
||||
tracing-appender = "0.2"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
rand = "0.8"
|
||||
iroh = { version = "0.95", features = ["discovery-local-network"] }
|
||||
iroh-gossip = "0.95"
|
||||
futures-lite = "2.0"
|
||||
bytes = "1.0"
|
||||
crossbeam-channel = "0.5.15"
|
||||
clap = { version = "4.0", features = ["derive"] }
|
||||
uuid.workspace = true
|
||||
anyhow.workspace = true
|
||||
tokio.workspace = true
|
||||
tracing.workspace = true
|
||||
tracing-subscriber.workspace = true
|
||||
tracing-appender.workspace = true
|
||||
serde.workspace = true
|
||||
rand.workspace = true
|
||||
iroh = { workspace = true, features = ["discovery-local-network"] }
|
||||
iroh-gossip.workspace = true
|
||||
futures-lite.workspace = true
|
||||
bytes.workspace = true
|
||||
crossbeam-channel.workspace = true
|
||||
clap.workspace = true
|
||||
|
||||
[target.'cfg(target_os = "ios")'.dependencies]
|
||||
objc = "0.2"
|
||||
raw-window-handle = "0.6"
|
||||
tracing-oslog = "0.3"
|
||||
tracing-oslog.workspace = true
|
||||
|
||||
[dev-dependencies]
|
||||
iroh = { version = "0.95", features = ["discovery-local-network"] }
|
||||
iroh-gossip = "0.95"
|
||||
tempfile = "3"
|
||||
futures-lite = "2.0"
|
||||
rkyv = { workspace = true }
|
||||
bytes = "1.0"
|
||||
iroh = { workspace = true, features = ["discovery-local-network"] }
|
||||
iroh-gossip.workspace = true
|
||||
tempfile.workspace = true
|
||||
futures-lite.workspace = true
|
||||
rkyv.workspace = true
|
||||
bytes.workspace = true
|
||||
|
||||
[lib]
|
||||
name = "app"
|
||||
|
||||
@@ -5,7 +5,6 @@ edition.workspace = true
|
||||
|
||||
[dependencies]
|
||||
anyhow.workspace = true
|
||||
arboard = "3.4"
|
||||
bevy.workspace = true
|
||||
rkyv.workspace = true
|
||||
|
||||
@@ -53,35 +52,34 @@ blake3 = "1.5"
|
||||
blocking = "1.6"
|
||||
hex.workspace = true
|
||||
bytemuck = { version = "1.14", features = ["derive"] }
|
||||
bytes = "1.0"
|
||||
chrono = { version = "0.4", features = ["serde"] }
|
||||
bytes.workspace = true
|
||||
chrono.workspace = true
|
||||
crdts.workspace = true
|
||||
crossbeam-channel = "0.5"
|
||||
crossbeam-channel.workspace = true
|
||||
dirs = "5.0"
|
||||
egui = { version = "0.33", default-features = false, features = ["bytemuck", "default_fonts"] }
|
||||
egui.workspace = true
|
||||
encase = { version = "0.11", features = ["glam"] }
|
||||
futures-lite = "2.0"
|
||||
glam = "0.29"
|
||||
futures-lite.workspace = true
|
||||
glam.workspace = true
|
||||
inventory.workspace = true
|
||||
iroh = { workspace = true, features = ["discovery-local-network"] }
|
||||
iroh-gossip.workspace = true
|
||||
pkarr = "5.0"
|
||||
itertools = "0.14"
|
||||
rand = "0.8"
|
||||
raw-window-handle = "0.6"
|
||||
rusqlite = { version = "0.37.0", features = ["bundled"] }
|
||||
rand.workspace = true
|
||||
rusqlite.workspace = true
|
||||
rustc-hash = "2.1"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde.workspace = true
|
||||
serde_json.workspace = true
|
||||
sha2 = "0.10"
|
||||
thiserror = "2.0"
|
||||
thiserror.workspace = true
|
||||
tokio.workspace = true
|
||||
tokio-util.workspace = true
|
||||
toml.workspace = true
|
||||
tracing.workspace = true
|
||||
uuid = { version = "1.0", features = ["v4", "serde"] }
|
||||
uuid.workspace = true
|
||||
wgpu-types = "26.0"
|
||||
winit = "0.30"
|
||||
winit.workspace = true
|
||||
|
||||
[target.'cfg(target_os = "ios")'.dependencies]
|
||||
tracing-oslog = "0.3"
|
||||
@@ -90,8 +88,8 @@ tracing-oslog = "0.3"
|
||||
tokio.workspace = true
|
||||
iroh = { workspace = true, features = ["discovery-local-network"] }
|
||||
iroh-gossip.workspace = true
|
||||
futures-lite = "2.0"
|
||||
tempfile = "3"
|
||||
futures-lite.workspace = true
|
||||
tempfile.workspace = true
|
||||
proptest = "1.4"
|
||||
criterion = "0.5"
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ mod test_utils;
|
||||
use std::time::Duration;
|
||||
|
||||
use anyhow::Result;
|
||||
use bevy::prelude::Transform;
|
||||
use bevy::prelude::{App, FixedUpdate, Transform};
|
||||
use libmarathon::networking::{
|
||||
CurrentSession,
|
||||
GossipBridge,
|
||||
@@ -23,6 +23,14 @@ use libmarathon::networking::{
|
||||
use test_utils::{TestContext, create_test_app_maybe_offline};
|
||||
use uuid::Uuid;
|
||||
|
||||
/// Helper to ensure FixedUpdate runs (since it's on a fixed timestep)
|
||||
fn update_with_fixed(app: &mut App) {
|
||||
// Run Main schedule (which includes Update)
|
||||
app.update();
|
||||
// Explicitly run FixedUpdate to ensure systems there execute
|
||||
app.world_mut().run_schedule(FixedUpdate);
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Session Lifecycle Tests
|
||||
// ============================================================================
|
||||
@@ -114,7 +122,7 @@ async fn test_join_request_sent() -> Result<()> {
|
||||
|
||||
// Create app offline
|
||||
let mut app = create_test_app_maybe_offline(node_id, ctx.db_path(), None);
|
||||
app.update();
|
||||
update_with_fixed(&mut app);
|
||||
|
||||
// Create and insert GossipBridge
|
||||
let bridge = GossipBridge::new(node_id);
|
||||
@@ -128,7 +136,7 @@ async fn test_join_request_sent() -> Result<()> {
|
||||
|
||||
// Update to trigger send_join_request_once_system
|
||||
// With the peer-wait logic, JoinRequest waits for peers or timeout
|
||||
app.update(); // Start wait timer
|
||||
update_with_fixed(&mut app); // Start wait timer
|
||||
|
||||
// Simulate 1-second timeout (first node case - no peers)
|
||||
{
|
||||
@@ -139,7 +147,7 @@ async fn test_join_request_sent() -> Result<()> {
|
||||
}
|
||||
|
||||
// Update again - should send JoinRequest due to timeout
|
||||
app.update();
|
||||
update_with_fixed(&mut app);
|
||||
|
||||
// Verify JoinRequest was sent by checking JoinRequestSent resource
|
||||
{
|
||||
@@ -393,7 +401,7 @@ async fn test_join_request_waits_for_peers() -> Result<()> {
|
||||
let bridge = GossipBridge::new(node_id);
|
||||
let mut app = create_test_app_maybe_offline(node_id, ctx.db_path(), Some(bridge.clone()));
|
||||
|
||||
app.update();
|
||||
update_with_fixed(&mut app);
|
||||
|
||||
// Transition to Joining
|
||||
{
|
||||
@@ -412,7 +420,7 @@ async fn test_join_request_waits_for_peers() -> Result<()> {
|
||||
|
||||
// Run for 10 frames (~166ms) - should NOT send JoinRequest yet (no peers)
|
||||
for i in 0..10 {
|
||||
app.update();
|
||||
update_with_fixed(&mut app);
|
||||
tokio::time::sleep(Duration::from_millis(16)).await;
|
||||
|
||||
let join_sent = app.world().resource::<libmarathon::networking::JoinRequestSent>();
|
||||
@@ -560,7 +568,7 @@ async fn test_join_request_sends_after_timeout() -> Result<()> {
|
||||
let bridge = GossipBridge::new(node_id);
|
||||
let mut app = create_test_app_maybe_offline(node_id, ctx.db_path(), Some(bridge.clone()));
|
||||
|
||||
app.update();
|
||||
update_with_fixed(&mut app);
|
||||
|
||||
// Transition to Joining
|
||||
{
|
||||
@@ -571,7 +579,7 @@ async fn test_join_request_sends_after_timeout() -> Result<()> {
|
||||
println!("Initial state: Session=Joining, Peers=0");
|
||||
|
||||
// Run one frame to start the wait timer
|
||||
app.update();
|
||||
update_with_fixed(&mut app);
|
||||
|
||||
// Manually set wait_started to 1.1 seconds ago to simulate timeout
|
||||
{
|
||||
@@ -583,7 +591,7 @@ async fn test_join_request_sends_after_timeout() -> Result<()> {
|
||||
}
|
||||
|
||||
// Run one frame - should send JoinRequest due to timeout
|
||||
app.update();
|
||||
update_with_fixed(&mut app);
|
||||
|
||||
{
|
||||
let join_sent = app.world().resource::<libmarathon::networking::JoinRequestSent>();
|
||||
@@ -627,7 +635,7 @@ async fn test_join_request_only_sent_once() -> Result<()> {
|
||||
let bridge = GossipBridge::new(node_id);
|
||||
let mut app = create_test_app_maybe_offline(node_id, ctx.db_path(), Some(bridge.clone()));
|
||||
|
||||
app.update();
|
||||
update_with_fixed(&mut app);
|
||||
|
||||
// Transition to Joining and add a peer
|
||||
{
|
||||
@@ -644,7 +652,7 @@ async fn test_join_request_only_sent_once() -> Result<()> {
|
||||
println!("Initial state: Session=Joining, Peers=1");
|
||||
|
||||
// Run frame - should send JoinRequest
|
||||
app.update();
|
||||
update_with_fixed(&mut app);
|
||||
|
||||
{
|
||||
let join_sent = app.world().resource::<libmarathon::networking::JoinRequestSent>();
|
||||
@@ -678,7 +686,7 @@ async fn test_join_request_only_sent_once() -> Result<()> {
|
||||
|
||||
// Run 20 more frames - should NOT send JoinRequest again
|
||||
for i in 0..20 {
|
||||
app.update();
|
||||
update_with_fixed(&mut app);
|
||||
tokio::time::sleep(Duration::from_millis(16)).await;
|
||||
|
||||
let app_bridge = app.world().resource::<libmarathon::networking::GossipBridge>();
|
||||
|
||||
@@ -95,6 +95,17 @@ struct TestHealth {
|
||||
|
||||
use rusqlite::Connection;
|
||||
|
||||
/// Helper to ensure FixedUpdate and FixedPostUpdate run (since they're on a fixed timestep)
|
||||
fn update_with_fixed(app: &mut App) {
|
||||
use bevy::prelude::{FixedUpdate, FixedPostUpdate};
|
||||
// Run Main schedule (which includes Update)
|
||||
app.update();
|
||||
// Explicitly run FixedUpdate to ensure systems there execute
|
||||
app.world_mut().run_schedule(FixedUpdate);
|
||||
// Explicitly run FixedPostUpdate to ensure delta generation executes
|
||||
app.world_mut().run_schedule(FixedPostUpdate);
|
||||
}
|
||||
|
||||
/// Check if an entity exists in the database
|
||||
fn entity_exists_in_db(db_path: &PathBuf, entity_id: Uuid) -> Result<bool> {
|
||||
let conn = Connection::open(db_path)?;
|
||||
@@ -868,8 +879,8 @@ async fn test_lock_heartbeat_expiration() -> Result<()> {
|
||||
|
||||
// Update to allow lock propagation
|
||||
for _ in 0..10 {
|
||||
app1.update();
|
||||
app2.update();
|
||||
update_with_fixed(&mut app1);
|
||||
update_with_fixed(&mut app2);
|
||||
tokio::time::sleep(Duration::from_millis(100)).await;
|
||||
}
|
||||
|
||||
@@ -899,7 +910,7 @@ async fn test_lock_heartbeat_expiration() -> Result<()> {
|
||||
// Run cleanup system (which removes expired locks and broadcasts LockReleased)
|
||||
println!("Running cleanup to expire locks...");
|
||||
for _ in 0..10 {
|
||||
app2.update();
|
||||
update_with_fixed(&mut app2);
|
||||
tokio::time::sleep(Duration::from_millis(100)).await;
|
||||
}
|
||||
|
||||
@@ -1119,7 +1130,7 @@ async fn test_offline_to_online_sync() -> Result<()> {
|
||||
}
|
||||
|
||||
// Update to trigger delta generation (offline)
|
||||
app1.update();
|
||||
update_with_fixed(&mut app1);
|
||||
tokio::time::sleep(Duration::from_millis(50)).await;
|
||||
|
||||
// Verify clock incremented for spawn
|
||||
@@ -1156,7 +1167,7 @@ async fn test_offline_to_online_sync() -> Result<()> {
|
||||
}
|
||||
}
|
||||
|
||||
app1.update();
|
||||
update_with_fixed(&mut app1);
|
||||
tokio::time::sleep(Duration::from_millis(50)).await;
|
||||
|
||||
let clock_after_second_spawn = {
|
||||
@@ -1179,7 +1190,7 @@ async fn test_offline_to_online_sync() -> Result<()> {
|
||||
}
|
||||
}
|
||||
|
||||
app1.update();
|
||||
update_with_fixed(&mut app1);
|
||||
tokio::time::sleep(Duration::from_millis(50)).await;
|
||||
|
||||
let clock_after_modify = {
|
||||
@@ -1197,7 +1208,7 @@ async fn test_offline_to_online_sync() -> Result<()> {
|
||||
commands.entity(entity_b_bevy).insert(ToDelete);
|
||||
}
|
||||
|
||||
app1.update();
|
||||
update_with_fixed(&mut app1);
|
||||
tokio::time::sleep(Duration::from_millis(50)).await;
|
||||
|
||||
let clock_after_delete = {
|
||||
@@ -1262,8 +1273,8 @@ async fn test_offline_to_online_sync() -> Result<()> {
|
||||
|
||||
// Wait a bit more for tombstone to sync
|
||||
for _ in 0..20 {
|
||||
app1.update();
|
||||
app2.update();
|
||||
update_with_fixed(&mut app1);
|
||||
update_with_fixed(&mut app2);
|
||||
tokio::time::sleep(Duration::from_millis(100)).await;
|
||||
}
|
||||
|
||||
|
||||
@@ -87,6 +87,17 @@ pub fn create_test_app_maybe_offline(node_id: Uuid, db_path: PathBuf, bridge: Op
|
||||
app
|
||||
}
|
||||
|
||||
/// Helper to ensure FixedUpdate and FixedPostUpdate run (since they're on a fixed timestep)
|
||||
fn update_with_fixed(app: &mut App) {
|
||||
use bevy::prelude::{FixedUpdate, FixedPostUpdate};
|
||||
// Run Main schedule (which includes Update)
|
||||
app.update();
|
||||
// Explicitly run FixedUpdate to ensure systems there execute
|
||||
app.world_mut().run_schedule(FixedUpdate);
|
||||
// Explicitly run FixedPostUpdate to ensure delta generation executes
|
||||
app.world_mut().run_schedule(FixedPostUpdate);
|
||||
}
|
||||
|
||||
/// Wait for sync condition to be met, polling both apps
|
||||
pub async fn wait_for_sync<F>(
|
||||
app1: &mut App,
|
||||
@@ -102,8 +113,8 @@ where
|
||||
|
||||
while start.elapsed() < timeout {
|
||||
// Tick both apps
|
||||
app1.update();
|
||||
app2.update();
|
||||
update_with_fixed(app1);
|
||||
update_with_fixed(app2);
|
||||
tick_count += 1;
|
||||
|
||||
if tick_count % 50 == 0 {
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
[package]
|
||||
name = "xtask"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
edition.workspace = true
|
||||
publish = false
|
||||
|
||||
[dependencies]
|
||||
anyhow = "1.0"
|
||||
clap = { version = "4.5", features = ["derive"] }
|
||||
tracing = "0.1"
|
||||
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
|
||||
anyhow.workspace = true
|
||||
clap.workspace = true
|
||||
tracing.workspace = true
|
||||
tracing-subscriber.workspace = true
|
||||
|
||||
Reference in New Issue
Block a user