Project

General

Profile

First steps with tests

Luca Stucchi
Added about 4 years ago

Hi, I am following the documentation for the test suite but I fear it's quite old fashioned.

For example, in http://docs.tigase.org/tigase-server/snapshot/Development_Guide/html/#_tigase_test_suite you can find the script

testsuite $ ./scripts/all-tests-runner.sh --single JabberIqPrivate.test

but there is something that I can't understand. In particular:

  • in the sources we can find the same filename with the extension xmpt. Is that the file that need to be passed to the script as parameter ?
Tigase server home directory: ../server
Version: 2.8.5-b422
Database:         xmldb
Server IP:        127.0.0.1
Extra parameters: JabberIqPrivate.test
Starting Tigase:
Tigase running pid=6751
  • the database type in the log is xmldb, which is no longer a valid possibility, having derby as default. Is it OK to use derby or this missing option is still to be considered the best to use since it's in the documentation ?

  • as for the patches that I suggested today (https://projects.tigase.org/issues/2619 and https://projects.tigase.org/issues/2620) , it seems that without a configuration file, it is impossible to set database credentials for root and common user, or database name. Is this OK, and most of all, don't you think it could be of some use to have a template (causing a loud failure) default configuration file ?

  • I tried to run the script using pre-defined parameters like --func-all . All the tests sadly fail with a 401 unauthenticated result. Since I set manually user credentials, is there any rule to assign the "right" values into the configuration file to have the tests running ?

  • In general, either I am missing some points (I'd be glad to find it out !) or I have the impression that this subproject is not so used/tested. Am I wrong ? Or it's just that the indicated version is 2.8.5, released in 2007... maybe that's the reason for many of the differences... could it be ?

Thanks in advance,

Luca


Replies (1)

Added by Wojciech Kapcia TigaseTeam about 4 years ago

Luca Stucchi wrote:

  • in the sources we can find the same filename with the extension xmpt. Is that the file that need to be passed to the script as parameter ?

XMPT files are 'test scripts', i.e. sets of test cases. As script help indicates you execute them differently:

$ ./scripts/all-tests-runner.sh
Run selected or all tests for Tigase server
…
  --single test_file.cot
  --other script_file.xmpt
  • the database type in the log is xmldb, which is no longer a valid possibility, having derby as default. Is it OK to use derby or this missing option is still to be considered the best to use since it's in the documentation ?

You can execute any test against any database type. This is controlled through the settings file.

  • as for the patches that I suggested today (https://projects.tigase.org/issues/2619 and https://projects.tigase.org/issues/2620) , it seems that without a configuration file, it is impossible to set database credentials for root and common user, or database name. Is this OK, and most of all, don't you think it could be of some use to have a template (causing a loud failure) default configuration file ?

What do you mean 'template'? TTS is a bit tricky and expect some defaults. Please see /etc/init-<db_type>properties - here you have user credentials which should match those in tests-runner-settings.sh, and the particular schema will be created automatically with root account details.

  • I tried to run the script using pre-defined parameters like --func-all . All the tests sadly fail with a 401 unauthenticated result. Since I set manually user credentials, is there any rule to assign the "right" values into the configuration file to have the tests running ?

Again - probably editing /etc/init-<db_type>properties will fix those issues.

  • In general, either I am missing some points (I'd be glad to find it out !) or I have the impression that this subproject is not so used/tested. Am I wrong ? Or it's just that the indicated version is 2.8.5, released in 2007... maybe that's the reason for many of the differences... could it be ?

It's used for dist and nightlies Grant though - setting it up for the first time may be quite frustrating.

    (1-1/1)