Welcome | Get started | Dive | Contribute | Topics | Reference | Changes | More

Run the Lino test suite

How to

Once your environment is correctly set up you can run the test suite for the Lino framework as follows:

$ pp inv prep test

The pp command loops over all your projects, initializes their demo databases (inv prep) and then runs the test suite (inv test. The whole process takes 20 minutes on my machine when there’s no error. It produces a lot of output of this style:

==== lino ====
no previously-included directories found matching 'docs'
.
----------------------------------------------------------------------
Ran 1 test in 0.013s
OK

(...)

==== noi ====
--------------------------------------------------------------------------------
In demo project lino_noi.projects.team.settings.demo:
`initdb std demo demo2` started on database .../default.db.
Operations to perform:
...
Installed 148 object(s) from 11 fixture(s)
...................
----------------------------------------------------------------------
Ran 19 tests in 34.440s

OK

(...)

If any error occurs, then you need to find out the reason. And we recommend that you call for our help by reporting your error.

Possible reasons for failures are:

  • PodError: An error occurred during the conversion. Could not connect to LibreOffice on port 8100. UNO (LibreOffice API) says: Connector : couldn't connect to socket (Success).

    This means that you don’t have the LibreOffice server running. See More about the LibreOffice service.

  • Some dependency is not installed on your machine.

  • Some test suite is currently broken (also on GitLab).

In order to check whether everything worked well, we are now going to run the test suite.

Make sure that your demo databases are initialized and that you did not do any manual changes therein. Because the test suite has many test cases which would fail if these demo databases were missing or not in their virgin state. In case you did write into some database during the previous section, just run inv prep once more.

Tips & tricks

  1. You can split the process into two:

    $ pp inv prep
    $ pp inv test
    

    This can save you time if there is some problem. Once inv initdb has run successfully for all projects, you can focus on inv test.

  2. You can run the test suite for one project at a time by doing:

    $ go <prjname>
    $ inv prep test
    
  3. You can prepend the standard Unix time command if you want to know how much time it took on your machine:

    $ time pp inv prep test
    
  4. You can use the -v option of pp so that you can peacefully go to the kitchen and make yourself a cup of tea, knowing that your computer will announce the result through its speakers when the process has finished:

    $ time pp -v inv prep test
    

    You can try this by issuing:

    $ pp -v ls
    

    Your computer should then say the words “Successfully terminated ‘ls’ for all projects” with a more or less clear male voice.

    Note that this requires the espeak package to be installed on your machine:

    $ sudo apt-get install espeak