Closed penguinpee closed 10 months ago
Could you upload the file mentioned on the last line (/builddir/build/BUILD/brewtarget-3.0.9/redhat-linux-build/meson-logs/testlog.txt
)? It usually shows the reason for the failure, or at least gives a better clue. I'd guess it's probably some shared library issue or something else environmental if all the tests failed, but let's see.
I didn't see anything in the file as to a hint why it failed, but here it is: testlog.txt
The inherited environment is the default build environment. If needed it can tweaked to some extend.
Ah, that's interesting. What happens if you run one of the tests directly from the command line? Eg, in the mbuild
directory, try ./brewtarget_tests pstdintTest
This happens:
sh-5.2# ./brewtarget_tests pstdintTest
qt.qpa.xcb: could not connect to display
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.
Aborted (core dumped)
And, of course, that's because there's no graphical session in the build environment. I'll check with folks here what I can / should do about it. I suppose all of the tests require it.
That would explain why it's all the tests that are failing without any log output. I don't know whether it helps, but the GitHub actions for Brewtarget (eg https://github.com/Brewtarget/brewtarget/blob/develop/.github/workflows/linux-ubuntu.yml) manage to run the tests in a (presumably) headerless environment. Not sure how that compares with the set-up you're using though.
That's using CMake for the tests, but that shouldn't matter.
I guess I need to setup the environment a bit before running the tests. I'll provide feedback once I found out.
We also run the tests in Meson: https://github.com/Brewtarget/brewtarget/blob/e5dc7bad92c6ff27cbd96f8206ef0aa54e621733/.github/workflows/linux-ubuntu.yml#L115
If you have a look at the installDependencies()
function in the bt
Python script (see https://github.com/Brewtarget/brewtarget/blob/e5dc7bad92c6ff27cbd96f8206ef0aa54e621733/bt#L417) it shows all the environment set-up we do on Ubuntu, Windows and Mac. Hopefully that gives good clues for what's needed on Fedora.
Excellent! I'll take a look. I also asked around among fellow fedora packagers.
I finally got around to continue on that. It seems in our very confined build chroot, the way to go is xvfb-run
(in Fedora that's part of xorg-x11-server-Xvfb
). which runs a command in a graphical environment. Thanks to @sanjayankur31 for pointing me in that direction.
I was able to run the tests and they all passed except for testLogRotation
. Since there's no easy way, it seems, to exclude tests using meson, is there a way I can configure where the test wants to rotate log files?
Glad you managed to get the tests to run.
We actually ask Qt to give us a suitable temporary directory for log files etc for the unit tests. It should normally be /tmp
on Linux. We then create a sub-directory inside based on the thread ID, and put all our log files in there. (This allows multiple tests to run in parallel with different thread IDs.) According to the Qt documentation, you can set the TMPDIR
environment variable to tell Qt to use a different directory than /tmp
so that would be the next thing to try if your build/test environment doesn't have access to /tmp
, which I guess could well be the case in a chroot environment.
I tried with setting TMPDIR
and I have seen the directory being mentioned in the log messages. Yet testLogRotation
still fails. Since I've found a way [^1] of disabling this one test, I guess I won't put any more work into getting this to work.
Thanks for all your assistance! :beers:
[^1]: sed -i -e '/testLogRotation/d' meson.build
- crude but effective :wink:
Are the tests supposed to work when run with
/usr/bin/meson test
?I'm not an expert on Meson nor testing in C++. I'm relying on Meson RPM macros which expands to above command plus options specific to the build environment. I get the following result: