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.

Dependencies

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 config/extension.toml.

Data Files

Three types of data files are accessed in this extension:

  1. Generic data files, created in other extensions for use by the user (e.g. compound node definitions)

  2. Example files, created to illustrate how to use certain nodes but not intended for general use

  3. Test files, used only for the purpose of loading to test certain features

The 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.

Node Files

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.

Import Structure

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 build directory omni.graph.test/omni.graph.test/tests/.

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 mechanism.

Import Example

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

Note

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 omni.graph.test/python/examples/python/__init__.py

Finally, the config/extension.toml had additions made to inform it of the dependency on the new extension: