Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
132 changes: 132 additions & 0 deletions .github/workflows/ui_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
name: UI Tests

on:
push:
branches: [mainline, release]
pull_request:
branches: [mainline, release, feature_assets_cli, 'patch_*', 'feature_*']

jobs:
ui-test-linux:
name: UI Tests (Linux)
runs-on: ubuntu-latest
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any value in testing on an older instance instead of latest for validating support on older machines?

Another thing to think about is that the underlying machines these alias's point to will sometimes change which could cause difficult to debug errors from dependencies not being available. Maybe not a huge deal because the system dependencies below seem pretty light, but calling it out as something to think about.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point about older systems. I think that would be worth testing and GitHub offers ubuntu 2022 as a test runner option. I think OS version coverage might make sense on some sort of end to end test which also exercises the installer and DCM? I imagined these particular UI tests being more aimed at making sure the UI code is correct. I don't feel strongly and am open to ideas.

Also good point that the image will change over time and maybe the list of dependencies will not be correct. I don't think it'll be too painful since these tests run when the PR is raised so they're quick to update and validate (as opposed to e.g. CDK managed pipelines with canaries).

Also, on your comment about DCC testing: IMO it'd be great to run larger e2e or DCC tests in GitHub actions too since actions are easy to set up, easy to fork, and support all major OSes. It looks like GitHub has some test runners with GPUs but maybe they require opting in and paying. Or alternatively, there might be ways to get a soft GPU that's sufficient for opening Blender. I think tests like this would belong in a separate suite. But they would be amazing to add.

steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: '3.13'

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
xvfb dbus dbus-x11 at-spi2-core \
libxkbcommon-x11-0 libxcb-cursor0 libxcb-icccm4 \
libxcb-keysyms1 libxcb-image0 libxcb-render-util0 \
libxcb-xkb1 libegl1 libglib2.0-0 libfontconfig1 \
libdbus-1-3 libx11-xcb1 libxcb-render0 libxcb-shape0 \
libxcb-xfixes0

- name: Install hatch
run: pip install hatch

- name: Ensure management.localhost resolves
run: echo "127.0.0.1 management.localhost" | sudo tee -a /etc/hosts

- name: Run UI tests (CLI only)
run: hatch run ui:test test/ui/test_cli_mock_server.py --timeout=120

- name: Run UI tests (all, with accessibility)
run: |
dbus-run-session -- bash -c '
set -e

# Start Xvfb
Xvfb :99 -screen 0 1280x1024x24 -ac &
export DISPLAY=:99
sleep 1

# Enable AT-SPI2 accessibility
export NO_AT_BRIDGE=0
export AT_SPI_CLIENT=true
export ACCESSIBILITY_ENABLED=1
export QT_ACCESSIBILITY=1
export QT_LINUX_ACCESSIBILITY_ALWAYS_ON=1

# Start AT-SPI2 bus and registry
/usr/libexec/at-spi-bus-launcher --launch-immediately &
sleep 1
/usr/libexec/at-spi2-registryd &
sleep 1

# Enable accessibility on the AT-SPI bus
dbus-send --session --print-reply --dest=org.a11y.Bus /org/a11y/bus \
org.freedesktop.DBus.Properties.Set \
string:org.a11y.Status string:IsEnabled variant:boolean:true 2>/dev/null || true
dbus-send --session --print-reply --dest=org.a11y.Bus /org/a11y/bus \
org.freedesktop.DBus.Properties.Set \
string:org.a11y.Status string:ScreenReaderEnabled variant:boolean:true 2>/dev/null || true

echo "DISPLAY=$DISPLAY"
echo "DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS"

hatch run ui:test --timeout=120
'

ui-test-macos:
name: UI Tests (macOS)
runs-on: macos-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: '3.13'

- name: Install hatch
run: pip install hatch

- name: Create hatch ui environment
run: hatch env create ui

- name: Ensure management.localhost resolves
run: echo "127.0.0.1 management.localhost" | sudo tee -a /etc/hosts

- name: Grant accessibility TCC permission
run: |
HATCH_PYTHON=$(hatch -e ui run python -c "import os,sys; print(os.path.realpath(sys.executable))")
SETUP_PYTHON=$(python3 -c "import os,sys; print(os.path.realpath(sys.executable))")
for PYTHON_PATH in "$SETUP_PYTHON" "$HATCH_PYTHON"; do
echo "Granting TCC kTCCServiceAccessibility to: $PYTHON_PATH"
sudo sqlite3 "/Library/Application Support/com.apple.TCC/TCC.db" \
"INSERT OR REPLACE INTO access(service,client,client_type,auth_value,auth_reason,auth_version,csreq,policy_id,indirect_object_identifier_type,indirect_object_identifier,indirect_object_code_identity,flags,last_modified) \
VALUES('kTCCServiceAccessibility','${PYTHON_PATH}',1,2,4,1,NULL,NULL,0,'UNUSED',NULL,0,$(date +%s));"
done
sudo launchctl stop com.apple.tccd 2>/dev/null || true
sleep 2

- name: Run UI tests (all)
env:
QT_ACCESSIBILITY: "1"
run: hatch run ui:test --timeout=120

ui-test-windows:
name: UI Tests (Windows)
runs-on: windows-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: '3.13'

- name: Install hatch
run: pip install hatch

- name: Ensure management.localhost resolves
run: |
Add-Content -Path "$env:SystemRoot\System32\drivers\etc\hosts" -Value "`n127.0.0.1 management.localhost"
shell: pwsh

- name: Run UI tests (CLI only)
env:
QT_ACCESSIBILITY: "1"
run: hatch run ui:test test/ui/test_cli_mock_server.py --timeout=120
6 changes: 0 additions & 6 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,6 @@ These are the manual test cases for the client software release cycle, covering
| Verify Deadline CLI can be successfully installed using the staged individual installer | Run the staged individual installer and verify that it can install. | |
| Verify correct version of Deadline CLI is being tested | Verify correct version using `deadline --version` command. | |
| Verify user can modify workstation configuration settings using Deadline GUI (`deadline config gui`) | Run `deadline config gui` and verify dialogue loads as expected. Verify User can authenticate using DCM Profile using Login button. Using a DCM Profile, verify correct farm/queue resources are pulled, and the existing config can be modified. Verify User can Logout of DCM Profile using Logout button. Verify User can authenticate using an AWS Profile. Using an AWS Profile, verify correct farm/queue resources are pulled, and the existing config can be modified. | |
| Verify user can modify workstation configuration settings using `deadline config set` | Once settings are modified, verify settings were modified correctly using: 1. `deadline config show` 2. `deadline config get <setting_name>` 3. `deadline config gui` (verify modified settings appear correctly in the GUI). Verify settings can be modified back to default using `deadline config clear`. | |
| Verify user can authenticate/login using DCM Profile: `deadline auth login` | In deadline config gui, you should see the profile name with a green checkmark beside it in the bottom left. | Would need to set using DCM profile first. |
| Verify user can logout of DCM Profile: `deadline auth logout` | In deadline config gui, you should see the profile name with a red 'X' beside it in the bottom left. There should be a button to log in on the right. | |
| `deadline auth login` using AWS profile | Run `deadline config gui`, select an AWS profile that uses IAM credentials, and run `deadline auth login`. Confirm that there is an error like "Logging in is only supported for AWS Profiles created by Deadline Cloud monitor". | Verify Login is not supported when using AWS profile. |
Expand All @@ -506,7 +505,6 @@ These are the manual test cases for the client software release cycle, covering
| Submit a render job using `--output json` option (cancel) | Launch GUI Submitter using `deadline bundle gui-submit --output json <path> > output.txt`. Click submit. Immediately click cancel before the submission completes. Close the submitter. Open output.txt and ensure it is JSON exactly like: `{"status": "CANCELED"}` | |
| Submit a render job using a submitter name | Launch GUI Submitter using `deadline bundle gui-submit --submitter-name Testing <path>`. Click submit. Wait for the submission to complete. Click Ok. Ensure the submission process exits. | |
| Verify 'Load a different job bundle' button in GUI Submitter | Launch GUI Submitter using `deadline bundle gui-submit --browse`, select a job bundle. Verify correct defaults/details. Hit 'Load a different job bundle' button and select a second job bundle. Verify correct defaults/details for the second bundle. | |
| Verify 'Export job bundle' button in GUI Submitter | | |
| Verify all GUI Submitter dialogue controls work | Verify all dropdown options, menus, input fields, toggles, checkboxes, radio buttons work as expected. Verify all tabs: Shared job settings, Job-specific settings, Job attachments, Host requirements (both 'Run on all worker hosts' and 'Run on worker hosts that meet the following requirements' options). | |
| Verify download output for a job in DCM browser | With the Deadline CLI registered as the download handler, verify download output for a job in DCM browser. | macOS: handler not currently supported, must use direct CLI commands. |
| Test Deadline Cloud release candidate against currently released DCC Submitter | A Blender manual install might be easiest. Build deadline-cloud from the release candidate branch and pip install it into the submitter dependencies instead of the latest in PyPi. | |
Expand All @@ -518,10 +516,6 @@ These are the manual test cases for the client software release cycle, covering
| `deadline handle-web-url --uninstall` | | macOS: Verify 'Uninstalling the web URL handler is not supported on OS darwin' message appears. |
| `deadline --help` | Verify correct information is displayed. | |
| `deadline -h` | Verify correct information is displayed. | |
| `deadline --log-level ERROR` | Must include command after level (e.g. `deadline --log-level ERROR farm list`). | |
| `deadline --log-level WARNING` | | |
| `deadline --log-level INFO` | | |
| `deadline --log-level DEBUG` | | |

## Job Attachments Tests

Expand Down
9 changes: 9 additions & 0 deletions hatch.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ pre-install-commands = [
test = "pytest --xfail-tb --no-cov -vvv --numprocesses=1 {args:test/integ}"
proxy-test = "sudo -E env PATH=$PATH bash scripts/run_proxy_integ_tests.sh {args:test/integ/cli/}"

[envs.ui]
features = ["gui"]
pre-install-commands = [
"pip install -r requirements-ui-testing.txt",
]

[envs.ui.scripts]
test = "pytest --no-cov -vvv --numprocesses=1 -o \"testpaths=test/ui\" --confcutdir=test/ui {args:test/ui}"

[envs.installer]
pre-install-commands = ["pip install -r requirements-installer.txt"]

Expand Down
5 changes: 5 additions & 0 deletions requirements-ui-testing.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pytest == 9.*
pytest-timeout >= 2.3
pytest-cov >= 4
pytest-xdist >= 3
xa11y == 0.6.*
1 change: 1 addition & 0 deletions test/mock_server/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
21 changes: 21 additions & 0 deletions test/mock_server/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

"""Standalone entry point: python -m test.mock_server"""

from ._server import create_server


def main() -> None:
server = create_server(port=8000)
_, port = server.server_address # type: ignore[misc]
print(f"Mock Deadline server listening on http://localhost:{port}")
print("Set AWS_ENDPOINT_URL_DEADLINE=http://localhost:8000 to use with the deadline CLI")
try:
server.serve_forever()
except KeyboardInterrupt:
print("\nShutting down.")
server.shutdown()


if __name__ == "__main__":
main()
Loading
Loading