Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Starting on test coverage #88

Merged
merged 1 commit into from
Feb 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

[Apache Airflow](https://airflow.apache.org) utilities for running long-running or always-on jobs with [supervisord](http://supervisord.org)

[![Build Status](https://github.com/timkpaine/airflow-supervisor/actions/workflows/build.yml/badge.svg)](https://github.com/timkpaine/airflow-supervisor/actions?query=workflow%3A%22Build+Status%22)
[![codecov](https://codecov.io/gh/timkpaine/airflow-supervisor/branch/main/graph/badge.svg)](https://codecov.io/gh/timkpaine/airflow-supervisor)
[![License](https://img.shields.io/github/license/timkpaine/airflow-supervisor)](https://github.com/timkpaine/airflow-supervisor)
[![Build Status](https://github.com/airflow-laminar/airflow-supervisor/actions/workflows/build.yml/badge.svg)](https://github.com/airflow-laminar/airflow-supervisor/actions?query=workflow%3A%22Build+Status%22)
[![codecov](https://codecov.io/gh/airflow-laminar/airflow-supervisor/branch/main/graph/badge.svg)](https://codecov.io/gh/airflow-laminar/airflow-supervisor)
[![License](https://img.shields.io/github/license/airflow-laminar/airflow-supervisor)](https://github.com/airflow-laminar/airflow-supervisor)
[![PyPI](https://img.shields.io/pypi/v/airflow-supervisor.svg)](https://pypi.python.org/pypi/airflow-supervisor)

## Overview
Expand Down
6 changes: 3 additions & 3 deletions airflow_supervisor/airflow/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@


class Supervisor(object):
_dag: "DAG"
_dag: DAG
_cfg: SupervisorAirflowConfiguration
_kill_dag: "DAG"
_kill_dag: DAG
_xmlrpc_client: SupervisorRemoteXMLRPCClient

def __init__(self, dag: "DAG", cfg: SupervisorAirflowConfiguration, **kwargs):
def __init__(self, dag: DAG, cfg: SupervisorAirflowConfiguration, **kwargs):
# store config
self._cfg = cfg

Expand Down
24 changes: 24 additions & 0 deletions airflow_supervisor/tests/test_dag.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from airflow.models.dag import DAG

from airflow_supervisor import Supervisor, SupervisorAirflowConfiguration


class TestDag:
def test_instantiation(self, supervisor_airflow_configuration: SupervisorAirflowConfiguration):
dag = DAG(dag_id="test_dag", default_args={}, schedule=None, params={})
s = Supervisor(dag=dag, cfg=supervisor_airflow_configuration)
assert len(dag.tasks) == 17
assert dag.catchup is False
assert dag.concurrency == 1
assert dag.max_active_tasks == 1
assert dag.max_active_runs == 1

assert s.configure_supervisor in dag.tasks
assert s.configure_supervisor in dag.tasks
assert s.start_supervisor in dag.tasks
assert s.start_programs in dag.tasks
assert s.check_programs in dag.tasks
assert s.restart_programs in dag.tasks
assert s.stop_programs in dag.tasks
assert s.stop_supervisor in dag.tasks
assert s.unconfigure_supervisor in dag.tasks