-
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
2.0: test_sidebar
failing on macOS in headless environment
#3674
Comments
Well, the test program should test the result of My personal approach would be to return fail unless the whole test ran, and environments where the test cannot run need to disable it. |
I was thinking it could work with |
IIUC the call to |
You can return
If it turns out to be necessary, you could just set a variable, e.g. Footnotes |
I guess if "somebody" made a PR it would get accepted. |
On headless systems you should run the tests under Xephyr or something similar. That would be preferable over skipping the tests. That's what I do when I build geany on my local Jenkins instance. |
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.[2][3] Fixes geany#3674 [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
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.[2][3] 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
@kugel- Based on e.g. here: "Xephyr is a nested X server that runs as an X application." So using that would require an existing X server in the first place? At any rate, I think such an approach can be a good solution and it's good that you do this, it's just overkill to add downstream just for that one test. I proposed an implementation of what I had in mind here and hope it could be considered :) The return value of |
Sorry, I mixed it up. I mean Xvfb. That's a pure software emulated X environment. Why do you execute the tests at all? |
Thanks.
Basically, I saw no reason to disable anything inside Geany's test suite until now, or disabling running the test suite altogether (but then again, it's only since a couple months that I'm active to some degree in nixpkgs). It was enabled since Geany's initial addition to nixpkgs and seems to have been fine since.12 The rest is just me liking to get to the bottom of things sometimes. ^^; I think it doesn't hurt to run Geany's suite in nixpkgs as it's relatively quick and lightweight—as long as it doesn't break things and cause additional maintenance burden. Footnotes
|
I still recommend Xvfb. Geany is a GTK program, so you can expect that future tests will also require successful GTK initialization. But a PR that skips the test would probably be accepted. Do you know if the |
It should work: https://mesonbuild.com/Unit-tests.html#skipped-tests-and-hard-errors But it's not a "trick", it's the GNU standard approach (as mentioned there). |
Yeah, thanks. I will consider it. Other builds in nixpkgs are already using it in their Edit: Footnotes |
@kugel-: the approach works with Geany's Meson-based build too: #3676 (comment) |
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
Hi, I'm working on updating the Geany package in nixpkgs from 1.38 to 2.0: NixOS/nixpkgs#265362.
With Geany 2.0,
tests/test_sidebar.c
fails on nixpkgs' automatic PR builder (ofborg) on macOS, but not on macOS locally - presumably due to the environment being headless in the former case. On Linux,test_sidebar
succeeds both locally and on the builder. The issue would likely show up on Hydra as well, our central CI service, and would cause us to introduce workarounds that are probably avoidable.The return value of
gtk_init_check
here is never examined. https://docs.gtk.org/gtk3/func.init_check.html says:"Note that calling any GTK function or instantiating any GTK type after this function returns FALSE results in undefined behavior."
Maybe it returns FALSE on Linux in this scenario (too)?
Could you please take a look at this? I can't really gauge what it would take to make the test run properly on Darwin in a headless environment (if possible). Worst case the test could skip itself and emit an appropriate message if GTK can't initialize, which would still be better than downstream having to explicitly work around it.
The build log for
x86_64-darwin
with the failing test can be viewed here. I attached it here in case that link becomes inaccessible: geany_2.0_x86_64-darwin_ofborg_buildlog.txtThe text was updated successfully, but these errors were encountered: