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/05/28 00:36:05 UTC

[GitHub] [airflow] ephraimbuddy opened a new pull request #9043: Add example dag and system test for LocalFilesystemToGCSOperator

ephraimbuddy opened a new pull request #9043:
URL: https://github.com/apache/airflow/pull/9043


   ---
   This PR closes one of the issues in #8280 
   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] turbaszek commented on a change in pull request #9043: Add example dag and system test for LocalFilesystemToGCSOperator

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



##########
File path: tests/providers/google/cloud/operators/test_local_to_gcs_system.py
##########
@@ -0,0 +1,46 @@
+#
+# 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 os
+
+import pytest
+
+from airflow.providers.google.cloud.example_dags.example_local_to_gcs import BUCKET_NAME, PATH_TO_UPLOAD_FILE
+from tests.providers.google.cloud.utils.gcp_authenticator import GCP_GCS_KEY
+from tests.test_utils.gcp_system_helpers import CLOUD_DAG_FOLDER, GoogleSystemTest, provide_gcp_context
+
+
+@pytest.mark.backend("mysql", "postgres")
+@pytest.mark.credential_file(GCP_GCS_KEY)
+class LocalFilesystemToGCSOperatorExampleDagsTest(GoogleSystemTest):
+
+    @provide_gcp_context(GCP_GCS_KEY)
+    def setUp(self):
+        super().setUp()
+        self.create_gcs_bucket(BUCKET_NAME)
+        with open(PATH_TO_UPLOAD_FILE, 'w+') as file:
+            file.writelines(['example test files'])
+
+    @provide_gcp_context(GCP_GCS_KEY)
+    def tearDown(self):
+        os.remove(PATH_TO_UPLOAD_FILE)
+        self.delete_gcs_bucket(BUCKET_NAME)

Review comment:
       ```suggestion
           self.delete_gcs_bucket(BUCKET_NAME)
           os.remove(PATH_TO_UPLOAD_FILE)
   ```
   Just in case the file was deleted by something. It's better to have a dangling file than a bucket 😃 




----------------------------------------------------------------
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 #9043: Add example dag and system test for LocalFilesystemToGCSOperator

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


   


----------------------------------------------------------------
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] turbaszek commented on pull request #9043: Add example dag and system test for LocalFilesystemToGCSOperator

Posted by GitBox <gi...@apache.org>.
turbaszek commented on pull request #9043:
URL: https://github.com/apache/airflow/pull/9043#issuecomment-636021628


   @ephraimbuddy can you please rebase?


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