AWS Deadline Cloud Test Fixtures
This package contains pytest fixtures that are used to test AWS Deadline Cloud Python packages.
Usage
To use this package:
- Install it into your test environment
- Configure environment variables needed for your tests (see src/deadline_test_fixtures/example_config.sh for available options)
- Use the fixtures in your tests (see src/deadline_test_fixtures/fixtures.py for available fixtures)
For example, to use the worker fixture:
from deadline_test_fixtures import DeadlineWorker
def test_something_with_the_worker(worker: DeadlineWorker) -> None:
# GIVEN
worker.start()
# WHEN
result = worker.send_command("some command")
# THEN
assert result.stdout == "expected output"
You can also import the classes from this package directly to build your own fixtures
# double_worker.py
from deadline_test_fixtures import (
DeadlineWorker,
EC2InstanceWorker,
DockerContainerWorker,
)
class DoubleWorker(DeadlineWorker):
def __init__(
self,
# args...
) -> None:
self.ec2_worker = EC2InstanceWorker(
# args...
)
self.docker_worker = DockerContainerWorker(
# args...
)
def start(self) -> None:
self.ec2_worker.start()
self.docker_worker.start()
# etc.
# test_something.py
from .double_worker import DoubleWorker
import pytest
@pytest.fixture
def double_worker() -> DoubleWorker:
return DoubleWorker(
# args...
)
def test_something(double_worker: DoubleWorker) -> None:
# GIVEN
double_worker.start()
# etc.
DCC UI Test Components
The standard package installation includes the dependencies needed to test a graphical submitter:
pip install deadline-cloud-test-fixtures
The package provides four independent building blocks:
deadline_test_fixtures.deadline_mock: an observable, scenario-driven Deadline REST-JSON server.MockDeadlineServerProcessruns it outside the pytest process so native accessibility waits cannot starve the server thread.deadline_test_fixtures.xa11y: cross-platform accessibility application discovery and reusable widget controls.deadline_test_fixtures.job_bundle: conventional case directories and structural bundle comparison with configurable normalization.deadline_test_fixtures.images: render comparison by dimensions and pixel tolerance.
Each DCC remains responsible for launching its host application and opening its plugin. A typical offline test setup is:
import os
from deadline_test_fixtures.deadline_mock import (
MockDeadlineServerProcess,
build_mock_environment,
write_deadline_config,
)
with MockDeadlineServerProcess() as server:
backend = server.backend
assert backend is not None and server.base_url is not None
write_deadline_config(
tmp_path / "deadline.config",
farm_id=backend.farm_id,
queue_id=backend.queue_id,
job_history_dir=tmp_path / "job_history",
)
env = build_mock_environment(
os.environ,
deadline_endpoint_url=server.base_url,
config_path=tmp_path / "deadline.config",
home_dir=tmp_path / "home",
)
# Launch the DCC with env, then locate its accessibility application.
find_accessibility_app locates a DCC host or submitter dialog by process ID
and an optional application-name prefix. Each DCC remains responsible for
launching, monitoring, and terminating its host process.
Deadline's service model injects a management. host prefix. A DCC subprocess
must disable that injection or redirect management.* to loopback; the default
DEADLINE_CLOUD_MOCK_MODE=1 environment marker is provided for a test sidecar
to enable that behavior.
Telemetry
This library collects telemetry data by default. Telemetry events contain non-personally-identifiable information that helps us understand how users interact with our software so we know what features our customers use, and/or what existing pain points are.
You can opt out of telemetry data collection by either:
- Setting the environment variable:
DEADLINE_CLOUD_TELEMETRY_OPT_OUT=true - Setting the config file:
deadline config set telemetry.opt_out true
Note that setting the environment variable supersedes the config file setting.
Build / Test / Release
Build the package.
hatch build
Run tests
hatch run test
Run linting
hatch run lint
Run formating
hatch run fmt
Run a tests for all supported Python versions.
hatch run all:test
Compatibility
This library requires:
- Python 3.9 or higher; and
- Linux, MacOS, or Windows operating system.
Versioning
This package's version follows Semantic Versioning 2.0, but is still considered to be in its initial development, thus backwards incompatible versions are denoted by minor version bumps. To help illustrate how versions will increment during this initial development stage, they are described below:
- The MAJOR version is currently 0, indicating initial development.
- The MINOR version is currently incremented when backwards incompatible changes are introduced to the public API.
- The PATCH version is currently incremented when bug fixes or backwards compatible changes are introduced to the public API.
Downloading
You can download this package from:
Security
See CONTRIBUTING for more information.
License
This project is licensed under the Apache-2.0 License.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file deadline_cloud_test_fixtures-0.18.17.tar.gz.
File metadata
- Download URL: deadline_cloud_test_fixtures-0.18.17.tar.gz
- Upload date:
- Size: 65.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e362de7a1be218fc10ee38130c614ea268247139bce3325635198f24e2a903a
|
|
| MD5 |
c01edca25bc3a4230e2c49133884cccb
|
|
| BLAKE2b-256 |
f7be74e5b24f59434723dd511e66deed33c3f7650e148d8a64f2865576cf3734
|
Provenance
The following attestation bundles were made for deadline_cloud_test_fixtures-0.18.17.tar.gz:
Publisher:
release_publish.yml on aws-deadline/deadline-cloud-test-fixtures
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
deadline_cloud_test_fixtures-0.18.17.tar.gz -
Subject digest:
5e362de7a1be218fc10ee38130c614ea268247139bce3325635198f24e2a903a - Sigstore transparency entry: 2191900579
- Sigstore integration time:
-
Permalink:
aws-deadline/deadline-cloud-test-fixtures@b7cf096da9d6f03d986c4be048a560395c38493c -
Branch / Tag:
refs/heads/mainline - Owner: https://github.com/aws-deadline
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release_publish.yml@b7cf096da9d6f03d986c4be048a560395c38493c -
Trigger Event:
push
-
Statement type:
File details
Details for the file deadline_cloud_test_fixtures-0.18.17-py3-none-any.whl.
File metadata
- Download URL: deadline_cloud_test_fixtures-0.18.17-py3-none-any.whl
- Upload date:
- Size: 79.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c8b6847835096426079bd53458eb25d0b8e9247e78200114e119c0dbd6b28f48
|
|
| MD5 |
90b083aaace83bf29c63983877a5059e
|
|
| BLAKE2b-256 |
36baee83010de2ec7c24acd2de446459210bc777bb221f47b4bf2e76810244f0
|
Provenance
The following attestation bundles were made for deadline_cloud_test_fixtures-0.18.17-py3-none-any.whl:
Publisher:
release_publish.yml on aws-deadline/deadline-cloud-test-fixtures
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
deadline_cloud_test_fixtures-0.18.17-py3-none-any.whl -
Subject digest:
c8b6847835096426079bd53458eb25d0b8e9247e78200114e119c0dbd6b28f48 - Sigstore transparency entry: 2191900582
- Sigstore integration time:
-
Permalink:
aws-deadline/deadline-cloud-test-fixtures@b7cf096da9d6f03d986c4be048a560395c38493c -
Branch / Tag:
refs/heads/mainline - Owner: https://github.com/aws-deadline
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release_publish.yml@b7cf096da9d6f03d986c4be048a560395c38493c -
Trigger Event:
push
-
Statement type: