omni.graph.test: OmniGraph Integration Testing¶
In order to effectively test the OmniGraph access to nodes and scripts that are not necessary for the graph to operate correctly. In order to minimize the unnecessary files, yet still have nodes and files explicitly for testing, all of that functionality has been broken out into this extension.
As the purpose of this extension is to provide testing facilities for all of OmniGraph it will have load
dependencies on all of the omni.graph.* extensions. If any new ones are added they should be added to
the dependencies in the file
Three types of data files are accessed in this extension:
Generic data files, created in other extensions for use by the user (e.g. compound node definitions)
Example files, created to illustrate how to use certain nodes but not intended for general use
Test files, used only for the purpose of loading to test certain features
data/ subdirectories in this extension contains the latter of those three. The other files live in the
lowest level extension in which they are legal (e.g. if they contain a node from omni.graph.nodes then
they will live in that extension). As this extension has dependencies on all of the OmniGraph extensions it will
have access to all of their data files as well.
Most nodes will come from other extensions. Some nodes are created explicitly for testing purposes. These will appear in this extension and should not be used for any other purpose.
In order to keep the relationship between the scripts and the extensions they are testing visible the Python import
structure in this extension is set up in a non-standard way. The normal structure would see all test files in the
The extension structure, rightly, does not allow installing scripts into other extensions, and once a module has been created it cannot have submodules elsewhere, however there is no restriction on the subdirectory structure within a module. So to keep separation, a directory structure is used that maintains the separation of extensions being tested.
For example, tests for the extension omni.graph.core are loaded into the directory
omni.graph.test/omni.graph.test/core/ with an associated
__init__.py file that feeds into the automated test
This simple example shows how the test files from the omni.graph.examples.python extension were imported and enabled in this extension.
The first step was to move the required files into the directory tree:
omni.graph.test/ ├── python/
├── tests/ └── examples/
├── python/ ├──── test_omnigraph_python_examples.py └── data/ ├──── TestEventTrigger.usda └──── TestExecutionConnections.usda
The two .usda files contain only nodes from the omni.graph.examples.python extension and are solely used for test purposes. That is why they could be moved into the extension’s test directory.
Next the standard automatic test detection file was added to
Finally, the config/extension.toml had additions made to inform it of the dependency on the new extension: