Skip to content

Commit c7efc8c

Browse files
committed
feat: Add job bundle to run integ tests in Deadline Cloud
Signed-off-by: Jair Ruiz <167156521+jairaws@users.noreply.github.com>
1 parent 6729f11 commit c7efc8c

2 files changed

Lines changed: 146 additions & 0 deletions

File tree

job_bundle_integ_tests/README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Maya Integration Tests on Deadline Cloud
2+
3+
Runs the deadline-cloud-for-maya integration tests on a Deadline Cloud Service Managed Fleet with all supported renderer plugins (Arnold, V-Ray, Redshift).
4+
5+
## Prerequisites
6+
7+
- A Deadline Cloud farm with a queue that has the default Conda queue environment.
8+
- The `deadline` CLI installed and configured (`deadline config`).
9+
10+
## Usage
11+
12+
```bash
13+
deadline bundle submit /path/to/this/job-bundle \
14+
--name "maya-integ-tests" \
15+
--parameter "RepoDir=/path/to/deadline-cloud-for-maya" \
16+
--parameter "CondaPackages=maya=2026 maya-mtoa=2026.5.5 maya-vray=2026.7 maya-redshift=2026.2" \
17+
--max-retries-per-task 0
18+
```
19+
20+
## Steps
21+
22+
| Step | Description |
23+
|------|-------------|
24+
| `submitter` | Runs submitter tests (`test_maya_submitters.py`). Validates that the Maya submitter generates correct job bundles. |
25+
| `adaptor` | Runs adaptor tests (`test_maya_adaptors.py`). Validates that the Maya adaptor renders scenes correctly with all supported renderers. |
26+
27+
## How It Works
28+
29+
1. The repo is uploaded as a job attachment via the `RepoDir` input parameter.
30+
2. A shared job environment installs the package and test dependencies into `mayapy`'s Python environment, and symlinks the adaptor entry points (`MayaAdaptor`, `maya-openjd`) onto PATH.
31+
3. `QT_QPA_PLATFORM=offscreen` is set job-wide so PySide6 can initialize without a display server.
32+
4. The submitter step additionally sets `LD_LIBRARY_PATH=$MAYA_LOCATION/lib` to fix PySide6/shiboken6 shared library loading. This is scoped to the submitter step only — setting it job-wide causes adaptor subprocesses to resolve to a broken system Python.
33+
5. `numpy<2` is pinned because Maya 2026 bundles native modules compiled against NumPy 1.x.
34+
35+
## Customization
36+
37+
- To test against a different Maya version, change the `CondaPackages` parameter (e.g., `maya=2025 maya-mtoa=2025.5.4`).
38+
- To run only specific tests, modify the pytest marker filter in the step's run script.
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# Job template for running deadline-cloud-for-maya integration tests on
2+
# Deadline Cloud Service Managed Fleets. See README.md for usage instructions.
3+
specificationVersion: jobtemplate-2023-09
4+
name: deadline-cloud-for-maya integ tests
5+
parameterDefinitions:
6+
# The local checkout of the deadline-cloud-for-maya repository.
7+
# Uploaded automatically as a job attachment because dataFlow is IN.
8+
- name: RepoDir
9+
type: PATH
10+
objectType: DIRECTORY
11+
dataFlow: IN
12+
description: Path to the deadline-cloud-for-maya repository root.
13+
jobEnvironments:
14+
# Headless Qt: PySide6 needs a platform plugin to initialize.
15+
# "offscreen" allows it to run without a display server.
16+
- name: EnvVars
17+
variables:
18+
QT_QPA_PLATFORM: offscreen
19+
# Shared setup: installs the package, test dependencies, and symlinks
20+
# the adaptor entry points onto PATH. Runs once per session and applies
21+
# to all steps.
22+
- name: SetupTestEnv
23+
script:
24+
embeddedFiles:
25+
- name: Setup
26+
filename: setup.sh
27+
type: TEXT
28+
runnable: true
29+
data: |
30+
#!/bin/bash
31+
set -euo pipefail
32+
33+
# Install the package (non-editable so entry points are created)
34+
# and pin numpy<2 for Maya 2026 ABI compatibility.
35+
mayapy -m pip install '{{Param.RepoDir}}' --force-reinstall
36+
mayapy -m pip install 'numpy<2'
37+
mayapy -m pip install -r '{{Param.RepoDir}}/requirements-testing.txt'
38+
mayapy -m pip install -r '{{Param.RepoDir}}/requirements-integ-testing.txt'
39+
40+
# pip installs entry points (MayaAdaptor, maya-openjd) into Maya's
41+
# internal bin dir, which is not on PATH. Symlink them to .env/bin/
42+
# so that `openjd run` can find the adaptor binary.
43+
SCRIPTS_DIR=$(mayapy -c "import sysconfig; print(sysconfig.get_path('scripts'))" 2>/dev/null)
44+
ENV_BIN=$(dirname $(which mayapy))
45+
ln -sf "$SCRIPTS_DIR/MayaAdaptor" "$ENV_BIN/MayaAdaptor"
46+
ln -sf "$SCRIPTS_DIR/maya-openjd" "$ENV_BIN/maya-openjd"
47+
actions:
48+
onEnter:
49+
command: '{{Env.File.Setup}}'
50+
timeout: 300
51+
steps:
52+
# Submitter tests: validate that the Maya submitter generates correct job bundles.
53+
# Requires LD_LIBRARY_PATH for PySide6 (step-scoped to avoid breaking adaptor).
54+
- name: submitter
55+
stepEnvironments:
56+
# PySide6's shiboken6.Shiboken.so needs Qt shared libraries from
57+
# $MAYA_LOCATION/lib. The Conda Maya package has incomplete RPATH patching
58+
# for these files. This MUST be step-scoped: setting LD_LIBRARY_PATH
59+
# job-wide causes adaptor subprocesses to resolve to a broken system Python.
60+
- name: MayaLibPath
61+
script:
62+
embeddedFiles:
63+
- name: SetLibPath
64+
filename: set-lib-path.sh
65+
type: TEXT
66+
runnable: true
67+
data: |
68+
#!/bin/bash
69+
set -euo pipefail
70+
echo "openjd_env: LD_LIBRARY_PATH=${MAYA_LOCATION}/lib:${LD_LIBRARY_PATH:-}"
71+
actions:
72+
onEnter:
73+
command: '{{Env.File.SetLibPath}}'
74+
script:
75+
embeddedFiles:
76+
- name: Run
77+
filename: run.sh
78+
type: TEXT
79+
runnable: true
80+
data: |
81+
#!/bin/bash
82+
set -euo pipefail
83+
cd '{{Param.RepoDir}}'
84+
mayapy -m pytest test/integ/test_maya_submitters.py -vvv --numprocesses=1 --no-cov -m submitter
85+
actions:
86+
onRun:
87+
command: '{{Task.File.Run}}'
88+
timeout: 600
89+
# Adaptor tests: validate that the Maya adaptor renders scenes correctly
90+
# with all supported renderers (mayaHardware2, Arnold, V-Ray, Redshift).
91+
# Pytest is pointed at the specific test file to avoid collecting
92+
# test_maya_submitters.py, which imports PySide6 at module level.
93+
- name: adaptor
94+
script:
95+
embeddedFiles:
96+
- name: Run
97+
filename: run.sh
98+
type: TEXT
99+
runnable: true
100+
data: |
101+
#!/bin/bash
102+
set -euo pipefail
103+
cd '{{Param.RepoDir}}'
104+
mayapy -m pytest test/integ/test_maya_adaptors.py -vvv --numprocesses=1 --no-cov -m adaptor
105+
actions:
106+
onRun:
107+
command: '{{Task.File.Run}}'
108+
timeout: 600

0 commit comments

Comments
 (0)