Support user interaction in ci_testing
#13512
Labels
A-Build-System
Related to build systems or continuous integration
A-Input
Player input via keyboard, mouse, gamepad, and more
C-Enhancement
A new feature
C-Testing
A change that impacts how we test Bevy or how users test their apps
D-Modest
A "normal" level of difficulty; suitable for simple features or challenging fixes
X-Uncontroversial
This work is generally agreed upon
What problem does this solve or what need does it fill?
We test examples using Github Actions, but interacting with these examples while they are running is hard. Github Action runners don't have a keyboard and mouse, nor an actual monitor. We want to test the majority of examples, but are limited to examples that do not require any sort of user interaction.
What solution would you like?
We use
bevy_dev_tools
'sci_testing
module to specify automated actions that should be run, such as to take a screenshot at a specific frame. These actions are specified by theCiTestingEvent
enum:bevy/crates/bevy_dev_tools/src/ci_testing.rs
Lines 42 to 47 in 383314e
As brought up by @mockersf in a recent presentation, this enum is lacking additional features that would enable greater interaction. Some ideas for additional features, sorted by usefulness, are:
KeyboardInput
MouseButtonInput
GamepadEvent
TouchInput
I propose
KeyboardInput
is added toCiTestingEvent
so that we can test keyboard interactions in CI. If that is successful, we can re-evaluate whether the other 3 are useful and worth implementing.What alternative(s) have you considered?
I think that specifying actions using
ci_testing
is the right direction, thought the list of supported actions is currently very weak. By not implementing this feature, we leave the testing framework underpowered. Testing is one of the best ways to ensure quality, which Rust and Bevy by extension have a reputation for. This is why I believe not implementing user inputs is not an option, though the method used to achieve may vary.The reason I propose to only support keyboards in the very beginning is because they are very easy to implement, and likely the most useful. The mouse is difficult without moving it, which works on offsets. The gamepad and touch are more obscure are difficult to verify locally without the proper hardware.
The text was updated successfully, but these errors were encountered: