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 2020/06/12 00:20:47 UTC

[GitHub] [airflow] kaxil opened a new pull request #9240: Fix Airflow Tests after #9178

kaxil opened a new pull request #9240:
URL: https://github.com/apache/airflow/pull/9240


   #9178 added check to raise exception if commands don't start with `airflow tasks run`. However the test were passing on CI (mabe because of cache) but were failing on Breeze
   
   ---
   Make sure to mark the boxes below before creating PR: [x]
   
   - [x] Description above provides context of the change
   - [x] Unit tests coverage for changes (not needed for documentation changes)
   - [x] Target Github ISSUE in description if exists
   - [x] Commits follow "[How to write a good git commit message](http://chris.beams.io/posts/git-commit/)"
   - [x] Relevant documentation is updated including usage instructions.
   - [x] I will engage committers as explained in [Contribution Workflow Example](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#contribution-workflow-example).
   
   ---
   In case of fundamental code change, Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals)) is needed.
   In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
   In case of backwards incompatible changes please leave a note in [UPDATING.md](https://github.com/apache/airflow/blob/master/UPDATING.md).
   Read the [Pull Request Guidelines](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#pull-request-guidelines) for more information.
   


----------------------------------------------------------------
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.

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



[GitHub] [airflow] ashb commented on a change in pull request #9240: Fix Airflow Tests after #9178

Posted by GitBox <gi...@apache.org>.
ashb commented on a change in pull request #9240:
URL: https://github.com/apache/airflow/pull/9240#discussion_r439363821



##########
File path: tests/executors/test_local_executor.py
##########
@@ -27,13 +28,23 @@ class TestLocalExecutor(unittest.TestCase):
 
     TEST_SUCCESS_COMMANDS = 5
 
-    def execution_parallelism(self, parallelism=0):
+    @mock.patch('airflow.executors.local_executor.subprocess.check_call')
+    def execution_parallelism(self, mock_check_call, parallelism=0):
+        success_command = ['airflow', 'tasks', 'run', 'true', 'some_parameter']
+        fail_command = ['airflow', 'tasks', 'run', 'false']

Review comment:
       I could have sworn I changed this already.... :confused: 




----------------------------------------------------------------
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.

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



[GitHub] [airflow] kaxil merged pull request #9240: Further validation that only task commands are run by executors

Posted by GitBox <gi...@apache.org>.
kaxil merged pull request #9240:
URL: https://github.com/apache/airflow/pull/9240


   


----------------------------------------------------------------
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.

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



[GitHub] [airflow] kaxil commented on a change in pull request #9240: Fix Airflow Tests after #9178

Posted by GitBox <gi...@apache.org>.
kaxil commented on a change in pull request #9240:
URL: https://github.com/apache/airflow/pull/9240#discussion_r439643413



##########
File path: airflow/executors/kubernetes_executor.py
##########
@@ -459,8 +459,8 @@ def run_next(self, next_job: KubernetesJobType) -> None:
         if isinstance(command, str):
             command = [command]

Review comment:
       Done in https://github.com/apache/airflow/pull/9240/commits/0c817a5b4370f12117e59a82b5858f8ee6d488ff




----------------------------------------------------------------
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.

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



[GitHub] [airflow] kaxil commented on a change in pull request #9240: Fix Airflow Tests after #9178

Posted by GitBox <gi...@apache.org>.
kaxil commented on a change in pull request #9240:
URL: https://github.com/apache/airflow/pull/9240#discussion_r439368621



##########
File path: tests/executors/test_kubernetes_executor.py
##########
@@ -205,7 +205,7 @@ def test_run_next_exception(self, mock_get_kube_client, mock_kubernetes_job_watc
         try_number = 1
         kubernetes_executor.execute_async(key=('dag', 'task', datetime.utcnow(), try_number),
                                           queue=None,
-                                          command='command',
+                                          command=["airflow", "version"],

Review comment:
       Updated in https://github.com/apache/airflow/pull/9240/commits/3c61dfd52781231d567a4859a72d1667e1491765




----------------------------------------------------------------
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.

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



[GitHub] [airflow] ashb commented on a change in pull request #9240: Fix Airflow Tests after #9178

Posted by GitBox <gi...@apache.org>.
ashb commented on a change in pull request #9240:
URL: https://github.com/apache/airflow/pull/9240#discussion_r439364529



##########
File path: tests/executors/test_kubernetes_executor.py
##########
@@ -205,7 +205,7 @@ def test_run_next_exception(self, mock_get_kube_client, mock_kubernetes_job_watc
         try_number = 1
         kubernetes_executor.execute_async(key=('dag', 'task', datetime.utcnow(), try_number),
                                           queue=None,
-                                          command='command',
+                                          command=["airflow", "version"],

Review comment:
       This is still an invalid command. Or is the change really just to make it a list?




----------------------------------------------------------------
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.

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



[GitHub] [airflow] ashb commented on a change in pull request #9240: Fix Airflow Tests after #9178

Posted by GitBox <gi...@apache.org>.
ashb commented on a change in pull request #9240:
URL: https://github.com/apache/airflow/pull/9240#discussion_r439387198



##########
File path: airflow/executors/kubernetes_executor.py
##########
@@ -459,8 +459,8 @@ def run_next(self, next_job: KubernetesJobType) -> None:
         if isinstance(command, str):
             command = [command]

Review comment:
       Yeah, that's an _old_ workaround, it should go too.




----------------------------------------------------------------
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.

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



[GitHub] [airflow] kaxil commented on a change in pull request #9240: Fix Airflow Tests after #9178

Posted by GitBox <gi...@apache.org>.
kaxil commented on a change in pull request #9240:
URL: https://github.com/apache/airflow/pull/9240#discussion_r439370442



##########
File path: airflow/executors/kubernetes_executor.py
##########
@@ -459,8 +459,8 @@ def run_next(self, next_job: KubernetesJobType) -> None:
         if isinstance(command, str):
             command = [command]

Review comment:
       Hmm. L465:463 makes this str -> List conversion pointless i.e we no longer support strings




----------------------------------------------------------------
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.

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



[GitHub] [airflow] ashb commented on a change in pull request #9240: Fix Airflow Tests after #9178

Posted by GitBox <gi...@apache.org>.
ashb commented on a change in pull request #9240:
URL: https://github.com/apache/airflow/pull/9240#discussion_r439364141



##########
File path: tests/executors/test_local_executor.py
##########
@@ -27,13 +28,23 @@ class TestLocalExecutor(unittest.TestCase):
 
     TEST_SUCCESS_COMMANDS = 5
 
-    def execution_parallelism(self, parallelism=0):
+    @mock.patch('airflow.executors.local_executor.subprocess.check_call')
+    def execution_parallelism(self, mock_check_call, parallelism=0):
+        success_command = ['airflow', 'tasks', 'run', 'true', 'some_parameter']
+        fail_command = ['airflow', 'tasks', 'run', 'false']

Review comment:
       Oh, I did it in Celery executor, but not Local.




----------------------------------------------------------------
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.

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