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/07/05 15:17:53 UTC
[GitHub] [airflow] subkanthi opened a new pull request #9665: [AIRFLOW-8278] Added tests for yandex hooks #8278
subkanthi opened a new pull request #9665:
URL: https://github.com/apache/airflow/pull/9665
---
Make sure to mark the boxes below before creating PR: [x]
- [ ] Description above provides context of the change
- [ ] Unit tests coverage for changes (not needed for documentation changes)
- [ ] Target Github ISSUE in description if exists
- [ ] Commits follow "[How to write a good git commit message](http://chris.beams.io/posts/git-commit/)"
- [ ] Relevant documentation is updated including usage instructions.
- [ ] 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] mik-laj merged pull request #9665: [AIRFLOW-8278] Added tests for yandex hooks #8278
Posted by GitBox <gi...@apache.org>.
mik-laj merged pull request #9665:
URL: https://github.com/apache/airflow/pull/9665
----------------------------------------------------------------
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] boring-cyborg[bot] commented on pull request #9665: [AIRFLOW-8278] Added tests for yandex hooks #8278
Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on pull request #9665:
URL: https://github.com/apache/airflow/pull/9665#issuecomment-653901250
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst)
Here are some useful points:
- Pay attention to the quality of your code (flake8, pylint and type annotations). Our [pre-commits]( https://github.com/apache/airflow/blob/master/STATIC_CODE_CHECKS.rst#prerequisites-for-pre-commit-hooks) will help you with that.
- In case of a new feature add useful documentation (in docstrings or in `docs/` directory). Adding a new operator? Check this short [guide](https://github.com/apache/airflow/blob/master/docs/howto/custom-operator.rst) Consider adding an example DAG that shows how users should use it.
- Consider using [Breeze environment](https://github.com/apache/airflow/blob/master/BREEZE.rst) for testing locally, itโs a heavy docker but it ships with a working Airflow and a lot of integrations.
- Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
- Please follow [ASF Code of Conduct](https://www.apache.org/foundation/policies/conduct) for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
- Be sure to read the [Airflow Coding style]( https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#coding-style-and-best-practices).
Apache Airflow is a community-driven project and together we are making it better ๐.
In case of doubts contact the developers at:
Mailing List: dev@airflow.apache.org
Slack: https://apache-airflow-slack.herokuapp.com/
----------------------------------------------------------------
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] mik-laj edited a comment on pull request #9665: [AIRFLOW-8278] Added tests for yandex hooks #8278
Posted by GitBox <gi...@apache.org>.
mik-laj edited a comment on pull request #9665:
URL: https://github.com/apache/airflow/pull/9665#issuecomment-653941575
> @potiuk what list are you talking about?
https://github.com/apache/airflow/blob/master/tests/test_project_structure.py#L45
More info: https://github.com/apache/airflow/issues/8278
> what can I do to improve the tests?
If you want you can leave a comment. You are an YandexCloud expert, so I thought it worth giving you the chance to express your opinion.
----------------------------------------------------------------
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] mik-laj commented on a change in pull request #9665: [AIRFLOW-8278] Added tests for yandex hooks #8278
Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #9665:
URL: https://github.com/apache/airflow/pull/9665#discussion_r449920521
##########
File path: tests/providers/yandex/hooks/test_yandex.py
##########
@@ -0,0 +1,84 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+import unittest
+import mock
+
+from airflow.exceptions import AirflowException
+from airflow.providers.yandex.hooks.yandex import YandexCloudBaseHook
+
+
+class TestYandexHook(unittest.TestCase):
+
+ @mock.patch('airflow.hooks.base_hook.BaseHook.get_connection')
+ @mock.patch('airflow.providers.yandex.hooks.yandex.YandexCloudBaseHook._get_credentials')
Review comment:
get_credentials method contains important logic for this class. What do you think to complete the tests for it? Now this method is simple, but in the future new authentication methods may be needed to be added. Tests will allow easy refactoring and prevent regression.
----------------------------------------------------------------
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] mik-laj commented on a change in pull request #9665: [AIRFLOW-8278] Added tests for yandex hooks #8278
Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #9665:
URL: https://github.com/apache/airflow/pull/9665#discussion_r453178235
##########
File path: tests/providers/yandex/hooks/test_yandex.py
##########
@@ -0,0 +1,84 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+import unittest
+import mock
Review comment:
As mentioned before - https://github.com/apache/airflow/pull/9665#issuecomment-653931518, you still have to delete this file from the list of missing tests. This list is covered by unit test. We must have green CI to be able to merge this change.
```
tests/test_logging_config.py ........ [ 16%]
tests/test_project_structure.py .F
___________ TestProjectStructure.test_keep_missing_test_files_update ___________
self = <tests.test_project_structure.TestProjectStructure testMethod=test_keep_missing_test_files_update>
def test_keep_missing_test_files_update(self):
new_test_files = []
for test_file in MISSING_TEST_FILES:
if os.path.isfile(f"{ROOT_FOLDER}/{test_file}"):
new_test_files.append(test_file)
if new_test_files:
new_files_text = '\n'.join(new_test_files)
self.fail(
> "You've added a test file currently listed as missing:\n"
f"{new_files_text}"
"\n"
"Thank you very much.\n"
"Can you remove it from the list of missing tests, please?"
)
E AssertionError: You've added a test file currently listed as missing:
E tests/providers/yandex/hooks/test_yandex.py
E Thank you very much.
E Can you remove it from the list of missing tests, please?
tests/test_project_structure.py:117: AssertionError
```
----------------------------------------------------------------
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] mik-laj commented on pull request #9665: [AIRFLOW-8278] Added tests for yandex hooks #8278
Posted by GitBox <gi...@apache.org>.
mik-laj commented on pull request #9665:
URL: https://github.com/apache/airflow/pull/9665#issuecomment-653932479
@peter-volkov Can you look at it?
----------------------------------------------------------------
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] mik-laj commented on a change in pull request #9665: [AIRFLOW-8278] Added tests for yandex hooks #8278
Posted by GitBox <gi...@apache.org>.
mik-laj commented on a change in pull request #9665:
URL: https://github.com/apache/airflow/pull/9665#discussion_r449981095
##########
File path: tests/providers/yandex/hooks/test_yandex.py
##########
@@ -0,0 +1,84 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+import unittest
+import mock
Review comment:
```suggestion
from unittest import mock
```
----------------------------------------------------------------
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] mik-laj edited a comment on pull request #9665: [AIRFLOW-8278] Added tests for yandex hooks #8278
Posted by GitBox <gi...@apache.org>.
mik-laj edited a comment on pull request #9665:
URL: https://github.com/apache/airflow/pull/9665#issuecomment-653941575
> @potiuk what list are you talking about?
https://github.com/apache/airflow/blob/master/tests/test_project_structure.py#L45
> what can I do to improve the tests?
If you want you can leave a comment. You are an YandexCloud expert, so I thought it worth giving you the chance to express your opinion.
----------------------------------------------------------------
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] peter-volkov commented on a change in pull request #9665: [AIRFLOW-8278] Added tests for yandex hooks #8278
Posted by GitBox <gi...@apache.org>.
peter-volkov commented on a change in pull request #9665:
URL: https://github.com/apache/airflow/pull/9665#discussion_r449922283
##########
File path: tests/providers/yandex/hooks/test_yandex.py
##########
@@ -0,0 +1,84 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+import unittest
+import mock
+
+from airflow.exceptions import AirflowException
+from airflow.providers.yandex.hooks.yandex import YandexCloudBaseHook
+
+
+class TestYandexHook(unittest.TestCase):
+
+ @mock.patch('airflow.hooks.base_hook.BaseHook.get_connection')
+ @mock.patch('airflow.providers.yandex.hooks.yandex.YandexCloudBaseHook._get_credentials')
Review comment:
Ok. I will do it a bit later. I have plans to add some new features to this provider. I will include a test to the another PR.
----------------------------------------------------------------
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] mik-laj commented on pull request #9665: [AIRFLOW-8278] Added tests for yandex hooks #8278
Posted by GitBox <gi...@apache.org>.
mik-laj commented on pull request #9665:
URL: https://github.com/apache/airflow/pull/9665#issuecomment-653941575
> @potiuk what list are you talking about?
https://github.com/apache/airflow/blob/master/tests/test_project_structure.py#L45
> what can I do to improve the tests?
If you want you can leave a comment. You are an YandexCloud expert, so I thought it worth giving you the chance to express your opinion about it
----------------------------------------------------------------
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] subkanthi commented on a change in pull request #9665: [AIRFLOW-8278] Added tests for yandex hooks #8278
Posted by GitBox <gi...@apache.org>.
subkanthi commented on a change in pull request #9665:
URL: https://github.com/apache/airflow/pull/9665#discussion_r453194501
##########
File path: tests/providers/yandex/hooks/test_yandex.py
##########
@@ -0,0 +1,84 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+import unittest
+import mock
Review comment:
@mik-laj removed the file from the list and I see green CI. Thanks ready for merge.
----------------------------------------------------------------
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] peter-volkov commented on pull request #9665: [AIRFLOW-8278] Added tests for yandex hooks #8278
Posted by GitBox <gi...@apache.org>.
peter-volkov commented on pull request #9665:
URL: https://github.com/apache/airflow/pull/9665#issuecomment-653940478
@potiuk what list are you talking about?
@mik-laj looks good
what can I do to improve the tests?
----------------------------------------------------------------
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] subkanthi commented on a change in pull request #9665: [AIRFLOW-8278] Added tests for yandex hooks #8278
Posted by GitBox <gi...@apache.org>.
subkanthi commented on a change in pull request #9665:
URL: https://github.com/apache/airflow/pull/9665#discussion_r452401318
##########
File path: tests/providers/yandex/hooks/test_yandex.py
##########
@@ -0,0 +1,84 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+import unittest
+import mock
Review comment:
@mik-laj Fixed this, is there anything else required to merge this PR, please let me know.
----------------------------------------------------------------
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] subkanthi commented on a change in pull request #9665: [AIRFLOW-8278] Added tests for yandex hooks #8278
Posted by GitBox <gi...@apache.org>.
subkanthi commented on a change in pull request #9665:
URL: https://github.com/apache/airflow/pull/9665#discussion_r453183542
##########
File path: tests/providers/yandex/hooks/test_yandex.py
##########
@@ -0,0 +1,84 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+import unittest
+import mock
Review comment:
thanks will do that
----------------------------------------------------------------
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] potiuk commented on pull request #9665: [AIRFLOW-8278] Added tests for yandex hooks #8278
Posted by GitBox <gi...@apache.org>.
potiuk commented on pull request #9665:
URL: https://github.com/apache/airflow/pull/9665#issuecomment-653931518
Looks good! But I think you need to remove the yandex from list of those files without tests :)
----------------------------------------------------------------
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] boring-cyborg[bot] commented on pull request #9665: [AIRFLOW-8278] Added tests for yandex hooks #8278
Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on pull request #9665:
URL: https://github.com/apache/airflow/pull/9665#issuecomment-657083997
Awesome work, congrats on your first merged pull request!
----------------------------------------------------------------
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