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
This commit is contained in:
parent
7546624471
commit
8e467f4cad
@ -3,8 +3,9 @@
|
|||||||
use bevy_app::{App, AppExit, Update};
|
use bevy_app::{App, AppExit, Update};
|
||||||
use bevy_ecs::{
|
use bevy_ecs::{
|
||||||
entity::Entity,
|
entity::Entity,
|
||||||
prelude::Resource,
|
prelude::{resource_exists, Resource},
|
||||||
query::With,
|
query::With,
|
||||||
|
schedule::IntoSystemConfigs,
|
||||||
system::{Local, Query, Res, ResMut},
|
system::{Local, Query, Res, ResMut},
|
||||||
};
|
};
|
||||||
use bevy_render::view::screenshot::ScreenshotManager;
|
use bevy_render::view::screenshot::ScreenshotManager;
|
||||||
@ -67,8 +68,13 @@ pub(crate) fn setup_app(app: &mut App) -> &mut App {
|
|||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
|
|
||||||
app.insert_resource(config)
|
app.insert_resource(config).add_systems(
|
||||||
.add_systems(Update, (ci_testing_exit_after, ci_testing_screenshot_at));
|
Update,
|
||||||
|
(
|
||||||
|
ci_testing_exit_after,
|
||||||
|
ci_testing_screenshot_at.run_if(resource_exists::<ScreenshotManager>),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
app
|
app
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user