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

Fix the test 'test_user_agent_passed' without skipping it #29422

Merged
merged 1 commit into from
Nov 13, 2023

Conversation

shunping
Copy link
Contributor

  • Here we skip the credential authentication, and
  • we also mock gcp_bigquery so it won't raise an exception that causes this test to be skipped.

Please add a meaningful description for your change here


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.

Copy link
Contributor

@bvolpato bvolpato left a comment

Choose a reason for hiding this comment

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

LGTM

I have the context, but I think you could add a brief comment explaining why mocking each

@shunping
Copy link
Contributor Author

LGTM

I have the context, but I think you could add a brief comment explaining why mocking each

Do you mean the comment of this commit or the comment in code?

@bvolpato
Copy link
Contributor

LGTM
I have the context, but I think you could add a brief comment explaining why mocking each

Do you mean the comment of this commit or the comment in code?

I meant in the code for future reference -- I should've highlighted that this is just a nitpick

Copy link

codecov bot commented Nov 13, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (c713425) 38.34% compared to head (f10b925) 38.34%.
Report is 13 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #29422      +/-   ##
==========================================
- Coverage   38.34%   38.34%   -0.01%     
==========================================
  Files         693      693              
  Lines      102199   102237      +38     
==========================================
+ Hits        39185    39199      +14     
- Misses      61422    61446      +24     
  Partials     1592     1592              
Flag Coverage Δ
python 29.88% <ø> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

* Internally, `bigquery_tools.BigQueryWrapper` has two BigQuery clients: `apache_beam.io.gcp.internal.clients.bigquery.bigquery_v2_client.BigqueryV2` (apitools) and `google.cloud.bigquery.Client`.
* The function call of `wrapper.create_temporary_dataset` only uses the first client. To initialize this client, however, we need to skip the credential routine in apitools, or it makes the test crash in our internal test environment (ipv4 loopback enabled).
* We also need to simply mock the second client, so it won't raise an exception (if google.cloud.bigquery is not available) during the creation of `BigQueryWrapper`. Notice that if an exception IS raised, the test would be skipped.
@shunping shunping force-pushed the fix-bigquery-tools-test branch from e573498 to f10b925 Compare November 13, 2023 21:44
@shunping
Copy link
Contributor Author

LGTM
I have the context, but I think you could add a brief comment explaining why mocking each

Do you mean the comment of this commit or the comment in code?

I meant in the code for future reference -- I should've highlighted that this is just a nitpick

Thanks! I put more explanation in the commit message.

Copy link
Contributor

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

R: @jrmccluskey for label python.
R: @johnjcasey 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).

@tvalentyn
Copy link
Contributor

Thanks! I put more explanation in the commit message.

Nice, thanks. Noting for future changes that commit messages are not as easy to lookup as seeing a comment in the code.

@tvalentyn tvalentyn merged commit 7fabc12 into apache:master Nov 13, 2023
71 checks passed
@shunping
Copy link
Contributor Author

Thanks! I put more explanation in the commit message.

Nice, thanks. Noting for future changes that commit messages are not as easy to lookup as seeing a comment in the code.

Understood. I will keep that in mind. Thanks for merging.

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