AppImage / appimage.github.io

Given an URL to an AppImage, the GitHub action in this project inspects the AppImage and puts it into a community-maintained catalog
https://appimage.github.io/
Other
306 stars 551 forks source link

Screenshots for SDL-based games #75

Open probonopd opened 7 years ago

probonopd commented 7 years ago

Looks like SDL2-based games currently fail because they are neither command line tools (which we screenshot in xterm) nor have X windows that we could screenshot.

Example: https://travis-ci.org/AppImage/appimage.github.io/builds/273569975?utm_source=github_status&utm_medium=notification

We should find a way to screenshot these. PRs welcome.

probonopd commented 4 years ago

With ImageMagick, getting

convert: unable to read X window image `0x200013': Resource temporarily unavailable @ error/xwindow.c/XImportImage/5005.

convert: no images defined `database/Planet_Blupi/screenshot.png' @ error/convert.c/ConvertImageCommand/3210.

* * * SUCCESS :-) * * *

Could not take a screenshot png file

https://github.com/AppImage/appimage.github.io/pull/2223

Mailaender commented 3 years ago

Trying to debug https://github.com/AppImage/appimage.github.io/pull/2457

xwininfo -tree -root 

xwininfo: Window id: 0x1db (the root window) (has no name)

  Root window id: 0x1db (the root window) (has no name)
  Parent window id: 0x0 (none)
     91 children:
     [...]
     0x2a0009e (has no name): ()  1700x987+110+57  +110+57
        1 child:
        0x2a0009f (has no name): ()  1700x950+0+37  +110+94
           1 child:
           0x640000b "OpenRA": ("dotnet" "dotnet")  1700x950+0+0  +110+94

magick import -window 0x2a0009e screen.png

Works locally with some distortions, so you may need to wait for the window to appear first. If it is possible to run OpenGL based games in that headless build environment at all.

image

However, this automatically generates a screenshot of an empty main menu that is in no way representative of the game. I suggest using the ones defined in the .appdata.xml instead for display.

probonopd commented 3 years ago

Yes, the screenshots in AppData always override the ones we take. But our screenshot taking still needs to produce a screenshot, or else we consider the test failed.

Mailaender commented 3 years ago

I tried https://askubuntu.com/questions/1098769/import-unable-to-read-x-window-image-resource-temporarily-unavailable but it seems all builds are failing at the moment for a different reason so I can't really test anything.

Mailaender commented 1 month ago

Still does not work https://github.com/AppImage/appimage.github.io/pull/3399

probonopd commented 1 month ago

Yes, unfortunately I don't know how I could fix this. Any hints (even better: pull requests) are welcome.

Mailaender commented 1 month ago

I'd suggest you change the validation strategy to not require taking screenshots in a headless environment or you switch to a server with a desktop, RDP into it, run the program as some kind of UI test using Jenkins and take a screenshot there. That might become less like a giant unmaintainable shell script, but is also not easy to set up and secure.

probonopd commented 3 weeks ago

Well. We have no hardware nor infrastructure in the project besides what GitHub provides, and we don't want the burden of having to maintain that either. So for now unfortunately we can only do what can be done using GitHub provided infrastructure. Happy to look into this if someone has some idea, but currently I don't have promising ideas regarding this topic myself.

Mailaender commented 3 weeks ago

You can still make taking a screenshot optional for SDL based applications.