pabloem commented on code in PR #39685:
URL: https://github.com/apache/beam/pull/39685#discussion_r3786006567


##########
sdks/python/apache_beam/io/gcp/pubsub_io_perf_test.py:
##########


Review Comment:
   let's remove this before merging



##########
sdks/python/apache_beam/io/gcp/pubsub_io_perf_test.py:
##########
@@ -205,10 +212,12 @@ def _setup_pipeline(self):
     self.pipeline = TestPipeline(options=PipelineOptions(args))
 
   def cleanup(self):
-    self.sub_client.delete_subscription(subscription=self.read_sub_name)
-    
self.sub_client.delete_subscription(subscription=self.read_matcher_sub_name)
-    self.pub_client.delete_topic(topic=self.topic_name)
-    self.pub_client.delete_topic(topic=self.matcher_topic_name)
+    with self.pubsub_monitor:
+      pass
+    # self.sub_client.delete_subscription(subscription=self.read_sub_name)
+    # 
self.sub_client.delete_subscription(subscription=self.read_matcher_sub_name)
+    # self.pub_client.delete_topic(topic=self.topic_name)
+    # self.pub_client.delete_topic(topic=self.matcher_topic_name)

Review Comment:
   ```suggestion
   ```
   remove fully



##########
sdks/python/apache_beam/testing/load_tests/build.gradle:
##########
@@ -72,4 +72,25 @@ task run(type: Exec, dependsOn: installGcpTest) {
 
 def parseOptions(String option) {
     option.replace('\"', '\\"')
-}
\ No newline at end of file
+}
+
+// Specific task to run the Pub/Sub performance test with the 
TestPubsubContext Lifecycle Manager in Dry-Run mode.
+task runPubsubPerfTestWithMonitor(type: Exec, dependsOn: installGcpTest) {
+    group = 'Verification'
+    description = 'Runs PubSub Performance Tests in Python with the 
TestPubsubContext Lifecycle Manager in Dry-Run mode.'
+    // Force Gradle to use the Python virtual environment installed in the 
project
+    setWorkingDir "${project.rootDir}/sdks/python"
+
+    // Command that runs the test using the local DirectRunner in a safe way
+    commandLine 'sh', '-c', """
+      ${project.ext.envdir}/bin/python -m 
apache_beam.io.gcp.pubsub_io_perf_test \
+        --test-pipeline-options=" \
+        --runner=DirectRunner \
+        --project=apache-beam-testing \
+        --pubsub_namespace_prefix=perf-test-ci- \
+        --wait_until_finish_duration=15000 \
+        --input_options='{\\"num_records\\": 10, \\"key_size\\": 1, 
\\"value_size\\": 10}'"
+    """
+
+    ignoreExitValue true

Review Comment:
   let's remove this



-- 
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]

Reply via email to