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://opennebula01.on1.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
To save a VM for debugging an option must be selected to the Debug VM type dropdown in scheduler. There are multiple points from which a debug VM can be saved. Different save points will also affect the content of the ci_env.sh, which will be from the corresponding point. The following table shows the exact save points.
Debug VM type |
Save point |
|---|---|
PreProvisioning |
Before running any provisioning scripts on the provisioning VM. |
PreBuild |
Up to, but not including configure on the build VM. |
PostBuild |
After building module and possible tests on the build VM. |
PreTest |
After extracting tests on the test VM. |
Save VM on failure
Save VM on failure will save the virtual machine if it fails during the run. 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. With save VM on failure the content of ci_env.sh will be from the point of the failure.
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. See the table in Prepare VM for Debugging section for exact details.
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.