Abacn commented on code in PR #30352:
URL: https://github.com/apache/beam/pull/30352#discussion_r1496497281
##########
sdks/java/extensions/google-cloud-platform-core/src/test/java/org/apache/beam/sdk/extensions/gcp/util/GcsUtilIT.java:
##########
@@ -76,4 +86,67 @@ public void testRewriteMultiPart() throws IOException {
gcsUtil.remove(Lists.newArrayList(dstFilename));
}
+
+ @Test
+ public void testWriteAndReadGcsWithGrpc() throws IOException {
+ TestPipelineOptions options =
+ TestPipeline.testingPipelineOptions().as(TestPipelineOptions.class);
+
+ // set the experimental flag to enable grpc
+ ExperimentalOptions experimental = options.as(ExperimentalOptions.class);
+ experimental.setExperiments(Collections.singletonList("use_grpc_for_gcs"));
+
+ GcsOptions gcsOptions = options.as(GcsOptions.class);
+ GcsUtil gcsUtil = gcsOptions.getGcsUtil();
+ assertNotNull(gcsUtil);
+
+ String testContent = "This is a test string.";
+
+ // Write a test file in a bucket without gRPC enabled.
+ // This assumes that GCS gRPC feature is not enabled in every bucket by
default.
+ // If the following assertion fails, we can revisit the GA status of this
feature and check
+ // whether we can remove the assertion.
+ String tempLocationWithoutGrpc =
"gs://temp-storage-for-end-to-end-tests-cmek/temp";
Review Comment:
Consider use tempRoot obtained from TestPipelineOptions. Then this is
configurable.
--
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]