Test and run code with the Astro IDE

Private Preview
This feature is in Private Preview.

The Astro IDE enables you to quickly test, validate, and iterate on Airflow dags without needing a local Airflow or Docker environment. Use ephemeral test Deployments to see how your code runs in a real environment, adjust Deployment settings, and troubleshoot using built-in interfaces.

How ephemeral test Deployments work

Ephemeral test Deployments offer a temporary environment to run and validate your Airflow dag changes before merging or deploying to production.

  • Start an ephemeral test Deployment to launch an isolated environment based on your project configuration.
  • Run your dag and validate behavior using real dependencies, environment variables, and integrations.
  • Detect import errors, syntax issues, or runtime problems as they occur in a realistic environment.
  • Tear down the environment automatically when testing is complete, with no impact on existing Deployments.

Configure ephemeral test Deployment settings

Ephemeral test Deployments in the Astro IDE inherit default settings from your Workspace-level Astro IDE test Deployment configuration. You can adjust session-specific settings per Deployment, such as environment variables and connections, as needed within the IDE.

Workspace-level Astro IDE test Deployment settings

You can control default resource behavior for ephemeral test Deployments in your Workspace under Workspace Settings > General > Astro IDE:

  • Test Deployment Timeout: The amount of idle time before an ephemeral test Deployment is automatically stopped.
  • Test Deployment Cluster: The cluster on which all new ephemeral test Deployments are provisioned.
  • Auto-Start Test Deployments: When enabled, the Astro IDE automatically starts an ephemeral test Deployment for every session.

These workspace-level settings apply to all ephemeral test Deployments in the Astro IDE and you can tailor them to your Organization’s needs.

Ephemeral test Deployments have some preset configurations optimized for testing. For example, AIRFLOW__SCHEDULER__USE_JOB_SCHEDULE=false disables automatic task scheduling, so tasks run only when manually triggered in the Test tab. This is by design for better test control.

Make connections available for ephemeral test Deployments

Making connections available to ephemeral test Deployments ensures your dags can access the external systems, databases, and cloud services they require for testing. This lets you accurately validate code, integrations, and data dependencies in a real environment, just as your production Deployments would.

Follow these steps to allow a connection to be used by all ephemeral test Deployments. See linked connections in the Environment Manager for more details.

Prerequisites

1

Open the connection in Astro

Go to the Connections page in your Workspace and select the connection you want to share with your ephemeral test Deployments.

2

Edit connection settings

Click the Edit button next to Deployment Sharing to open the connection settings.

3

Enable automatic linking

Turn on Automatically link to all Deployments. This grants access to this connection for all Deployments in your Workspace, including ephemeral test Deployments started in Astro IDE.

4

Save changes

Click Update Connection to save your changes.

With automatic linking enabled, the connection is available in all your ephemeral and production Deployments. You do not need to manually link it for each test session.

Access the Airflow UI

While testing, open the Airflow UI for your ephemeral Deployment to inspect dags, tasks, and metadata using Airflow-native tools.

  1. Click Start Test Deployment from your dag in Astro IDE. After the Deployment starts, a dropdown arrow appears.
  2. Click the dropdown arrow and select Open Airflow. The Airflow UI for your ephemeral test Deployment will open in a new browser tab, where you can inspect dags, tasks, logs, and environment details.