Skip to content

Commit 0616cb4

Browse files
author
Takashi Matsuo
authored
Fixing BigQuery and Logging tests (GoogleCloudPlatform#157)
Also updated coverage configs
1 parent 1174067 commit 0616cb4

File tree

6 files changed

+17
-10
lines changed

6 files changed

+17
-10
lines changed

bigquery/api/phpunit.xml.dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
<filter>
2727
<whitelist>
2828
<file>bigquery.php</file>
29+
<directory suffix=".php">./src</directory>
2930
</whitelist>
3031
</filter>
3132
</phpunit>

bigquery/api/src/QueryCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ protected function configure()
6666
'run the query syncronously'
6767
)
6868
->addOption(
69-
'standardSql',
69+
'standard-sql',
7070
null,
7171
InputOption::VALUE_NONE,
7272
'run the query using standard SQL instead of legacy SQL syntax'
@@ -96,12 +96,12 @@ protected function execute(InputInterface $input, OutputInterface $output)
9696
run_query(
9797
$projectId,
9898
$query,
99-
!$input->getOption('standardSql'));
99+
!$input->getOption('standard-sql'));
100100
} else {
101101
run_query_as_job(
102102
$projectId,
103103
$query,
104-
!$input->getOption('standardSql'));
104+
!$input->getOption('standard-sql'));
105105
}
106106
} catch (BadRequestException $e) {
107107
$response = $e->getServiceException()->getResponse();

bigquery/api/test/QueryCommandTest.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@ public function testQueryStandardSql()
130130
'query' => $query,
131131
'--project' => $projectId,
132132
'--sync',
133-
'--standardSql'],
133+
'--standard-sql' => true
134+
],
134135
['interactive' => false]
135136
);
136137

@@ -186,7 +187,11 @@ public function testQueryAsJobStandardSql()
186187
$application->add(new QueryCommand());
187188
$commandTester = new CommandTester($application->get('query'));
188189
$commandTester->execute(
189-
['query' => $query, '--project' => $projectId, '--standardSql'],
190+
[
191+
'query' => $query,
192+
'--project' => $projectId,
193+
'--standard-sql' => true
194+
],
190195
['interactive' => false]
191196
);
192197

logging/phpunit.xml.dist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
-->
1717
<phpunit bootstrap="test/bootstrap.php">
1818
<testsuites>
19-
<testsuite name="Google Stackdriver Logging Cloud library Tests">
19+
<testsuite name="Stackdriver Logging Cloud library Tests">
2020
<directory>test</directory>
2121
</testsuite>
2222
</testsuites>
@@ -25,7 +25,7 @@
2525
</logging>
2626
<filter>
2727
<whitelist>
28-
<dir>src</dir>
28+
<directory suffix=".php">./src</directory>
2929
</whitelist>
3030
</filter>
3131
</phpunit>

logging/src/BaseCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use Symfony\Component\Console\Command\Command;
2121
use Symfony\Component\Console\Input\InputInterface;
2222
use Symfony\Component\Console\Input\InputOption;
23+
use Symfony\Component\Console\Output\OutputInterface;
2324

2425
/**
2526
* A base class for commands which needs project id.
@@ -50,7 +51,7 @@ protected function addCommonOptions()
5051
);
5152
}
5253

53-
protected function interact(InputInterface $input)
54+
protected function interact(InputInterface $input, OutputInterface $output)
5455
{
5556
if (empty($input->getOption("project"))) {
5657
throw new \Exception("Project ID not specified");

testing/run_test_suite.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ if [ "${RUN_CS_FIXER}" = "true" ]; then
2020
${HOME}/php-cs-fixer fix --dry-run --diff
2121
fi
2222

23-
# loop through all directories containing "phpunit.xml" and run them
24-
find * -name phpunit.xml -not -path '*/vendor/*' -exec dirname {} \; | while read DIR
23+
# loop through all directories containing "phpunit.xml*" and run them
24+
find * -name 'phpunit.xml*' -not -path '*/vendor/*' -exec dirname {} \; | while read DIR
2525
do
2626
pushd ${DIR}
2727
if [ -f "composer.json" ]; then

0 commit comments

Comments
 (0)