Development and testing

C++ tests

Configure and build the test suite with:

cmake --preset release
cmake --build --preset release
ctest --preset release

The hermetic tests use injected AWS clients and need no credentials or network access. CMake does not register tests that access AWS unless BUILD_AMAZON_BRAKET_LIVE_TESTS=ON is set explicitly.

The release, debug, coverage, lint and Linux sanitizers CMake presets use separate build directories and disable live tests. Test presets exclude the live label.

On Linux, collect native coverage with the instrumented build:

cmake --preset coverage
cmake --build --preset coverage
ctest --preset coverage

When live Amazon Braket tests are intentionally required, select an AWS SDK credential source before configuring the test-specific opt-in:

cmake -S . -B build-live -DCMAKE_BUILD_TYPE=Release \
  -DBUILD_AMAZON_BRAKET_LIVE_TESTS=ON
cmake --build build-live --config Release
ctest --test-dir build-live -L live --output-on-failure

The example relies on an already selected AWS SDK credential source, such as AWS_PROFILE=hpc-quantum or a workload role. Temporary environment credentials must include AWS_SESSION_TOKEN.

The test configuration has the following boundaries:

  • Device ARNs are public identifiers and are stored directly in test code.

  • Credentials are resolved and refreshed by the AWS SDK; tests do not pass them through QDMI parameters.

  • QuantumTask tests use the automatic standard regional result bucket.

  • AMAZON_BRAKET_QDMI_RUN_LIVE_CATALOG=1 queries all nine concrete devices. The test is serial and does not submit paid QPU tasks.

The catalogue mode makes additional live AWS calls and must be enabled deliberately. Native provider-access tests use the live label and are registered only in the live CMake configuration.

To test a pre-provisioned destination instead, set AMZN_BRAKET_TASK_RESULTS_S3_URI. The dedicated per-job S3 fixture exercises the job-parameter override.

Python tests

Run a single supported Python version during development:

uvx nox -s tests-3.14

Run the minimum direct dependency versions with:

uvx nox -s minimums-3.14

The regular Python tests build the native package through the repository’s nox session and exercise the optional PennyLane and Qiskit integrations. The tested Python 3.11 through 3.15 matrix is available as uvx nox -s tests.

Collect Python coverage locally with:

uvx nox -s tests-3.14 -- --cov --cov-report=xml:coverage.xml

The PennyLane SV1 smoke test is opt-in because it submits paid QuantumTasks. To run it with any credential source supported by the AWS SDK, use:

AWS_PROFILE=hpc-quantum \
  uv run --group test pytest \
  test/python/test_pennylane_qaoa.py -m live -k cost_capped_on_sv1

Normal tests and minimum-version sessions exclude the live marker even when credentials are present. The manual live workflow selects this test explicitly and supplies AWS credentials only after the candidate wheel passes offline tests. An enabled test reports authentication failures instead of skipping them.

Documentation

Build the Sphinx and MyST documentation and standalone Doxygen native API with the dedicated nox session. Doxygen 1.15 or newer must be available on PATH:

uvx nox -s docs

Use the same session for link validation:

uvx nox -s docs -- -b linkcheck

Documentation examples are static and never submit quantum tasks during a build. Generated HTML, including the native API, is written to docs/_build/html.

Repository structure

amazon-braket-qdmi-device/
├── cmake/       CMake package configuration and dependencies
├── docs/        Sphinx and MyST documentation
├── include/     Amazon Braket-specific public and internal headers
├── python/      Python package and installed-artifact discovery
├── src/         QDMI device implementation and schema parser
└── test/        Hermetic, integration, and Python tests

Continuous integration

CI runs C++ and Python tests, minimum-dependency tests, installation checks, lint, coverage, and package builds offline. Authenticated live checks query device metadata without submitting QuantumTasks. Documentation builds also stay offline.

Dispatch live-tests.yml on main to select catalogue metadata or the paid SV1 smoke test. Paid execution requires a fresh manual request and offline validation; workflow reruns do not authorize submissions.

The SV1 smoke test runs one optimizer step on four qubits at 100 shots, with at most 20 submissions. Do not retry or broaden this workload without authorizing its budget.