Skip to content

Commit c23eb92

Browse files
committed
Feature/109.0
1 parent c7b130d commit c23eb92

34 files changed

Lines changed: 727 additions & 382 deletions

File tree

.github/workflows/.github-ci.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Smoke Test Staging Branch
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build-linux:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout Code
14+
uses: actions/checkout@v2
15+
16+
- name: Set Up Python
17+
uses: actions/setup-python@v4
18+
with:
19+
python-version: '3.11'
20+
21+
- name: Install Required System Libraries
22+
run: |
23+
sudo apt-get update
24+
sudo apt-get install -y zlib1g-dev
25+
26+
- name: Make Templates
27+
run: python .github/workflows/create_templates.py
28+
29+
- name: Run Build
30+
run: ./repo.sh build
31+
32+
build-windows:
33+
runs-on: windows-latest
34+
35+
steps:
36+
- name: Checkout Code
37+
uses: actions/checkout@v2
38+
39+
- name: Set Up Python
40+
uses: actions/setup-python@v4
41+
with:
42+
python-version: '3.11'
43+
44+
- name: Make Templates
45+
run: python .github/workflows/create_templates.py
46+
47+
- name: Run Build
48+
run: ./repo.bat build
49+
50+
51+
# test:
52+
# runs-on: ${{ matrix.os }}
53+
# strategy:
54+
# matrix:
55+
# os: [ubuntu-latest, windows-latest]
56+
57+
# steps:
Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
#!/usr/bin/env python3
2+
"""
3+
Script to run template replay tests for all test configuration files.
4+
Executes: repo.sh template replay <TEST_FILE> for each test file,
5+
followed by a single repo.sh build to verify the templates can be built.
6+
"""
7+
8+
import subprocess
9+
import os
10+
import sys
11+
import platform
12+
from pathlib import Path
13+
14+
# List of test files to process
15+
TEST_FILES = [
16+
".github/workflows/replay_files/base_editor",
17+
".github/workflows/replay_files/usd_composer",
18+
".github/workflows/replay_files/usd_explorer",
19+
".github/workflows/replay_files/usd_viewer",
20+
".github/workflows/replay_files/kit_service",
21+
]
22+
23+
# Determine the repo script based on OS
24+
REPO_SCRIPT = "repo.bat" if platform.system() == "Windows" else "./repo.sh"
25+
26+
27+
def run_template_replay(test_file: str) -> bool:
28+
"""
29+
Run repo.sh template replay for a given test file.
30+
31+
Args:
32+
test_file: Name of the test file to process
33+
34+
Returns:
35+
True if successful, False if failed
36+
"""
37+
cmd = [REPO_SCRIPT, "template", "replay", test_file]
38+
39+
print(f"Running: {' '.join(cmd)}")
40+
41+
try:
42+
result = subprocess.run(
43+
cmd,
44+
check=True,
45+
capture_output=False,
46+
text=True,
47+
timeout=300 # 5 minute timeout
48+
)
49+
50+
print(f"SUCCESS: {test_file}")
51+
if result.stdout:
52+
print(f" Output: {result.stdout.strip()}")
53+
return True
54+
55+
except subprocess.CalledProcessError as e:
56+
print(f"FAILED: {test_file}")
57+
print(f" Return code: {e.returncode}")
58+
if e.stdout:
59+
print(f" Stdout: {e.stdout.strip()}")
60+
if e.stderr:
61+
print(f" Stderr: {e.stderr.strip()}")
62+
return False
63+
64+
except subprocess.TimeoutExpired:
65+
print(f"TIMEOUT: {test_file} (exceeded 5 minutes)")
66+
return False
67+
68+
except FileNotFoundError:
69+
print(f"ERROR: {REPO_SCRIPT} not found. Make sure you're in the correct directory.")
70+
return False
71+
72+
73+
def run_build() -> bool:
74+
"""
75+
Run repo.sh build to verify the templates can be built.
76+
77+
Returns:
78+
True if successful, False if failed
79+
"""
80+
cmd = [REPO_SCRIPT, "build"]
81+
82+
print(f"Running: {' '.join(cmd)}")
83+
84+
try:
85+
result = subprocess.run(
86+
cmd,
87+
check=True,
88+
capture_output=False,
89+
text=True,
90+
timeout=600 # 10 minute timeout for build
91+
)
92+
93+
print("SUCCESS: Build completed")
94+
if result.stdout:
95+
print(f" Output: {result.stdout.strip()}")
96+
return True
97+
98+
except subprocess.CalledProcessError as e:
99+
print("FAILED: Build")
100+
print(f" Return code: {e.returncode}")
101+
if e.stdout:
102+
print(f" Stdout: {e.stdout.strip()}")
103+
if e.stderr:
104+
print(f" Stderr: {e.stderr.strip()}")
105+
return False
106+
107+
except subprocess.TimeoutExpired:
108+
print("TIMEOUT: Build (exceeded 10 minutes)")
109+
return False
110+
111+
except FileNotFoundError:
112+
print(f"ERROR: {REPO_SCRIPT} not found. Make sure you're in the correct directory.")
113+
return False
114+
115+
116+
def main():
117+
"""Main function to run all template replay tests."""
118+
119+
os.chdir(Path(__file__).parent.parent.parent.resolve()) # Change to script's parent directory
120+
print("Starting template replay tests...")
121+
print("=" * 50)
122+
123+
# Check if repo script exists
124+
repo_path = Path(REPO_SCRIPT.replace("./", ""))
125+
if not repo_path.exists():
126+
print(f"ERROR: {REPO_SCRIPT} not found in current directory")
127+
print(repo_path.resolve())
128+
print("Please run this script from the repository root.")
129+
sys.exit(1)
130+
131+
# Check to see if .omniverse_eula_accepted.txt exists. If not, make it.
132+
eula_file = Path(".omniverse_eula_accepted.txt")
133+
if not eula_file.exists():
134+
print("Creating .omniverse_eula_accepted.txt to accept EULA")
135+
eula_file.touch()
136+
137+
success_count = 0
138+
total_count = len(TEST_FILES)
139+
140+
for test_file in TEST_FILES:
141+
print()
142+
if run_template_replay(test_file):
143+
success_count += 1
144+
145+
print()
146+
print("=" * 50)
147+
print(f"SUMMARY: {success_count}/{total_count} template replay tests passed")
148+
149+
# Delete .omniverse_eula_accepted.txt if it was created
150+
print("Deleting .omniverse_eula_accepted.txt")
151+
eula_file.unlink(missing_ok=True)
152+
153+
# Overall success depends template replays
154+
if success_count == total_count:
155+
print("\nTemplate creation passed!")
156+
sys.exit(0)
157+
else:
158+
if success_count < total_count:
159+
print(f"\n{total_count - success_count} template replay(s) failed")
160+
sys.exit(1)
161+
162+
163+
if __name__ == "__main__":
164+
main()
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[kit_base_editor]
2+
application_name = "bob"
3+
application_display_name = "Bob's Editor"
4+
version = "0.0.1"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[basic_cpp_extension]
2+
extension_name = "pointers.suck"
3+
extension_display_name = "No Garbage Collection?"
4+
version = "14.0.0"
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[basic_python_binding]
2+
extension_name = "yesss.python"
3+
extension_display_name = "Expose the Powa To Python"
4+
version = "1.3.5"
5+
library_name = "_yesss_python_lib"
6+
interface_name = "IYesssPythonInterface"
7+
object_interface_name = "IYesssPythonObjectInterface"
8+
object_name = "YesssPythonObject"
9+
extension_namespace = "yesss::python"
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[kit_service]
2+
application_name = "my_company.my_service"
3+
application_display_name = "My Service"
4+
version = "0.1.0"
5+
6+
[kit_service.extensions.kit_service_setup]
7+
extension_name = "my_company.my_service_setup_extension"
8+
extension_display_name = "My Service Setup Extension"
9+
version = "0.1.0"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[basic_python_extension]
2+
extension_name = "basic.snake.extension"
3+
extension_display_name = "SNAKES"
4+
version = "5.5.5"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[basic_python_ui_extension]
2+
extension_name = "snake.extension.with.ui"
3+
extension_display_name = "MOAR SNAKES"
4+
version = "5.5.5"
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[omni_usd_composer]
2+
application_name = "john.williams"
3+
application_display_name = "A New Hope"
4+
version = "4.0"
5+
6+
[omni_usd_composer.extensions.omni_usd_composer_setup]
7+
extension_name = "cassian.andor"
8+
extension_display_name = "A Prequel Is A Setup"
9+
version = "0.0.0"
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[omni_usd_explorer]
2+
application_name = "paiges.dora.the.explorer"
3+
application_display_name = "I Saw A Live Show Of This Once"
4+
version = "1.2.3"
5+
6+
[omni_usd_explorer.extensions.omni_usd_explorer_setup]
7+
extension_name = "im.the.map"
8+
extension_display_name = "I'm The Map"
9+
version = "4.5.6"

0 commit comments

Comments
 (0)