airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] yrqls21 commented on a change in pull request #3698: [AIRFLOW-2855] Check Cron Expression Validity in DagBag.process_file()
Date Mon, 06 Aug 2018 06:44:33 GMT
yrqls21 commented on a change in pull request #3698: [AIRFLOW-2855] Check Cron Expression Validity
in DagBag.process_file()
URL: https://github.com/apache/incubator-airflow/pull/3698#discussion_r207786890
 
 

 ##########
 File path: tests/models.py
 ##########
 @@ -1038,6 +1038,21 @@ def test_zip(self):
         dagbag.process_file(os.path.join(TEST_DAGS_FOLDER, "test_zip.zip"))
         self.assertTrue(dagbag.get_dag("test_zip_dag"))
 
+    def test_process_file_cron_validity_check(self):
+        """
+        test if an invalid cron expression
+        as schedule interval can be identified
+        """
+        invalid_dag_files = ["test_invalid_cron.py", "test_zip_invalid_cron.zip"]
+        dagbag = models.DagBag()
+
+        for d in invalid_dag_files:
+            dagbag.process_file(os.path.join(TEST_DAGS_FOLDER, d))
+
+        for d in invalid_dag_files:
+            self.assertTrue(any([d in k and "Invalid Cron expression" in v
 
 Review comment:
   NIT: I think we don't need `any`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message