use of com.linkedin.drelephant.schedulers.AirflowScheduler in project dr-elephant by linkedin.
the class InfoExtractorTest method testGetSchedulerInstanceAirflow.
@Test
public void testGetSchedulerInstanceAirflow() {
Properties properties = new Properties();
properties.put(AirflowScheduler.AIRFLOW_DAG_ID, "airflow_dag_id");
properties.put(AirflowScheduler.AIRFLOW_DAG_RUN_EXECUTION_DATE, "airflow_dag_run_execution_date");
properties.put(AirflowScheduler.AIRFLOW_TASK_ID, "airflow_task_id");
properties.put(AirflowScheduler.AIRFLOW_TASK_INSTANCE_EXECUTION_DATE, "airflow_task_instance_execution_date");
Scheduler scheduler = InfoExtractor.getSchedulerInstance("id", properties);
assertEquals(true, scheduler instanceof AirflowScheduler);
assertEquals("airflow_dag_id", scheduler.getFlowDefId());
assertEquals("airflow_dag_id/airflow_dag_run_execution_date", scheduler.getFlowExecId());
assertEquals("airflow_dag_id/airflow_task_id", scheduler.getJobDefId());
assertEquals("airflow_dag_id/airflow_dag_run_execution_date/airflow_task_id/airflow_task_instance_execution_date", scheduler.getJobExecId());
assertEquals("airflow_task_id", scheduler.getJobName());
assertEquals("airflow", scheduler.getSchedulerName());
}
Aggregations