How to run incus functional tests locally?

Hi folks,
I have been trying to contribute with incus and one thing that I’m still struggling is to validate on my own environment the whole incus features before I submit my PR.

I noticed that it’s useful run: make static-analysis, for guarantee format pattern.
What else i should run on my own enironment?
Is it possible I run all feature tests that run on incus pipeline?

Oh I’ve been contributing for a bit and testing locally is still something that’s frustrating sometimes as it’s very possible that you can’t run the whole suite in your environment. To run the tests, you should focus on the test directory (duh!) and in particular main.sh. Some nice work was recently done to split tests into sub-suites, which is pretty convenient. Look at all the INCUS_* variables in this file, they could matter to you. FWIW, the GitHub pipeline uses INCUS_CONCURRENT=1 INCUS_VERBOSE=1 INCUS_OFFLINE=1 INCUS_TMPFS=1, along with INCUS_BACKEND, which you should set to the storage backend you want to use (by default if absent, dir). Should you want to inspect the state of your testing environment before destroying it when a test fails, set INCUS_INSPECT=1.

The README.md file under test/ is pretty comprehensive, but it’s easy to get lost. In any case, the test suite will be run when you create a PR and push to it, so what you don’t want to / can’t run, GitHub will do it for you.

I usually use something like:

INCUS_TMPFS=1 INCUS_VERBOSE=1 INCUS_INSPECT=1 ./main.sh TEST_I_WANT_TO_RUN

Note that this must be run from a root shell.

nice guys, thank you for the help!