You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/07/10 14:51:47 UTC

[GitHub] [airflow] JonnyWaffles commented on issue #24948: CLI Dags Test Returns Exit Code 0 on Failure

JonnyWaffles commented on issue #24948:
URL: https://github.com/apache/airflow/issues/24948#issuecomment-1179742930

   Just a quick update, I think I got what I wanted by running the Dag as a script as follows
   ```
   if __name__ == "__main__":
       # The test command does not work from below in this Airflow version
       # but this communicates this dag is really only ever to be executed
       # in "standalone-mode" from the CLI.
       execution_date = pendulum.instance(datetime(2022, 7, 10))
       dag.clear(start_date=execution_date, end_date=execution_date, dag_run_state=False)
       dag.run(
           executor=DebugExecutor(),
           start_date=execution_date,
           end_date=execution_date,
           run_at_least_once=True
       )
   ```
   Thus bypassing the BackfillUnfinished catch in the test command. 
   
   Maybe we should alter the command to catch the failure state, and exit with it after performing the graph step? 
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org