Integration tests and examples
Integration tests and maintained examples show whether Dagster works as a complete system in real use. Tests check service boundaries, package interoperability, version changes, and deployment behavior. Examples turn these workflows into runnable projects that engineers can study and adapt. See Quality and validation for the wider validation model.
Integration validation
Integration validation connects Dagster processes to the services and environments that users depend on. A check passes only when the full workflow produces the expected run state, event record, external object, or service response.
This diagram shows how an integration check turns Dagster code into an observed workflow result.
flowchart LR
A[Dagster code and packages] --> B[Integration environment]
B --> C[Run or service action]
C --> D[Observed result]
D --> E[Workflow contract]
Service and package interoperability
The integration suites check that Dagster packages work together across process and service boundaries. Kubernetes and Celery-on-Kubernetes suites run jobs in container environments and check success, failure, cancellation, executor settings, image selection, resource settings, and metadata propagation. These checks protect the contract between orchestration code, workers, storage, GraphQL, Docker, and Kubernetes. (integration_tests/…/test_integration.py• L54-267; integration_tests/…/test_executor.py• L40-228; integration_tests/…/test_integration.py• L48-193)
The Kubernetes test environment uses an isolated cluster and prepares its images before the workflow starts. Shared helpers wait for GraphQL to report that each code location has loaded its repositories. Pod readiness alone is not treated as workspace readiness. (integration_tests/…/kind.py• L21-89; integration_tests/…/integration_utils.py• L151-203)
Each suite has a declared package set and a lock file for its test environment. The Kubernetes test infrastructure now resolves Python 3.11 through 3.14. Example projects keep their own environment contracts. The Airlift federation tutorial remains fixed to Python 3.11 because its workflow depends on that exact environment. (integration_tests/…/uv.lock• L1-8; examples/…/uv.lock• L1-8)
The Celery-on-Kubernetes suite runs with a message broker mode selected by the test marker. Its test command uses long timeouts because cluster setup and image loading are part of the workflow. (integration_tests/…/tox.ini• L23-34)
The Azure live suite checks behavior against real Azure Blob Storage. It runs an asset and reads captured compute logs from the configured storage path or from URLs returned by Dagster. This validates credential modes and the link between log capture, event data, and cloud storage. (integration_tests/…/conftest.py• L23-74; integration_tests/…/test_compute_log_manager.py• L17-62)
References: integration_tests/…/test_integration.py• L54-267 integration_tests/…/test_executor.py• L40-228 integration_tests/…/test_integration.py• L48-193 integration_tests/…/tox.ini• L23-34 integration_tests/…/kind.py• L21-89 integration_tests/…/integration_utils.py• L151-203 integration_tests/…/uv.lock• L1-8 integration_tests/…/test_compute_log_manager.py• L17-62 examples/…/uv.lock• L1-8
Runtime health and lifecycle
The daemon suite checks the long-running control plane rather than one isolated run. It verifies healthy heartbeats, stale heartbeat detection, thread failure, repeated errors, workspace refresh failure, and duplicate controllers. Monitoring checks also verify that a daemon can resume a stopped Docker run and that the run fails when its allowed resume attempts are exhausted. These checks protect the signals used to decide whether scheduled and sensor-driven work can continue. (integration_tests/…/test_daemon.py• L14-29; integration_tests/…/test_dagster_daemon_health.py• L21-83; integration_tests/…/test_dagster_daemon_health.py• L105-185; integration_tests/…/test_monitoring.py• L103-280)
Resource cleanup is part of a workflow contract. Kubernetes and Celery-on-Kubernetes checks verify that cancellation or pod deletion produces the right events and removes the related run resources. The check therefore covers the path from launch through cleanup. (integration_tests/…/test_executor.py• L276-332; integration_tests/…/test_integration.py• L82-173)
The daemon suite runs ordinary checks in parallel and runs checks marked as serial in a separate pass. This keeps its single local service stack from colliding with another test worker. (integration_tests/…/tox.ini• L24-32; integration_tests/…/test_monitoring.py• L27-40)
References: integration_tests/…/test_daemon.py• L14-29 integration_tests/…/test_dagster_daemon_health.py• L21-83 integration_tests/…/test_dagster_daemon_health.py• L105-185 integration_tests/…/test_monitoring.py• L103-280 integration_tests/…/tox.ini• L24-32 integration_tests/…/test_monitoring.py• L27-40 integration_tests/…/test_executor.py• L276-332 integration_tests/…/test_integration.py• L82-173
Version compatibility
The back-compatibility suite checks communication between current host services and older user-code processes. It builds a version pair as Docker services, submits jobs through GraphQL, and checks the result through public run and repository views. This protects upgrades in which deployed user code does not change at the same time as the host process. (integration_tests/…/README.md• L1-4; integration_tests/…/test_backcompat.py• L166-253)
The suite checks the latest available release and the earliest release that the project still supports. It also checks that older serialized definitions can be read and that repository contents remain visible across the boundary. Its build path can use source or release images and keeps the old release's Python version and dependency pins when required. (integration_tests/…/README.md• L27-49; integration_tests/…/test_backcompat.py• L25-57; integration_tests/…/test_backcompat.py• L74-105; integration_tests/…/build.sh• L8-26; integration_tests/…/pins.txt• L1-19)
References: integration_tests/…/README.md• L1-4 integration_tests/…/README.md• L27-49 integration_tests/…/test_backcompat.py• L25-57 integration_tests/…/test_backcompat.py• L74-105 integration_tests/…/test_backcompat.py• L166-253 integration_tests/…/build.sh• L8-26 integration_tests/…/pins.txt• L1-19
Maintained example projects
Example projects provide runnable reference workflows rather than isolated code samples. The collection includes teaching projects, integration-focused projects, deployment references, documentation projects, and use cases that feed the Dagster website. Projects marked UNMAINTAINED remain useful references but do not promise current behavior. (examples/README.md• L1-6; examples/…/README.md• L1-16)
Workflow examples
The quickstart and smoke-test examples show the path from data input to materialized output. The quickstart combines ingestion, transformation, visualization, metadata, and a daily schedule in one ETL workflow. The smoke-test project extends this path to Python-only and Python-plus-dbt asset graphs. The quickstart resolves Python 3.11 through 3.14. The smoke-test project uses Dagster's asset, dbt, pandas, and Snowflake packages and remains capped below Python 3.14. (examples/…/README.md• L23-42; examples/…/definitions.py• L1-8; examples/…/schedules.py• L1-5; examples/…/test_defs.py• L1-5; examples/…/pyproject.toml• L1-18; examples/…/uv.lock• L1-12; examples/…/README.md• L1-10; examples/…/pyproject.toml• L5-18; examples/…/pyproject.toml• L27-52; examples/…/uv.lock• L1-13)
The development-to-production example focuses on safe movement between environments. It uses run configuration and replaceable resources so local work does not overwrite production data. Its tests use mock data to check asset correctness without production systems. Its environment now resolves Python 3.11 through 3.14. (examples/…/README.md• L1-6; examples/…/pyproject.toml• L5-18; examples/…/uv.lock• L1-13)
The Airlift migration and Starlift tutorial projects keep their dbt inputs and compiled dependency pins together. Their shared dbt environments cover DuckDB, dbt Core, and SQL linting so the tutorial path can be reproduced without an untracked dependency choice. (examples/airlift-migration-tutorial/tutorial_example/shared/dbt/requirements.in#L1-L11; examples/…/requirements.txt• L1-8; examples/starlift-demo/dbt_example/shared/dbt/requirements.in#L1-L11; examples/…/requirements.txt• L1-8; examples/…/uv.lock• L1-13; examples/…/uv.lock• L1-15)
The Airlift federation tutorial now has a locked Python 3.11 environment with editable Dagster and Airlift packages plus its test dependencies. This keeps its federation workflow tied to the local package versions used by the repository. (examples/…/uv.lock• L1-8; examples/…/uv.lock• L126-168)
References: examples/README.md• L1-6 examples/…/README.md• L23-42 examples/…/definitions.py• L1-8 examples/…/schedules.py• L1-5 examples/…/test_defs.py• L1-5 examples/…/pyproject.toml• L1-18 examples/…/README.md• L1-10 examples/…/pyproject.toml• L5-18 examples/…/pyproject.toml• L27-52 examples/…/uv.lock• L1-13 examples/…/README.md• L1-6 examples/…/pyproject.toml• L5-18 examples/…/uv.lock• L1-13 examples/…/requirements.in• L1-11 examples/…/requirements.txt• L1-8 examples/…/requirements.in• L1-11 examples/…/requirements.txt• L1-8 examples/…/uv.lock• L1-13 examples/…/uv.lock• L1-15 examples/…/uv.lock• L1-8 examples/…/uv.lock• L126-168 examples/…/README.md• L1-16
Package interoperability examples
Integration examples show how Dagster features meet external packages and services. Larger projects combine assets, schedules, sensors, resources, I/O managers, dbt, cloud storage, and external compute. Multi-tenant and multi-platform examples show how separate code locations can share orchestration while keeping workflows and runtime choices distinct. (examples/…/README.md• L5-14; examples/…/README.md• L1-10; examples/…/README.md• L83-116)
Standalone documentation projects keep complete integration paths in a runnable project shape. The ELT project joins Dagster with Sling, dlt, and DuckDB. The multi-workspace Databricks project joins Databricks and Fivetran with Kafka. Both declare Python 3.11 through 3.14 so the documented project setup has a clear runtime range. (examples/…/pyproject.toml• L1-18; examples/…/pyproject.toml• L1-18)
The Databricks and Snowflake project also demonstrates a configurable lakehouse flow. It can create bronze sensor data, clean it into a silver table, and produce a gold summary. Demo mode supplies local data when a connected source is not available, while the same asset shape records table paths and row counts for a real deployment. (examples/…/component.py• L17-24; examples/…/component.py• L36-74; examples/…/component.py• L76-136; examples/…/component.py• L138-214; examples/…/uv.lock• L1-13; examples/…/uv.lock• L1-13)
The OpenAI example shows a partitioned retrieval workflow. It reads documentation by category, builds a search index, and uses a configured OpenAI client to answer a question from the indexed content. This makes the boundary between asset partitions, an external API, and downstream computation visible in one small project. (examples/…/assets.py• L23-59; examples/…/assets.py• L62-119; examples/…/utils.py• L22-35; examples/…/pyproject.toml• L5-27; examples/…/baseline.py• L15-31)
Documentation snippets cover user-facing boundaries for data stores, SaaS systems, file sources, and external compute. They show resources that read or write external systems, sensors that create runs from new data, and external processes that send status and materialization events back to Dagster. A Modal example extends this boundary to remote speech transcription: it mounts cloud storage, splits audio, runs Whisper work remotely, writes a transcript, and reports the materialization. Cursor and run-key examples show how a workflow avoids processing the same input twice. (examples/…/clickhouse.py• L7-32; examples/…/databricks_pipes_run_job.py• L9-36; examples/…/sftp.py• L28-64; examples/…/sharepoint.py• L30-80; examples/…/transcribe.py• L83-95; examples/…/transcribe.py• L152-198; examples/…/transcribe.py• L204-275)
External assets can represent data produced outside Dagster. The maintained snippets record those materializations through sensors or track external database table updates with a cursor. Dagster Pipes examples show the same boundary in a container that sends work and status back to Dagster. (examples/…/external_asset_using_sensor.py• L10-30; examples/…/da_external_db_tables.py• L5-41; examples/experimental/external_assets/Dockerfile.materialize#L1-L12; examples/docs_snippets/docs_snippets/integrations/external_pipelines/dagster_pipes/emr-containers/Dockerfile#L1-L23)
The use case repository presents practical workflows for the Dagster website and for engineers who need a starting point. Each use case pairs a Markdown description with a Python implementation. Automated checks cover the Python side while the website consumes both files. Its project now resolves Python 3.11 through 3.14. (examples/…/README.md• L1-32; examples/…/test_use_cases.py• L1-11; examples/…/uv.lock• L1-13)
References: examples/…/README.md• L5-14 examples/…/README.md• L1-10 examples/…/uv.lock• L1-17 examples/…/README.md• L83-116 examples/…/pyproject.toml• L1-18 examples/…/pyproject.toml• L1-18 examples/…/component.py• L17-24 examples/…/component.py• L36-74 examples/…/component.py• L76-136 examples/…/component.py• L138-214 examples/…/uv.lock• L1-13 examples/…/uv.lock• L1-13 examples/…/assets.py• L23-59 examples/…/assets.py• L62-119 examples/…/utils.py• L22-35 examples/…/pyproject.toml• L5-27 examples/…/baseline.py• L15-31 examples/…/clickhouse.py• L7-32 examples/…/databricks_pipes_run_job.py• L9-36 examples/…/sftp.py• L28-64 examples/…/sharepoint.py• L30-80 examples/…/transcribe.py• L83-95 examples/…/transcribe.py• L152-198 examples/…/transcribe.py• L204-275 examples/…/external_asset_using_sensor.py• L10-30 examples/…/da_external_db_tables.py• L5-41 examples/…/Dockerfile.materialize• L1-12 examples/…/Dockerfile• L1-23 examples/…/README.md• L1-32 examples/…/test_use_cases.py• L1-11 examples/…/uv.lock• L1-13
Deployment patterns
Deployment examples show how a Dagster project moves from source files to a running service. The Kubernetes example supports a container deployment guide. The ECS example covers image build and push, cloud deployment, rolling updates, and teardown. Its deployment test uses a local ECS simulation so the reference stack can be checked without a live cluster. (examples/…/README.md• L1-3; examples/…/README.md• L33-60; examples/…/test_deploy.py• L80-127; examples/…/uv.lock• L1-13)
Docker examples separate the Dagster webserver and daemon image from the user-code image. The source variants install the repository's local packages, while the regular variants install released packages. ECS follows the same separation and provides source and released-image paths. This gives engineers a deployment model that works from a package release or from a source checkout. (examples/deploy_docker/Dockerfile_dagster#L1-L20; examples/deploy_docker/Dockerfile_user_code#L1-L21; examples/deploy_docker/from_source/Dockerfile_dagster#L1-L27; examples/deploy_docker/from_source/Dockerfile_user_code#L1-L30; examples/deploy_ecs/Dockerfile#L1-L30; examples/deploy_ecs/from_source/Dockerfile#L1-L51; examples/…/uv.lock• L1-13)
Branch-deployment examples add environment isolation by selecting preview or production data resources. These examples explain the intended user path, while live integration suites check that the service and external-system contracts hold. (examples/…/build.sh• L3-12; examples/…/build.sh• L3-12; examples/…/repository_v2.py• L10-73)
References: examples/…/README.md• L1-3 examples/…/README.md• L33-60 examples/…/test_deploy.py• L80-127 examples/…/uv.lock• L1-13 examples/…/Dockerfile_dagster• L1-20 examples/…/Dockerfile_user_code• L1-21 examples/…/Dockerfile_dagster• L1-27 examples/…/Dockerfile_user_code• L1-30 examples/…/uv.lock• L1-13 examples/…/Dockerfile• L1-30 examples/…/Dockerfile• L1-51 examples/…/build.sh• L3-12 examples/…/build.sh• L3-12 examples/…/repository_v2.py• L10-73
Documentation snippet workflows
The docs snippets project keeps user-facing code and command output runnable in CI. Load checks confirm that snippet files can run. Snapshot checks compare expected CLI output and support focused regeneration when a documented command changes. Its test environment covers a broad set of Dagster integrations. The main snippets project remains capped below Python 3.14, while several standalone documentation projects resolve through Python 3.14. (examples/…/README.md• L25-79; examples/…/README.md• L1-31; examples/…/pyproject.toml• L5-12; examples/…/pyproject.toml• L52-132; examples/…/uv.lock• L1-13; examples/…/uv.lock• L1-13)
The Scala Spark Pipes example extends this workflow to a non-Python process. Its image provides Spark and Dagster Pipes, while the build keeps the Scala and Java toolchain aligned with the Spark runtime and bundles the required non-Spark dependencies into a JAR. The lock file records the resolved JVM dependency set. This validates the deployment boundary between Dagster, Spark, and an external process. (examples/docs_snippets/docs_snippets/integrations/external_pipelines/dagster_pipes/scalaspark/Dockerfile#L1-L23; examples/…/build.gradle• L13-30; examples/…/build.gradle• L55-78; examples/docs_snippets/docs_snippets/integrations/external_pipelines/dagster_pipes/scalaspark/gradle.lockfile#L1-L5)
The dbt component examples separate local project execution from remote repository configuration. Local checks cover scaffolding, definition discovery, asset execution, and component settings. Remote checks cover the scaffold command and generated configuration without claiming that the external repository can be fetched. (examples/…/test_dbt_component.py• L25-140; examples/…/test_dbt_component_remote.py• L20-94)
The snapshot harness uses isolated temporary environments, removes machine-specific output, and compares results with checked-in snippets. Each snapshot directory has one owning test. An update fails if it drops a file that the test did not rewrite. The migration guide includes a separate locked example project, so that project must keep its own environment aligned with the guide. (examples/…/README.md• L7-46; examples/…/utils.py• L164-207; examples/…/utils.py• L286-367; examples/…/utils.py• L470-519; examples/…/uv.lock• L1-13)
References: examples/…/README.md• L25-79 examples/…/README.md• L1-46 examples/…/utils.py• L164-207 examples/…/utils.py• L286-367 examples/…/utils.py• L470-519 examples/…/test_dbt_component.py• L25-140 examples/…/test_dbt_component_remote.py• L20-94 examples/…/pyproject.toml• L5-12 examples/…/pyproject.toml• L52-132 examples/…/uv.lock• L1-13 examples/…/uv.lock• L1-13 examples/…/Dockerfile• L1-23 examples/…/build.gradle• L13-30 examples/…/build.gradle• L55-78 examples/…/gradle.lockfile• L1-5 examples/…/uv.lock• L1-13
Change checklist
When these files or sections are changed, remember to consider these:
- Update the integration suite when a run, event, GraphQL, serialized-definition, or external-storage contract changes.
- Keep each suite's project metadata and lock file aligned with its supported Python range and package set.
- Keep example project metadata and lock files aligned. The Airlift federation tutorial is fixed to Python 3.11, while the Kubernetes test infrastructure supports Python 3.11 through 3.14.
- Review both the example and its related integration test when a package boundary changes. A local mock can hide a mismatch that a live service exposes.
- Preserve Docker, Kubernetes, AWS, and Azure startup assumptions when changing fixtures or service setup.
- Keep the kind image cache, image pull path, and workspace-load wait aligned when Kubernetes test startup changes.
- Keep Docker and ECS source builds valid for both standalone and monorepo checkouts.
- Keep the docs snippets project and its migration-guide example within compatible Python and package ranges when the documented project model changes.
- Keep standalone documentation project dependencies and project metadata aligned with the integration workflow they describe.
- Keep the Scala Spark image, Gradle dependency lock, Spark version, and Dagster Pipes client aligned.
- Keep the local and remote dbt snapshot directories owned by their matching tests.
- Keep each use case's Markdown description and Python implementation aligned because the website consumes both while automated checks cover only the Python side.
- Keep
UNMAINTAINEDlabels accurate so engineers do not treat an old example as a current support promise. - Keep daemon monitoring tests serial when they use fixed service names or ports.
- Keep resume-attempt settings aligned with the expected run outcome in monitoring checks.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| A Python example lock file resolves a different range or local package set from its project metadata | The example tests a different workflow from the one its project declares | Re-sync the lock file and check its Python markers and local Dagster sources. |
| Workspace polling accepts pod readiness without a loaded repository location | A launch races workspace loading and reports a missing job | Wait for GraphQL to report a loaded repository location before launching a run. |
| Run cancellation does not reach workers or external jobs | Resources remain active and the run state does not match the user action | Check terminal status, events, and resource removal after cancellation. |
| Current host code cannot communicate with the selected older user-code release | Upgrade or rollback workflows fail across the process boundary | Run the back-compat matrix and inspect service logs. |
| A daemon monitoring stack runs in parallel with another copy | Fixed container names or ports collide and the health check becomes unreliable | Run serial monitoring checks in their separate tox pass. |
| A stopped monitored run has the wrong resume-attempt limit | The test reports success when the contract requires failure, or hides a recovery defect | Match max_resume_run_attempts to the expected terminal state. |
| An example's declared dependency or deployment file drifts from its test path | The example may look valid but fail for a new user or CI environment | Treat the runnable example and its project tests as one workflow contract. |
| A docs snapshot is regenerated without its owning test or isolated output rules | The guide can lose files or show machine-specific output | Use one owning test per snapshot directory and keep output masks current. |
| The Scala Spark application or its Gradle lock drifts from the Spark image | The external process cannot build or run with the documented runtime | Keep the Spark version, bundled JAR inputs, and locked dependencies aligned. |
| The remote dbt snippet is treated as proof that the external repository can be fetched or loaded | Remote repository failures remain hidden | Use the remote snapshot for configuration and a separate end-to-end check for repository access. |
| A use case Markdown file changes without its Python file, or the reverse | The website can describe a workflow that does not match its tested implementation | Change the paired files together and preview the website content. |
| A deployment image mixes the control-plane package set with user-code dependencies | The service starts with a different boundary from the documented deployment pattern | Keep webserver and daemon images separate from the user-code image and validate both source and release builds. |
| An external-compute example omits its storage mount, tool package, or materialization event | Remote work finishes without a usable asset result in Dagster | Keep the external process, shared storage, and Dagster Pipes or materialization contract together. |
Key files
| File | Why to read it |
|---|---|
| integration_tests/…/test_integration.py | Shows end-to-end Kubernetes run and failure checks. |
| integration_tests/…/test_executor.py | Shows executor, pod, label, and resource checks. |
| integration_tests/…/integration_utils.py | Shows how tests cross GraphQL and workspace boundaries. |
| integration_tests/…/uv.lock | Shows the supported Python range for the Kubernetes test infrastructure. |
| integration_tests/…/tox.ini | Shows broker modes and the runtime limits for cluster tests. |
| integration_tests/…/test_backcompat.py | Shows current-host and older-user-code checks. |
| integration_tests/…/build.sh | Shows how source and release version pairs become test images. |
| integration_tests/…/test_monitoring.py | Shows daemon recovery and resume-attempt behavior in a Docker-backed run. |
| integration_tests/…/tox.ini | Shows the split between parallel and serial daemon checks. |
| examples/README.md | Defines the purpose and maintenance status of the example collection. |
| examples/…/pyproject.toml | Shows the current environment contract for the quickstart workflow. |
| examples/…/pyproject.toml | Shows a smoke workflow that combines Dagster assets with dbt and Snowflake packages. |
| examples/…/pyproject.toml | Shows the local-to-production workflow dependencies and supported Python range. |
| examples/…/uv.lock | Shows the Python 3.11 and local-package contract for the Airlift federation tutorial. |
examples/airlift-migration-tutorial/tutorial_example/shared/dbt/requirements.in | Shows the source dependency contract for the Airlift migration tutorial. |
| examples/…/component.py | Shows a configurable bronze-to-gold lakehouse example. |
| examples/…/assets.py | Shows a partitioned external-API workflow that builds and queries a document index. |
| examples/…/README.md | Shows how practical use cases feed the website. |
| examples/…/test_use_cases.py | Shows the checks for use case implementations. |
| examples/…/test_deploy.py | Shows deployment validation with a local simulation. |
examples/deploy_docker/Dockerfile_dagster | Shows the control-plane container boundary. |
examples/deploy_docker/Dockerfile_user_code | Shows the user-code container boundary. |
| examples/…/README.md | Shows how runnable documentation examples are tested. |
| examples/…/pyproject.toml | Shows the integration set and Python cap for documentation snippets. |
| examples/…/pyproject.toml | Shows the package and runtime contract for the maintained ELT documentation project. |
| examples/…/pyproject.toml | Shows the package and project contract for the multi-workspace Databricks documentation project. |
| examples/…/utils.py | Shows isolated command execution, output normalization, and snapshot checks. |
| examples/…/build.gradle | Shows the external Scala and Spark build boundary. |
examples/docs_snippets/docs_snippets/integrations/external_pipelines/dagster_pipes/scalaspark/gradle.lockfile | Shows the resolved JVM dependency set for the Scala Spark example. |
| examples/…/test_dbt_component.py | Shows the maintained local dbt component workflow. |
| examples/…/test_dbt_component_remote.py | Shows the boundary between remote configuration and live repository access. |
| examples/…/transcribe.py | Shows an external compute workflow that mounts storage and reports a materialization. |
| examples/…/da_external_db_tables.py | Shows cursor-based observation of external database tables. |
| examples/…/uv.lock | Shows the locked environment for the migration guide's example project. |