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

CI testing: don't crash if screenshot manager resource is not available #12385

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 9 additions & 3 deletions crates/bevy_dev_tools/src/ci_testing.rs
Expand Up @@ -3,8 +3,9 @@
use bevy_app::{App, AppExit, Update};
use bevy_ecs::{
entity::Entity,
prelude::Resource,
prelude::{resource_exists, Resource},
query::With,
schedule::IntoSystemConfigs,
system::{Local, Query, Res, ResMut},
};
use bevy_render::view::screenshot::ScreenshotManager;
Expand Down Expand Up @@ -67,8 +68,13 @@ pub(crate) fn setup_app(app: &mut App) -> &mut App {
)));
}

app.insert_resource(config)
.add_systems(Update, (ci_testing_exit_after, ci_testing_screenshot_at));
app.insert_resource(config).add_systems(
Update,
(
ci_testing_exit_after,
ci_testing_screenshot_at.run_if(resource_exists::<ScreenshotManager>),
),
);

app
}
Expand Down