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 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/
        ├──── test_omnigraph_simple.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/tests/__init__.py

1
2
3
4
5
6
"""
Presence of this file with the variable below set allows the tests directory to be imported as a module so that all of
its contents can be scanned to automatically add tests that are placed into this directory. Test files must begin with
the prefix "test_" to be recognized.
"""
scan_for_test_modules = True

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
[package]
version = "0.2.1"
title = "OmniGraph Regression Testing"
category = "Graph"
readme = "docs/README.md"
changelog = "docs/CHANGELOG.md"
description = "Contains test scripts and files used to test the OmniGraph extensions where the tests cannot live in a single extension."
repository="https://gitlab-master.nvidia.com/omniverse/kit"
keywords = ["kit", "omnigraph", "tests"]

# Main module for the Python interface
[[python.module]]
name = "omni.graph.test"

[[native.plugin]]
path = "bin/*.plugin"
recursive = false

# Watch the .ogn files for hot reloading (only works for Python files)
[fswatcher.patterns]
include = ["*.ogn", "*.py"]
exclude = ["Ogn*Database.py"]

# Python array data uses numpy as its format
[python.pipapi]
requirements = ["numpy"]

# Other extensions that need to load in order for this one to work
[dependencies]
"omni.graph" = {}
"omni.graph.tools" = {}
"omni.kit.pipapi" = {}
"omni.graph.examples.cpp" = {}
"omni.graph.examples.python" = {}
"omni.graph.nodes" = {}
"omni.graph.tutorials" = {}
"omni.graph.action" = {}
"omni.graph.scriptnode" = {}
"omni.inspect" = {}

[[test]]
timeout = 600
stdoutFailPatterns.exclude = [
    # Exclude carb.events leak that only shows up locally
    "*[Error] [carb.events.plugin]*PooledAllocator*",
    # Exclude messages which say they should be ignored
    "*Ignore this error/warning*",
]