Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration tests for GCSFileSystem #28185

Merged
merged 1 commit into from
Aug 30, 2023

Conversation

BjornPrime
Copy link
Contributor

Adding integration tests for GCSFileSystem to improve the odds of a clean GCS migration (see #25676).

Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Mention the appropriate issue in your description (for example: addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment fixes #<ISSUE NUMBER> instead.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.

@BjornPrime
Copy link
Contributor Author

Run Python 3.11 PostCommit

1 similar comment
@BjornPrime
Copy link
Contributor Author

Run Python 3.11 PostCommit

@codecov
Copy link

codecov bot commented Aug 28, 2023

Codecov Report

Merging #28185 (e1de4e0) into master (e26735d) will increase coverage by 0.00%.
Report is 18 commits behind head on master.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master   #28185   +/-   ##
=======================================
  Coverage   72.29%   72.30%           
=======================================
  Files         678      678           
  Lines       99848    99877   +29     
=======================================
+ Hits        72189    72218   +29     
  Misses      26084    26084           
  Partials     1575     1575           
Flag Coverage Δ
python 82.89% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 12 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@BjornPrime
Copy link
Contributor Author

Run Python 3.11 PostCommit

1 similar comment
@BjornPrime
Copy link
Contributor Author

Run Python 3.11 PostCommit

@BjornPrime BjornPrime force-pushed the add-gcsfilesystem-it-test branch from 03d8ab8 to e1de4e0 Compare August 29, 2023 17:30
@BjornPrime
Copy link
Contributor Author

Run Python 3.11 PostCommit

@BjornPrime BjornPrime marked this pull request as ready for review August 29, 2023 17:41
@github-actions
Copy link
Contributor

Assigning reviewers. If you would like to opt out of this review, comment assign to next reviewer:

R: @tvalentyn for label python.
R: @ahmedabu98 for label io.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

Copy link
Contributor

@Abacn Abacn left a comment

Choose a reason for hiding this comment

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

Thanks, left a comment regarding testing copy_batch and delete_batch, which is the purpose here

def setUp(self):
self.test_pipeline = TestPipeline(is_integration_test=True)
self.runner_name = type(self.test_pipeline.runner).__name__
if self.runner_name != 'TestDataflowRunner':
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a note - it's a little bit weird these tests need TestDataflowRunner (this is also set in current gcsio integration test). In the future good to reorganize tests to have a suite running on direct runner (local) and having gcp credentials.

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 will keep that in mind for the future. I was just following gcsio_integration_test's lead here.

self._verify_rename(_old, _new)

@pytest.mark.it_postcommit
def test_rename_error(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

It's good added a error handling test here. Still need to add batch_copy and batch_delete error handling tests which was the gap we currently have

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 added this because it's a gcsfilesystem method that exercises gcsio.copy_batch and gcsio.delete_batch and the identified gap is with how those methods communicate their results to gcsfilesystem.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see, yes currently rename() exercises both gcsio.copy_batch and gcsio.delete_batch.

Though adding gcsio_integration_tests are more direct, this also covers the code as of now.

Copy link
Contributor

@Abacn Abacn left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines +52 to +54
# Larger than 1MB to test maxBytesRewrittenPerCall.
# Also needs to be in a different region than the dest to take effect.
INPUT_FILE_LARGE = 'gs://apache-beam-samples-us-east1/wikipedia_edits/wiki_data-000000000000.json' # pylint: disable=line-too-long
Copy link
Contributor

Choose a reason for hiding this comment

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

minor clean up - this constant not used here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Noted, will clean this up in migration PR.

-Dtests=apache_beam.io.gcp.gcsfilesystem_integration_test:GcsFileSystemIntegrationTest # pylint: disable=line-too-long
"""

# pytype: skip-file
Copy link
Contributor

Choose a reason for hiding this comment

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

minor - lets enable linting for new files (some old py sources skipped linting because the check was introduced after they existed in repo)

@johnjcasey johnjcasey merged commit 93fd021 into apache:master Aug 30, 2023
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