-
Notifications
You must be signed in to change notification settings - Fork 123
gopts, quickdump, specload: tests fail #2856
Comments
The
For No idea, why |
Yes, but it is wrong to expect binaries in the build directory after the application was installed. The binaries should be installed and searched in either build or installation directory. |
Oh, I missed that you installed Elektra. However, that doesn't explain the I am also not sure how to solve this problem. Of course we can install the executables of the test apps, but the actual test executables would have to be modified during install time to change where they look for the test app. |
It is too much work to search for the binaries (in either build or installed dir), we can also exclude the tests from being installed. |
We could simply use a relative path and ensure that it remains the same during install, e.g. have both binaries in the same directory. |
Yes, good idea. A more general solution would be if we have |
Tests can easily be executed via |
Turns out this is harder than expected. The stdlib would treat the relative path as relative to the current working directory, which is not helpful and resolving the path relative to the current executable's path is not possible in a platform independent way. |
Thus the For the installation it is enough to install it to TARGET_TOOL_EXEC_FOLDER Only during build time we need some way to combine build_dir/bin build_dir/scripts source_dir/scripts and the current directories (maybe also both build+source). |
@kodebach is this still open? Can we many detect this situation and let the tests not run in this situation? Or we fix it: KDB_EXEC_PATH now allows multiple paths, so we could add whatever folders we need from the build/source directory. Then you simply let |
AFAIK this is still open, yes. We already have the function |
And simply adding the bindir to KDB_EXEC_PATH and using |
No, for a few reasons:
|
Yes, I agree. It is good if they work standalone.
Shellrecorder tests already use kdb, and they work for both installed Elektra and from the build directory (even if Elektra is installed).
No, KDB_EXEC_PATH is not set for an installed kdb (unless the user sets it) |
That works because shell tests always execute
I just took the master version of Elektra and installed it. The file export KDB_EXEC_PATH="/home/klemens/libelektra/build/bin:$KDB_EXEC_PATH" Of course this doesn't affect |
@petermax2 @kodebach what is the status of this issue? Is as #3246 is fixed now (via #3409), the rest of this issue only packaging problems or is there something left to be implemented? |
AFAIK the original issue with |
At the moment we do not have an option to disable installing tests but we could make a local override to make
😉, there are plenty of differences, but most of them were related to the plugin system itself (They are hopefully all fixed by now). But still, there is a large range of possible dependency problems and installation problems so running the testmod tests in the installed state is much better than running nothing. But you are right that if there is a shellrecorder test, the testmod test is useless.
|
@markus2330 Does the quickdump problem still occur for you? AFAIK we never figured out what was wrong there. I also couldn't reproduce it. For gopts and specload see #3618 |
Yes, still occurs:
Or when I call it from source:
Stacktrace:
|
When running tests directly please use In this case, I think Does If so, please add output_error (setKey);
output_warnings (setKey); in
|
Yes, the problem is that the test cases try to create temporary files into a folder not suitable for that. |
We can change that yes, but many tests don't run without |
Which tests are you talking about? I always run the whole suite without sudo (but with write permissions to Elektra's path). testmod_quickdump is afaik the only test with that problem. |
Okay well that works too, but on a standard system those paths are root access only. I still think the whole concept of running unit tests in an installed version of Elektra is weird and the quickdump issue is purely a user rights issue not a bug, but I'll change the path in #3618. |
I have now updated the code in #3618. I also found similar code in
|
It is a violation of FHS, applications are not supposed to write to /usr, it even might be read-only. For writing we should only use tempfiles and we should also clean them up after the tests finished. |
I mark this issue stale as it did not have any activity for one year. I'll close it in two weeks if no further activity occurs. If you want it to be alive again, ping the issue by writing a message here or create a new issue with the remainder of this issue. |
I closed this issue now because it has been inactive for more than one year. If I closed it by mistake, please do not hesitate to reopen it or create a new issue with the remainder of this issue. |
Steps to Reproduce the Problem
Compile and install Elektra, remove (or rename) the source/build directory. Then run
kdb run_all
Expected Result
All test cases should run successfully.
Actual Result
System Information
Further Information
Please also add a test to the build server which runs the tests after source/build directories are removed.
The text was updated successfully, but these errors were encountered: