Skip to content

Commit 4a1d0dd

Browse files
mockersfspectria-limina
authored andcommitted
CI testing: don't crash if screenshot manager resource is not available (#12385)
# Objective - After #12370, ci testing with minimal plugins doesn't hang but it crash as the resource `ScreenshotManager` doesn't exist ## Solution - Check if the resource exists
1 parent 8624f1f commit 4a1d0dd

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

crates/bevy_dev_tools/src/ci_testing.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
use bevy_app::{App, AppExit, Update};
44
use bevy_ecs::{
55
entity::Entity,
6-
prelude::Resource,
6+
prelude::{resource_exists, Resource},
77
query::With,
8+
schedule::IntoSystemConfigs,
89
system::{Local, Query, Res, ResMut},
910
};
1011
use bevy_render::view::screenshot::ScreenshotManager;
@@ -67,8 +68,13 @@ pub(crate) fn setup_app(app: &mut App) -> &mut App {
6768
)));
6869
}
6970

70-
app.insert_resource(config)
71-
.add_systems(Update, (ci_testing_exit_after, ci_testing_screenshot_at));
71+
app.insert_resource(config).add_systems(
72+
Update,
73+
(
74+
ci_testing_exit_after,
75+
ci_testing_screenshot_at.run_if(resource_exists::<ScreenshotManager>),
76+
),
77+
);
7278

7379
app
7480
}

0 commit comments

Comments
 (0)