Skip to content

Comments

Fix gcs to sftp system test#25934

Merged
potiuk merged 1 commit intoapache:mainfrom
lwyszomi:fix/gcs_to_sftp
Aug 27, 2022
Merged

Fix gcs to sftp system test#25934
potiuk merged 1 commit intoapache:mainfrom
lwyszomi:fix/gcs_to_sftp

Conversation

@bhirsz
Copy link
Contributor

@bhirsz bhirsz commented Aug 24, 2022

gcs_to_sftp example was missing setup and teardown stages after
migration to the new design. This PR adds them - now we upload file to GCS bucket before running transfer operators and remove GCS bucket at the end of the test.

gcs_to_sftp example was missing setup and teardown stages after
migration to the new design.

Change-Id: I68e29f49fb4e1ac69f419c70a9ac46d8b8442e3b
task_id="create_bucket", bucket_name=BUCKET_NAME, project_id=PROJECT_ID
)

upload_file_1 = LocalFilesystemToGCSOperator(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wondering why you are uploading multiple times

Copy link
Contributor Author

@bhirsz bhirsz Aug 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To ensure I have file available on different paths - directly in bucket root, under directory etc. It's later used by transfer operator and we are testing if its possible to copy file, copy file from dir (and recreate dir structures), copy with wildcard. But thanks to your question I have noticed we dont need third upload - since 2nd upload already puts file under dir and we came reuse it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realized one of the operators has a "move_object" parameter which will delete files from the source directory. That's why we need all three separate uploads to cover all test scenarios:

Copy single file - 1st upload
Move file from the directory (removing source) - 2nd upload
Copy file from the directory when preserving dir structure - 3rd upload
Copy file from the directory without preserving dir structure - 3rd upload

@potiuk potiuk merged commit 1c8cf53 into apache:main Aug 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants