Setup Checkbox Development Environment with PyCharm

Regard Checkbox Stack as a Python Stack

Checkbox project is aim at deliverying QA tools used for testing Ubuntu. The corresponding tool is packaged currently as checkbox-ng and its "plugins", providers. checkbox-ng is essentially a python application. Thus seting up Checkbox development is essentially setting up a python development environment, so it is surely to use PyCharm as approach.

Checkbox Stack and checkbox-ng

A checkbox-ng application is composed of the following components:

checkbox-ng is designated to work with provides. Without providers, checkbox-ng does not run any meaningful jobs. By default, two providers, plainbox-provider-checkbox and plainbox-provider-resource, are installed along with the installation of checkbox-ng to make checkbox-cli application could run some basic jobs.

The prefix plainbox-provider- are historic legacy because checkbox-ng was particially composed of plainbox the third-party python module, which is now merged into checkbox-ng as a built-in module.

You may use this script to fetch the source of the checkbox-ng stack.

Setup the Development Environment with Python Virtual Environment

Since checkbox-ng is essentially a python applicatioin, we could develop it in a Python virtual environment.

If you use this script to fetch the source of the checkbox-ng stack, you may use support/mk-venv to build your python virtual environment.[1]

[1] You may need to comment out plainbox installation in mk-venv because plainbox is not used as a thrid party python module anymore.

Tell PyCharm Which Python Virtual Environment Should be Used

Once we have a virtual environment built by mk-venv, it is straightforward to setup PyCharm by telling which Python interpreter and virtul environment the PyCharm IDE should use.

Tell PyCharm Where to Load Providers

Providers are not python modules. They are configuration files. The current PyCharm only knows information about the python stack. Tell PyCharm where to load providers by adding the environment variable PROVIDERPATH when running debugger.

Enable Terminal Emulator so You Will not Show Your sudo Password Explicitly

Many checkbox test job needs the permission of sudo. Check Emulate terminal in output console to prevent the pycharm process catch input characters and show your sudo password explicitly.

Debug Checkbox Innovative

You may debug checkbox in different way as debugging a python application. For example, fixing the python files in site-packages directly on your target machine so you can try something specific to the hardware. If I choose this approache, I use icecream python module for log printting sometimes.