OmniGraph Integration Testing

Extension: omni.graph.test

Documentation Generated: Aug 15, 2022

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
"""There is no public API to this module."""
__all__ = []

scan_for_test_modules = True
"""The presence of this object causes the test runner to automatically scan the directory for unit test cases"""

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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
[package]
version = "0.13.7"
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.kit.renderer.core" = {}
"omni.kit.renderer.capture" = {}
"omni.kit.window.viewport" = {}
"omni.graph.examples.cpp" = {}
"omni.graph.examples.python" = {}
"omni.graph.nodes" = {}
"omni.graph.tutorials" = {}
"omni.graph.action" = {}
"omni.graph.scriptnode" = {}
"omni.graph.ui" = {}
"omni.inspect" = {}
"omni.usd" = {}
"omni.rtx.tests" = {}

[[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*",
]

pythonTests.unreliable = [
    "*test_reparent_fabric", # OM-52405
    "*test_graph_load", # OM-53608
    "*test_hashability", # OM-53608
    "*test_rename_deformer", # OM-53608
    "*test_prerender_gpuinterop", # OM-55399
    "*test_import_time_sampled_data", # OM-58596
    "*test_reparent_graph", # OM-58852
    "*test_simple_rename", # OM-58852
    "*test_copy_on_write", # OM-58586
]