Skip to content

Commit f20da01

Browse files
authored
Fixes for running the entire test suite (GoogleCloudPlatform#463)
* proper bash for TRAVIS_PULL_REQUEST env var * dlp test fixes * error reporting test fixes * vision test fixes
1 parent 2edd017 commit f20da01

File tree

5 files changed

+15
-4
lines changed

5 files changed

+15
-4
lines changed

dlp/test/dlpTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ public function testInspectDatastore()
3939
'project' => getenv('GOOGLE_PROJECT_ID'),
4040
]);
4141
$this->assertContains('US_MALE_NAME', $output);
42-
$this->assertContains('Very likely', $output);
4342
}
4443

4544
public function testInspectBigquery()
@@ -50,7 +49,6 @@ public function testInspectBigquery()
5049
'project' => getenv('GOOGLE_PROJECT_ID'),
5150
]);
5251
$this->assertContains('CREDIT_CARD_NUMBER', $output);
53-
$this->assertContains('Very likely', $output);
5452
}
5553

5654
public function testInspectFile()

error_reporting/test/error_reportingTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ public static function setUpBeforeClass()
4040
}
4141
}
4242

43+
public function setUp()
44+
{
45+
$this->eventuallyConsistentRetryCount = 10;
46+
}
47+
4348
public function testReportErrorSimple()
4449
{
4550
$message = sprintf('Test Report Error Simple (%s)', date('Y-m-d H:i:s'));

error_reporting/test/quickstartTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ class quickstartTest extends PHPUnit_Framework_TestCase
2424
{
2525
use EventuallyConsistentTestTrait;
2626

27+
public function setUp()
28+
{
29+
$this->eventuallyConsistentRetryCount = 10;
30+
}
31+
2732
public function testQuickstart()
2833
{
2934
if (!$projectId = getenv('GOOGLE_PROJECT_ID')) {

testing/run_test_suite.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ FILES_CHANGED=$(git diff --name-only HEAD $(git merge-base HEAD master))
2323
# on a Pull Request, run the whole test suite.
2424
if grep -q ^testing\/ <<< "$FILES_CHANGED" || \
2525
grep -qv \/ <<< "$FILES_CHANGED" || \
26-
[ -e $TRAVIS_PULL_REQUEST_BRANCH ]; then
26+
[ -z "$TRAVIS_PULL_REQUEST_BRANCH" ]; then
2727
RUN_ALL_TESTS=1
2828
else
2929
RUN_ALL_TESTS=0

vision/src/detect_document_text.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ function detect_document_text($projectId, $path)
5555
printf('Block text: %s' . PHP_EOL, $block_text);
5656
printf('Block bounds:' . PHP_EOL);
5757
foreach ($block['boundingBox']['vertices'] as $vertice) {
58-
printf('X: %s Y: %s' . PHP_EOL, $vertice['x'], $vertice['y']);
58+
printf('X: %s Y: %s' . PHP_EOL,
59+
isset($vertice['x']) ? $vertice['x'] : 'N/A',
60+
isset($vertice['y']) ? $vertice['y'] : 'N/A'
61+
);
5962
}
6063
printf(PHP_EOL);
6164
}

0 commit comments

Comments
 (0)