Virtual Machine for Debugging

This part of the documentation is only applicable if you have direct access to Coin, e.g. you are inside The Qt Company’s network.

Probably someone sent you here to “just create yourself a VM and test it there”. Coin wants you to be productive and thus it makes it easy to create a virtual machine which is just like the test machines where auto tests are usually run. Often bugs that are hard to reproduce can be conveniently tested and fixed this way.

Creating the VM

Note

If creating a VM for first time visit https://one-master.ci.qt.io and login once with your ldap credentials. This will create the opennebula user, otherwise Coin will fail creating the machine. At the same it is recommended to switch the view in opennebula to “user”.

Note

Keep in mind that the ref will be checked out (e.g. git checkout ref), not cherry-picked on the branch HEAD! This allows testing of specific revision or relation chain.

In Coin login with your ldap username, password is not required here. In the Coin web interface, go to the Schedule Build page. Enter the module you want to build, e.g. “qt/qtdeclarative”. The module name has to be the same as it is on gerrit. Ref: This is where you decide what git ref of the module to use. It can be a branch or anything that “git fetch” supports.

Now click “list configurations” to see all configured platforms for the module you specified earlier. Pick one of the configurations and select one of the options below to run the target.

Prepare VM for Debugging

This will create a virtual machine, except that it will not run any tests. Instead the “test job” will create the VM, download all that is needed to run the tests and stop. Once the job is done, go to the test log to find out the IP address at the very top or go to opennebula directly to find the VM.

Save VM on failure

Save VM on failure will save the virtual machine if it fails during the run. During provisining failure the VM is not saved. The option can be also used when scheduling via “Build and test on these configurations”, this will run the tests in addition, but in case of no failure no VM is saved. This is often better way to save a VM for an issue that causes an failure as the state is not touched after the failure.

Debug VM before running build

The option disables the build instructions and provides a VM in the state where the build would be executed.

On the VM

It is quick to now run any test, there are just a few things to keep in mind:

Environment

Coin saves the environment to a sourceable ci_env.[sh|ps1] as last step when creating a debug VM. The environment will differ based on the debug VM type. On a debug VM before build the environment will correspond to the status when executing the configure, on a normal debug VM to the status when the tests archive is installed and on a save on failure VM the status will be from the point when the failure happened.

CMake

Applies for Qt6.

The sources to the module you requested:

/home/qt/work/<module>

Dependencies if any are installed in:

/home/qt/work/install

If not using save vm on failure, the tests are not installed on the VM by default. Some ways to find the url to the tests archive.

  • Downloads section of the corresponding build workitem.

  • Previous test log (not the one that created the debug VM).

The archive can be downloaded with wget or browser etc.

The CMake tests location does matter so it needs to be extracted in correct directory. This is often the one below, but can be verified from build log where the tests were built.

  • /home/qt/work/qt/<module>_standalone_tests

  • e.g. /home/qt/work/qt/qtbase_standalone_tests

Tests can then be executed.

QMake

Applies for 5.15 and older branches.

Linux/macOS host

The build will be in:

/home/qt/work/qt/qtbase

The sources to the module you requested:

/home/qt/work/qt/module

cd into the test subdirectory and run ‘’’/home/qt/work/qt/qtbase/bin/qmake’’’ and enjoy running the tests.

Windows host

MSVC compiler setup:

To get the right compiler, run a terminal and a _.bat_ script, for example:

c:\users\qt\MSVC2015.bat

The pre-built qtbase with libraries will be in:

c:\users\qt\work\qt\qtbase

The sources in:

c:\users\qt\work\qt\module

If you want to run the test executable directly, you may need to add ‘’’c:\users\qt\work\qt\qtbase\bin’’’ to the path. To compile any test, cd into the test source directory and call ‘’’c:\users\qt\work\qt\qtbase\bin\qmake’’’ and ‘’’nmake’’’.

When you are done

When you think you are done with the virtual machine, select it in opennebula and terminate-hard. This will free the host resources for the next task at hand.