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

hacks for running (and screenshotting) the examples in CI on a github runner #9220

Merged

Conversation

mockersf
Copy link
Member

Objective

  • Enable capturing screenshots of all examples in CI on a GitHub runner

Solution

  • Shorten duration of a run
  • Disable desktop_app mode - as there isn't any input in CI, examples using this take way too long to run
  • Change the default ClusterConfig - the runner are not able to do all the clusters with the default settings
  • Send extra WindowResized events - this is needed only for the split_screen example, because CI doesn't trigger that event unlike all the other platforms

@mockersf mockersf added A-Build-System Related to build systems or continuous integration C-Examples An addition or correction to our examples labels Jul 20, 2023
Copy link
Contributor

@nicopap nicopap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better if sed was replaced with git patch and patch files (inline would be fine).

Otherwise this would run the risk of breaking silently (git patch does fail noisily)

@mockersf
Copy link
Member Author

moved to git patch, thanks for the idea! it makes it a lot clearer than my sed commands

Copy link
Contributor

@rparrett rparrett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm assuming that this has been pretty well tested over at https://vleue.com/bevy-example-tests/ by this point?

Couple pieces of non-blocking feedback / future ideas while playing with this locally:

  • It would be cool if there was a mode that exited immediately after screenshotting. Probably harder than it sounds with screenshotting happening in an async task in the render app?
  • It would be cool if we could patch such that newly created windows do not steal focus. I can't seem to make this work on macos and opened macos: create unfocused window rust-windowing/winit#3072

@mockersf mockersf force-pushed the example-showcase-can-remove-desktop-mode branch from efbaa15 to fcdd04d Compare September 9, 2023 00:26
@mockersf
Copy link
Member Author

I would like to merge this PR before the 0.12 to write a more complete story for the blog post. It already has the two approvals needed, but the last commit hasn't been reviewed yet. It adds a patch for window creation to ensure its position is always the same on windows, to be able to have a predictable cursor position in the window.

@rparrett or @nicopap (or someone else), could you give this a new approval? thanks!

Copy link
Contributor

@rparrett rparrett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still looking good to me. Have been using this PR in my own "local testing infrastructure."

@mockersf mockersf added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Oct 13, 2023
@mockersf mockersf added this pull request to the merge queue Oct 13, 2023
@mockersf
Copy link
Member Author

thanks!

Merged via the queue into bevyengine:main with commit 8b88887 Oct 13, 2023
22 checks passed
ameknite pushed a commit to ameknite/bevy that referenced this pull request Nov 6, 2023
… runner (bevyengine#9220)

# Objective

- Enable capturing screenshots of all examples in CI on a GitHub runner

## Solution

- Shorten duration of a run
- Disable `desktop_app` mode - as there isn't any input in CI, examples
using this take way too long to run
- Change the default `ClusterConfig` - the runner are not able to do all
the clusters with the default settings
- Send extra `WindowResized` events - this is needed only for the
`split_screen` example, because CI doesn't trigger that event unlike all
the other platforms

---------

Co-authored-by: Rob Parrett <robparrett@gmail.com>
rdrpenguin04 pushed a commit to rdrpenguin04/bevy that referenced this pull request Jan 9, 2024
… runner (bevyengine#9220)

# Objective

- Enable capturing screenshots of all examples in CI on a GitHub runner

## Solution

- Shorten duration of a run
- Disable `desktop_app` mode - as there isn't any input in CI, examples
using this take way too long to run
- Change the default `ClusterConfig` - the runner are not able to do all
the clusters with the default settings
- Send extra `WindowResized` events - this is needed only for the
`split_screen` example, because CI doesn't trigger that event unlike all
the other platforms

---------

Co-authored-by: Rob Parrett <robparrett@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Build-System Related to build systems or continuous integration C-Examples An addition or correction to our examples S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants