-
Notifications
You must be signed in to change notification settings - Fork 587
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
Skip tests/test_sidebar
if GTK initialisation fails
#3676
base: master
Are you sure you want to change the base?
Conversation
Looking at the Automake-based Linux build logs here:
And from the Meson-based Linux build log:
So GTK initialisation fails (as expected, due to the headless environment) and the proposed change is working as intended with both build systems. Making display-requiring tests work in CI would call for something like Xvfb, or a more modern alternative based on a headless Wayland/XWayland server, as mentioned in the linked issue. But |
https://www.geany.org/documentation/releasenotes/2.0/ Upstream now supports building via Meson, which is declared experimental at the time of writing; Autotools is still the default. [1] The correct license for Geany is GPL-2.0-or-later, as indicated by [2]. Add a patch that disables `test_sidebar` because it runs into undefined behavior in headless environments, and crashes at least on headless Darwin. The patch can be removed if [3] is merged (or the issue fixed otherwise). [1] https://github.com/geany/geany/pull/2761/commits [2] https://github.com/geany/geany/tree/2.0.0#license [3] geany/geany#3676
https://www.geany.org/documentation/releasenotes/2.0/ Upstream now supports building via Meson, which is declared experimental at the time of writing; Autotools is still the default. [1] The correct license for Geany is GPL-2.0-or-later, as indicated by [2]. Add a patch that disables `test_sidebar` because it runs into undefined behavior in headless environments, and crashes at least on headless Darwin. The patch can be removed if [3] is merged (or the issue fixed otherwise). [1] https://github.com/geany/geany/pull/2761/commits [2] https://github.com/geany/geany/tree/2.0.0#license [3] geany/geany#3676
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks reasonable, at least better than the finger crossing we had before.
However, skipping the test is clearly not ideal, and using xvfb-run/xwfb-run would probably be better, but might be OK as a future improvement.
This may happen in headless environments. The return value of `gtk_init_check` was not examined before; according to [1], "calling any GTK function or instantiating any GTK type after this function returns FALSE results in undefined behavior." The value 77 can be returned to tell Automake and Meson that the test was skipped.[2][3][4] Fixes geany#3674 [1] https://docs.gtk.org/gtk3/func.init_check.html [2] https://www.gnu.org/software/automake/manual/automake.html#index-Exit-status-77_002c-special-interpretation [3] https://docs.gtk.org/glib/func.test_run.html [4] https://mesonbuild.com/Unit-tests.html#skipped-tests-and-hard-errors
2670354
to
a7b4dbb
Compare
If nobody beats me to it, I might propose a change to |
Trying to build geany for void linux test_sidebar.log:
Not sure if is same issue, but posting here as related. Tried to make patches from this and nix packaging, but no luck. Any suggestions? PS: Thanks for geany ❤️ |
I opted for an X based solution with xvfb-run as that can easily be installed via the official Ubuntu repositories that the workflow already relies on. The MinGW and macOS builds were out of scope, as the former doesn't run tests and the latter is not defined here (and xvfb-run doesn't work on Darwin).
See 65d4b66. I opted for an X based solution with The Mingw and macOS builds were out of scope, as the former doesn't run tests and the latter is not defined here (and xvfb-run doesn't work on Darwin). @zen0bit: Sorry, I have no experience with Void Linux ^^; You might get more exposure by posting this as a separate issue. You could still link it to this PR and the accompanying issue. |
@b4n CI no longer skips |
Just to clarify regarding the behavior @zen0bit noticed, Void sets |
@oreo639 this is a pull request that fixes an issue with a single test, it is not an issue, please do not hijack it. As suggested above please raise a separate issue |
I'm trying to clarify that the behavior noticed isn't related to this PR and isn't an issue, sorry for the noise. |
This may happen in headless environments.
The return value of
gtk_init_check
was not examined before; according to 1, "calling any GTK function or instantiating any GTK type after this function returns FALSE results in undefined behavior."The value 77 can be returned to tell Automake that the test was skipped.23
This should work on Meson too4, but I have not tested this here.
Based on the example here, I assumed that Autotools would mark
test_sidebar
asSKIP
if all test cases inside are marked as skipped usingg_test_skip
despite the return value being0
, but with the way it is plugged together (each binary being one test from the view of the harness without regard for the more granular test cases inside), this doesn't work without further ado:test_sidebar.log
:test_sidebar.trs
:geany-2.0/tests $ env TESTS="test_sidebar" make -e check SUBDIRS=
However, returning
77
, as proposed here, works as intended:test_sidebar.log
:test_sidebar.trs
:geany-2.0/tests $ env TESTS="test_sidebar" make -e check SUBDIRS=
Fixes #3674
Footnotes
https://docs.gtk.org/gtk3/func.init_check.html ↩
https://www.gnu.org/software/automake/manual/automake.html#index-Exit-status-77_002c-special-interpretation ↩
https://docs.gtk.org/glib/func.test_run.html ↩
https://mesonbuild.com/Unit-tests.html#skipped-tests-and-hard-errors ↩