In this post, we'll take a look at:
This week I implemented CMake testing configuration and fixed most of the tests. As of now all but 5 tests are working fine.
Week 9 Progress #
Testing configuration for all agents added
Discussions #
- I suspect that the Ojo regression test’s expected data file is
outdated
- Michael said that on their internal Jenkins CI, these tests are not being run currently, so this might be possible that the file is outdated.
- Since some of the tests need Makefile to install while testing,
CMake generated Makefiles and test Makefiles are conflicting, and
hence we are forced to use Ninja for testing. What can I do about
it?
- Michael suggested using
--file=filename
flag with the make command and change the name of the test Makefile to something else. This will solve the problem.
- Michael suggested using
- Mimetype is detecting executables as shared lib, is that expected or
needs to be fixed?
- Mimetype internally depends on the file command to get the mime-type. If the output of the file command is also the same then it is okay.
- What is
folderlist
in https://github.com/fossology/fossology/blob/master/src/delagent/agent_tests/Functional/ft_cliDelagentTest.php#L126 ?folderlist
is a view. UsecreateViews()
function.
- Suggestions/Changes from Gaurav for fixing phpunit tests.
- Please note the changes in
setUp()
function insrc/lib/php/tests/test_common_license_file.php
- The test database name is given to the constructor of TestPgDb and
can be anything as it gets deleted in
teardown()
- The
dbmanager
is provided by the object, no need to initialize globalPG_CONN
(it will be exposed by the library in case some of the functions need it). - All the tables needs to be explicitly mentioned to
createPlainTables()
and their correspondingcreateSequences()
(you can get them using\d tablename
from existing DB easily. Then call thealterTables()
to update the sequence. (I am not sure ifcreateConstraints()
is required at all, try to remove) tearDown()
is pretty easy, just need to callfullDestruct()
. For debugging, you can addexit(-1);
after any line you as suspecting, connect to DB and checkout the database, select/inspect tables.- There is also
TestInstaller
class in case any of test case needs the whole mods-enabled with fossology.conf, VERSION, etc. Please checksrc/cli/tests/test_fo_copyright_list.php
for quick reference.
- Please note the changes in
Conclusion and Further Plans #
- Fix the remaining tests.
- Add week 8, 9 reports.
- Add Final Evaluation Report.
- Complete Final Evaluation.