shunping commented on code in PR #31344:
URL: https://github.com/apache/beam/pull/31344#discussion_r1607434561
##########
sdks/python/apache_beam/io/gcp/gcsio_integration_test.py:
##########
@@ -141,6 +143,43 @@ def test_batch_copy_and_delete(self):
self.assertFalse(
result[1], 're-delete should not throw error: %s' % result[1])
+ @pytest.mark.it_postcommit
+ @mock.patch('apache_beam.io.gcp.gcsio.default_gcs_bucket_name')
Review Comment:
Thanks for the review, @Abacn. Below are my responses.
> it doesn't sounds quite right that a PostCommit needs a mock. And this
mock isn't mock a fake service, it's used to override nomenclature of temp
bucket. What happens if we do not hack it?
For a given project, the function of `default_gcs_bucket_name` will return a
fixed bucket name as the default. If we don't override this, we need to create
a particular project (other than using apache-beam-testing or whatever project
the users want to provide during running this test) to test this. Per the
offline discussion with @damccorm, it seems a bit overkill to create a project
and then remove it afterward for this test. I think using mocking is kind of a
"hack" but the code is clean. I am open to any better suggestion though.
> Also, this test does not run a pipeline, should we configure it only run
on test-suites:direct:py3xx:postCommitIT. Persumably currently it is running on
Dataflow PostCommit IT suites which is not quite right
If you look at the other tests under `gcsio_integration_test.py`, they are
also testing the gcsio functionality with an actual gcs operation. However,
they don't trigger any pipeline running either.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]