*Test Case ID*

*Test Objective*

*Test Steps*

*Expected Outcome*

*Test Type*

TC_001

Verify an asset can be created using `@asset` decorator approach.

Create a new asset using the `@asset` decorator.
@asset(dag_display_name=”asset_test”) def raw_bus_trips(): # Write bus trips data to asset…

Verify a DAG is created by the name `asset_test`.

Positive

TC_002

Verify asset’s name defaults to function name if nothing is given explicitly.

Create a new asset using the `@asset` decorator without specifying a name.
@asset def raw_bus_trips(): # Write bus trips data to asset…

Verify a DAG is created by the name `raw_bus_trips`.

Positive

TC_003

Verify URI argument is available to add in the asset but isn’t mandatory.

Create a new asset using the `@asset` decorator with and without a URI.

@asset(uri="s3://aws_conn_id@bucket/raw_bus_trips.parquet", dag_display_name=”asset_test”) def raw_bus_trips(): # Write bus trips data to asset…

Verify a DAG is created by the name `asset_test` and the task outlet is set to `s3://aws_conn_id@bucket/raw_bus_trips.parquet`.

Positive

TC_004

Verify calling the asset as a function results in a parse-time error.

Call an asset as a function.
@asset def raw_bus_trips(): # Write bus trips data to asset… Call the function raw_bus_trips()

Parse-time error.

Positive

TC_005

Verify all existing DAG arguments are available for the asset decorator except `dag_id` and `default_arguments`.

Create an asset using different arguments available.

All existing DAG arguments should be present except `dag_id` and `default_arguments`.

Positive

TC_006

Verify all existing task arguments are available for the task decorator.

Create a task inside an asset using different arguments available.

All existing task arguments should be present.

Positive

TC_007

Verify all assets in an Airflow deployment share one single namespace, which is the same for existing DAGs.

Create multiple assets using the `@asset` decorator and some DAGs using the existing approach.

All assets and DAGs should belong to a single namespace.

Positive

TC_008

Verify different assets can reference the same URI to support writing to the same data target from two functions.

Create multiple assets using the same URI.

There shouldn’t be any error, and both DAGs should write to the same outlet.

Positive

TC_009

Verify `context` and `self` can’t be used as asset names.

Create an asset with the name `self` or `context`.

Parse-time error.

Positive

TC_010

Verify an asset can be referenced in another asset’s function by passing its name as a named function argument.

Create an asset named `raw_bus_trips` and reference it in another asset’s function.
@asset(uri="snowflake://.../bus_trips") def aggregated_bus_trips(raw_bus_trips): # Write aggregated bus trips to asset…

Asset `raw_bus_trips` should be an inlet for the asset `aggregated_bus_trips`.

Positive

TC_011

Verify it’s possible for an asset to reference itself inside the function.

Create an asset that references itself inside the function.
@asset(uri="snowflake://.../bus_trips") def aggregated_bus_trips(self, *, raw_bus_trips): conn_uri, _, view_name = self.uri.rpartition("/") connection = ibis.connect(conn_uri) # Connect to Snowflake! # Write aggregated bus trips to the view using connection…

It should not give any error.

Positive

TC_012

Verify the possibility of generating multiple asset events from a single function.

Create an asset function that generates multiple events.
@asset.multi( outlets=[ Asset(name="bus_trip_1", uri="s3://../bus_trip_1.parquet"), Asset(name="bus_trip_2", uri="s3://../bus_trip_2.parquet"), ], ) def split_trips(aggregated_bus_trips): …

It should not give any error. The DAG `split_trips` should have 2 outlets.

Positive

TC_013

Verify asset dependency on another asset.

Create an asset with a dependency on another asset.
@asset(..., schedule=asset1) def asset2(): ...

`Asset2` should write after `Asset1` write is completed.

Positive

TC_014

Verify dataset references are updated to assets on CLI and API level.

Update datasets to assets.
https://airflow.apache.org/api/v1/dags/{dag_id}/datasets/queuedEvent/{uri}

Datasets should be updated to assets.

Positive

TC_015

Verify time-based schedules for an asset.

Create multiple assets with different time-based schedules (e.g., hourly, yearly, cron expressions).

Assets should work as per the mentioned schedules.

Positive

TC_016

Verify UI changes related to the asset decorator approach.

Explore the UI changes related to assets.

UI changes are not finalized yet.

N/A

  • No labels