Skip to content

Commit 6ad8e32

Browse files
authored
fixes DLP tests, marks them as not flakey (GoogleCloudPlatform#579)
1 parent 2120f56 commit 6ad8e32

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

dlp/dlp.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,8 +481,8 @@
481481
InputArgument::REQUIRED,
482482
'The infoTypes corresponding to the chosen quasi-identifiers'
483483
)
484-
->addArgument('region-code', InputArgument::REQUIRED, 'The ISO 3166-1 region code that the data is representative of')
485484
->addArgument('subscription-id', InputArgument::REQUIRED, 'The name of the Pub/Sub subscription to use when listening for job')
485+
->addArgument('region-code', InputArgument::OPTIONAL, 'The ISO 3166-1 region code that the data is representative of', 'US')
486486
->addArgument('calling-project', InputArgument::OPTIONAL, 'The GCP Project ID to run the API call under', getenv('GOOGLE_PROJECT_ID'))
487487
->addArgument('data-project', InputArgument::OPTIONAL, 'The GCP Project ID that the BigQuery table exists under', getenv('GOOGLE_PROJECT_ID'))
488488
->setDescription('Computes the k-map risk estimation of a column set in a Google BigQuery table.')

dlp/test/dlpTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ public function testKMap()
362362
'data-project' => getenv('GOOGLE_PROJECT_ID'),
363363
'topic-id' => getenv('DLP_TOPIC'),
364364
'subscription-id' => getenv('DLP_SUBSCRIPTION'),
365-
'region-code' => 'USA',
365+
'region-code' => 'US',
366366
'quasi-ids' => 'Age,Gender',
367367
'info-types' => 'AGE,GENDER'
368368
]);

monitoring/test/monitoringTest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,11 @@ public function testDeleteMetric()
8888

8989
public function testWriteTimeseries()
9090
{
91-
$output = $this->runCommand('write-timeseries');
92-
$this->assertContains('Done writing time series data', $output);
91+
// Catch all exceptions as this method occasionally throws an Internal error.
92+
$this->runEventuallyConsistentTest(function () {
93+
$output = $this->runCommand('write-timeseries');
94+
$this->assertContains('Done writing time series data', $output);
95+
}, self::RETRY_COUNT, true);
9396
}
9497

9598
/** @depends testWriteTimeseries */

testing/run_test_suite.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ fi
2222
# directories known as flaky tests
2323
FLAKES=(
2424
datastore/api
25-
dlp
2625
)
2726

2827
GRPC_ONLY_TESTS=(

0 commit comments

Comments
 (0)