Testing

Test Suite: Python Tests

Kit comes with a prebundled extension omni.kit.test. It is a wrapper over the standard unittest that adds async/await support, so that tests can be run inside of the Kit update loop. Tests can last for many updates and give control back to Kit.

Refer to omni.kit.test documentation: omni.kit.test on how to create a test and run them from command line.

To run python tests Kit also has an extension omni.kit.builtin.test_runner which provides UI interface to display and run all the tests. Use menu WindowTest Runner to open it (when extension is enabled).

Where to put python tests?

A General guideline is that each extension should have a python module with tests. Then in the premake file premake5-sdk.lua a new experience can be created to run only that extension:

define_ext_test_experience("omni.example.hello")

That will create the corresponding .bat (or .sh) file to run experience to test this extension. It also make test automatically discoverable by test runner.

Some tests can be more like functional tests, which test many thing at once. They still belong to an extension, but to the most generic extension: omni.kit.default. This is a dummy extension which basically forms the Kit experience. While we are not yet there the goal is to have all of the experience configuration in the extension too, so that you can point Kit to a single extension and it will unroll everything else. We put these tests for now in the omni.kit.default extension.