Skip to main content

This package contains pytest fixtures that are used to test AWS Deadline Cloud Python packages.

Project description

AWS Deadline Cloud Test Fixtures

pypi python license

This package contains pytest fixtures that are used to test AWS Deadline Cloud Python packages.

Usage

To use this package:

  1. Install it into your test environment
  2. Configure environment variables needed for your tests (see src/deadline_test_fixtures/example_config.sh for available options)
  3. 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.

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:

  1. Setting the environment variable: DEADLINE_CLOUD_TELEMETRY_OPT_OUT=true
  2. 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:

  1. Python 3.9 or higher; and
  2. 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:

  1. The MAJOR version is currently 0, indicating initial development.
  2. The MINOR version is currently incremented when backwards incompatible changes are introduced to the public API.
  3. 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

deadline_cloud_test_fixtures-0.17.1.tar.gz (47.1 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file deadline_cloud_test_fixtures-0.17.1.tar.gz.

File metadata

File hashes

Hashes for deadline_cloud_test_fixtures-0.17.1.tar.gz
Algorithm Hash digest
SHA256 e8be1fe79d2321dc7f4a34003044d6cac132329dbf0a05670cca79d63799af7b
MD5 8ed2ce93e21df13a7fe6fcd9ba3c769d
BLAKE2b-256 1c8f990348b4d48d5cf35f1602c7e9709ff14c055d6894e61c3ec7e19c926e1f

See more details on using hashes here.

Provenance

The following attestation bundles were made for deadline_cloud_test_fixtures-0.17.1.tar.gz:

Publisher: release_publish.yml on aws-deadline/deadline-cloud-test-fixtures

Attestations:

File details

Details for the file deadline_cloud_test_fixtures-0.17.1-py3-none-any.whl.

File metadata

File hashes

Hashes for deadline_cloud_test_fixtures-0.17.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d56f7a9a8de776f60de20c56c2f38accf426fce1e197fae260e82ff327ac7ccf
MD5 6fdd31af7e28b8e7824e27106433de7b
BLAKE2b-256 0e5bad8dc8ad36e6f4645f444c3be8c22c91eb1897e1f752d98b5d2b3fcac8ab

See more details on using hashes here.

Provenance

The following attestation bundles were made for deadline_cloud_test_fixtures-0.17.1-py3-none-any.whl:

Publisher: release_publish.yml on aws-deadline/deadline-cloud-test-fixtures

Attestations:

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page