Пример #1
0
    def test_aws_config(self):
        args_test = copy.copy(default_args_test)
        args_test["dbnd_config"] = {
            "databand": {"env": "aws"},
            "aws": {EnvConfig.root: TEST_ENV__AWS_ROOT},
        }
        with DAG(dag_id="test_aws_config", default_args=args_test) as dag_operators:
            t_A()

        result = run_and_get(dag_operators, task_id="t_A")
        b_result = result["result"]
        assert b_result.startswith("s3://dbnd-test/databand_project/dev/")
Пример #2
0
    def test_aws_config(self):
        args_test = copy.copy(default_args_test)
        args_test["dbnd_config"] = {
            DatabandSystemConfig.env: "aws",
            CoreConfig.environments: ["aws"],
            "aws": {EnvConfig.root: "s3://ssss"},
        }
        with DAG(dag_id="test_aws_config", default_args=args_test) as dag_operators:
            t_A()

        t_a = dag_operators.task_dict["t_A"]
        assert t_a == "checkcheck"
Пример #3
0
import dbnd

from test_dbnd_airflow.airflow_home.dags.dag_test_examples import (
    default_args_test,
    t_A,
    t_B,
    t_pipeline,
)
from test_dbnd_airflow.functional.utils import read_xcom_result_value, run_and_get

str(dbnd)

# we need all these dags at file level, so we can use standard airflow executor to run them.
with DAG(dag_id="test_simple_build",
         default_args=default_args_test) as dag_simple_build:
    t_A("check", 2)

with DAG(dag_id="test_simple_run_wiring",
         default_args=default_args_test) as dag_simple_run_wiring:
    a = t_A("check")
    b = t_B(a, expected="checkcheck")

with DAG(dag_id="dag_with_pipeline",
         default_args=default_args_test) as dag_with_pipeline:
    t_pipeline()

default_args_config_dag = copy.copy(default_args_test)
default_args_config_dag["dbnd_config"] = {t_pipeline.task.p_str: "from_config"}

with DAG(dag_id="dag_with_config",
         default_args=default_args_config_dag) as dag_with_config: