Skip to content
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

gopts, quickdump, specload: tests fail #2856

Open
markus2330 opened this issue Aug 4, 2019 · 9 comments

Comments

@markus2330
Copy link
Contributor

commented Aug 4, 2019

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

Running testmod_gopts

GOPTS     TESTS
==================

test empty
GOPTS     TESTS
==================

test empty
/home/jenkins/workspace/libelektra_master-Q2SIBK3KE2NBEMJ4WVGJXAXCSCB77DUBUULVLZDKHQEV3WNDXBMA/libelektra/src/plugins/gopts/testmod_gopts.c:78: error in run_test: child process test failed
test singleopt
/home/jenkins/workspace/libelektra_master-Q2SIBK3KE2NBEMJ4WVGJXAXCSCB77DUBUULVLZDKHQEV3WNDXBMA/libelektra/tests/cframework/tests.c:523: error in clean_temp_home: Could not delete TMPHOME via nftw
GOPTS     TESTS
==================
Running testmod_quickdump
QUICKDUMP     TESTS
==================

test varint
test basics
/home/jenkins/workspace/libelektra_master-Q2SIBK3KE2NBEMJ4WVGJXAXCSCB77DUBUULVLZDKHQEV3WNDXBMA/libelektra/src/plugins/quickdump/testmod_quickdump.c:111: error in test_basics: call to kdbSet was not successful

Program received signal SIGSEGV, Segmentation fault.
_IO_getc (fp=0x0) at getc.c:37
37      getc.c: Datei oder Verzeichnis nicht gefunden.
(gdb) bt
#0  _IO_getc (fp=0x0) at getc.c:37
#1  0x0000555555556bb7 in compare_binary_files (filename1=<optimized out>, filename2=<optimized out>) at ./src/plugins/quickdump/testmod_quickdump.c:31
#2  0x0000555555556f9a in test_basics () at ./src/plugins/quickdump/testmod_quickdump.c:113
#3  0x0000555555556807 in main (argc=1, argv=0x7fffffffe278) at ./src/plugins/quickdump/testmod_quickdump.c:332
Running testmod_specload

SPECLOAD     TESTS
==================

test basics
/home/jenkins/workspace/libelektra_master-Q2SIBK3KE2NBEMJ4WVGJXAXCSCB77DUBUULVLZDKHQEV3WNDXBMA/libelektra/src/plugins/specload/testmod_specload.c:63: error in test_basics: call to checkConfig was not successful
There are 1 warnings
buffer is: warnings/#00
number: C01330
description: Plugin Misbehavior
module: kdb
file: /home/jenkins/workspace/libelektra_master-Q2SIBK3KE2NBEMJ4WVGJXAXCSCB77DUBUULVLZDKHQEV3WNDXBMA/libelektra/src/libs/elektra/plugin.c
line: 302
reason: Open of plugin returned unsuccessfully: specload. Reason contains plugin, see other warnings for details
reason: 
reason: 
/home/jenkins/workspace/libelektra_master-Q2SIBK3KE2NBEMJ4WVGJXAXCSCB77DUBUULVLZDKHQEV3WNDXBMA/libelektra/src/plugins/specload/testmod_specload.c:65: error in test_basics: warnings in kdbOpen for plugin specload
number: C01100
description: : Resource
module: : specload
at: /home/jenkins/workspace/libelektra_master-Q2SIBK3KE2NBEMJ4WVGJXAXCSCB77DUBUULVLZDKHQEV3WNDXBMA/libelektra/src/plugins/specload/specload.c:372
reason: : App '/home/jenkins/workspace/libelektra_master-Q2SIBK3KE2NBEMJ4WVGJXAXCSCB77DUBUULVLZDKHQEV3WNDXBMA/libelektra/obj-x86_64-linux-gnu/bin/elektra-specload-testapp' doesn't exist or is not executable
mountpoint: : 
configfile: : 
/home/jenkins/workspace/libelektra_master-Q2SIBK3KE2NBEMJ4WVGJXAXCSCB77DUBUULVLZDKHQEV3WNDXBMA/libelektra/src/plugins/specload/testmod_specload.c:65: error in test_basics: error in kdbOpen for plugin specload
/home/jenkins/workspace/libelektra_master-Q2SIBK3KE2NBEMJ4WVGJXAXCSCB77DUBUULVLZDKHQEV3WNDXBMA/libelektra/src/plugins/specload/testmod_specload.c:65: fatal in test_basics: could not open specload plugin
error: testmod_specload

System Information

  • Elektra Version: master

Further Information

Please also add a test to the build server which runs the tests after source/build directories are removed.

@markus2330 markus2330 added this to the 0.9.1 milestone Aug 4, 2019

@kodebach

This comment has been minimized.

Copy link
Contributor

commented Aug 5, 2019

The specload test failure is pretty explicit:

reason: : App '/home/jenkins/workspace/libelektra_master-Q2SIBK3KE2NBEMJ4WVGJXAXCSCB77DUBUULVLZDKHQEV3WNDXBMA/libelektra/obj-x86_64-linux-gnu/bin/elektra-specload-testapp' doesn't exist or is not executable

For quickdump I can't say exactly what is wrong, but it fails somewhere in elektraQuickdumpSet. There should be an error set in setKey, but it is not logged I think (that should probably be changed).

No idea, why gopts fails. Since no error message was printed, I suspect the testapp elektra-gopts-testapp couldn't be executed (its the only case where no error message would be printed). It would also be in line with the specload error.

@markus2330

This comment has been minimized.

Copy link
Contributor Author

commented Aug 5, 2019

The specload test failure is pretty explicit:

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.

@kodebach

This comment has been minimized.

Copy link
Contributor

commented Aug 5, 2019

The specload test failure is pretty explicit:

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 quickdump failure, its test data is installed correctly.

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.

@markus2330

This comment has been minimized.

Copy link
Contributor Author

commented Aug 5, 2019

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.

@kodebach

This comment has been minimized.

Copy link
Contributor

commented Aug 5, 2019

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.

@markus2330

This comment has been minimized.

Copy link
Contributor Author

commented Aug 5, 2019

Yes, good idea.

A more general solution would be if we have kdb <command> available also in the build directory (currently only works if Elektra is installed). It would be quite some work as KDB_EXEC_PATH only supports one path but the binaries are scattered in many different parts of the build directory.

@kodebach

This comment has been minimized.

Copy link
Contributor

commented Aug 5, 2019

we have kdb available also in the build directory

Tests can easily be executed via ctest and/or make. As for the other commands, most of them only make sense for an installed version of Elektra anyway.

kodebach added a commit to kodebach/libelektra that referenced this issue Aug 5, 2019

@kodebach

This comment has been minimized.

Copy link
Contributor

commented Aug 5, 2019

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.

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.

@kodebach kodebach referenced this issue Aug 5, 2019
0 of 14 tasks complete
@markus2330

This comment has been minimized.

Copy link
Contributor Author

commented Aug 5, 2019

Thus the kdb <command> way would be quite attractive.

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 added a commit to kodebach/libelektra that referenced this issue Aug 9, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.