Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restructure apis #943

Merged
merged 59 commits into from
Mar 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
01d9246
Manual changes for restructure
michaelbausor Jan 11, 2018
7714671
Restructure APIs via script
michaelbausor Feb 1, 2018
825e197
Fix Debugger snippets
michaelbausor Feb 1, 2018
1b6a319
Add github PR templates
michaelbausor Feb 1, 2018
e60b466
Initial fixes for subrepos
michaelbausor Feb 1, 2018
8de736f
Fix Core system tests
michaelbausor Feb 1, 2018
e4d5bb1
Update BigQuery system tests
michaelbausor Feb 1, 2018
872d11e
Changes for Spanner
michaelbausor Feb 1, 2018
87b0d53
Update phpunit files
michaelbausor Feb 1, 2018
d919862
Update bootstrap files
michaelbausor Feb 1, 2018
2d96826
Datastore updates
michaelbausor Feb 2, 2018
992cb23
Add keyfile stub files
michaelbausor Feb 2, 2018
fb0ac7e
Updates for Firestore
michaelbausor Feb 2, 2018
d7db918
Fix Language composer
michaelbausor Feb 2, 2018
4de09ef
Fix logging tests and composer
michaelbausor Feb 2, 2018
807ad86
Fix pubsub composer and unit tests
michaelbausor Feb 2, 2018
faf4b58
Update Speech composer
michaelbausor Feb 2, 2018
08b16c0
Fix composer and tests for Storage
michaelbausor Feb 2, 2018
993ecf4
Update Trace composer
michaelbausor Feb 2, 2018
7a9316b
Update Translate composer
michaelbausor Feb 2, 2018
6572bc8
Update Vision composer
michaelbausor Feb 2, 2018
f312dec
Update gapic only APIs
michaelbausor Feb 2, 2018
8b4b199
Update composer files
michaelbausor Feb 2, 2018
190e98a
Rename test folders
michaelbausor Feb 3, 2018
9f43d7d
Move tests and update namespaces
michaelbausor Feb 5, 2018
2e80b36
Update phpunit files
michaelbausor Feb 5, 2018
b1c2cdb
Update Core
michaelbausor Feb 5, 2018
d38d040
Update doc generator to work with API restructure.
jdpedrie Feb 21, 2018
3513739
Changes after merging from master
michaelbausor Feb 23, 2018
ea42d32
Update after merge
michaelbausor Feb 23, 2018
ea45a7c
Small fixes for docs
michaelbausor Feb 23, 2018
feac382
Update dev CLI for API restructure
jdpedrie Feb 27, 2018
748ed7b
Updates after merge, update Snippet namespaces
michaelbausor Feb 27, 2018
e5be433
Move conformance and perf
michaelbausor Mar 1, 2018
cdf3017
Update bootstrap files
michaelbausor Mar 1, 2018
5729781
Update bootstrap
michaelbausor Mar 1, 2018
a507f5f
Address PR comments
michaelbausor Mar 1, 2018
364a664
Restore snippet test
michaelbausor Mar 1, 2018
1ced259
Remove keyfile stubs
michaelbausor Mar 1, 2018
1f68efd
Update pubsub dependencies
michaelbausor Mar 1, 2018
9fa2a3e
Update composer, move debugger bin
michaelbausor Mar 2, 2018
242cc70
Remove references to local Core
michaelbausor Mar 2, 2018
376d9db
Update bootstrap files
michaelbausor Mar 2, 2018
9815852
Update docs
michaelbausor Mar 3, 2018
c5918b8
Update core to pass doc gen
michaelbausor Mar 4, 2018
e15e5a2
Fix doc generator
jdpedrie Mar 5, 2018
90faa5c
Add daemonutils to locate autoloader
michaelbausor Mar 5, 2018
96491d6
Remove DaemonUtils, update autoloader locator
michaelbausor Mar 5, 2018
69af109
Restructure testing (#929)
jdpedrie Mar 22, 2018
2705bef
update bin paths
dwsupplee Mar 23, 2018
d5883ac
move dlp v2 to new structure
dwsupplee Mar 23, 2018
0a4e08d
require opis/closure for tests
dwsupplee Mar 23, 2018
fec7b7e
add internal tags and fix cs
dwsupplee Mar 23, 2018
074e55d
update configurations
dwsupplee Mar 23, 2018
7ecfd54
resolve issues with perf/conformance tests
dwsupplee Mar 23, 2018
3042e87
update bootstraps
dwsupplee Mar 23, 2018
c8816f6
update PR template
dwsupplee Mar 23, 2018
7d71622
show bigtable on docs
dwsupplee Mar 23, 2018
ea2c7a9
fix doc generation
dwsupplee Mar 23, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ vendor/

# do not delete
keys/
.testing
6 changes: 1 addition & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ before_script:
- if [[ $TRAVIS_PHP_VERSION =~ ^7 ]]; then pecl install stackdriver_debugger-alpha || echo 'Failed to install stackdriver_debugger'; fi
- composer install
- if [[ $TRAVIS_PHP_VERSION =~ ^hhvm ]]; then composer --no-interaction --dev remove google/protobuf google/gax google/proto-client; fi
- ./dev/sh/system-test-credentials
- dev/google-cloud credentials

env:
global:
Expand All @@ -34,7 +34,3 @@ after_success:
- if [[ $TRAVIS_PHP_VERSION =~ ^hhvm ]]; then bash <(curl -s https://codecov.io/bash); fi
- ./dev/sh/push-docs
- ./dev/sh/trigger-split
- cat ./build/snippets-uncovered.json

after_failure:
- echo "SNIPPET COVERAGE REPORT" && cat ./build/snippets-uncovered.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ $ git clone [email protected]:GoogleCloudPlatform/google-cloud-php.git
```

* Move your changes into the correct location in that library. Library code
belongs in `src/Logging`, and tests in `tests/*/Logging`.
belongs in `BigQuery/src`, and tests in `BigQuery/tests`.

* Push the changes in a new branch to a fork, and open a new pull request
[here](https://github.com/GoogleCloudPlatform/google-cloud-php).
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
18 changes: 15 additions & 3 deletions src/BigQuery/composer.json → BigQuery/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
"google/cloud-core": "^1.14",
"ramsey/uuid": "~3"
},
"require-dev": {
"phpunit/phpunit": "^4.8|^5.0",
"squizlabs/php_codesniffer": "2.*",
"phpdocumentor/reflection": "^3.0",
"erusev/parsedown": "^1.6",
"google/cloud-storage": "^1.3"
},
"suggest": {
"google/cloud-storage": "Makes it easier to load data from Cloud Storage into BigQuery"
},
Expand All @@ -15,13 +22,18 @@
"displayName": "Google Cloud BigQuery",
"id": "cloud-bigquery",
"target": "GoogleCloudPlatform/google-cloud-php-bigquery.git",
"path": "src/BigQuery",
"entry": "BigQueryClient.php"
"path": "BigQuery",
"entry": "src/BigQueryClient.php"
}
},
"autoload": {
"psr-4": {
"Google\\Cloud\\BigQuery\\": ""
"Google\\Cloud\\BigQuery\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"Google\\Cloud\\BigQuery\\Tests\\": "tests"
}
}
}
19 changes: 19 additions & 0 deletions BigQuery/phpunit-snippets.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
bootstrap="./vendor/google/cloud-core/snippet-bootstrap.php"
colors="true"
printerClass="Google\Cloud\Core\Testing\Snippet\Coverage\ResultPrinter">
<testsuites>
<testsuite>
<directory>tests/Snippet</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">src</directory>
<exclude>
<directory suffix=".php">src/V[!a-zA-Z]*</directory>
</exclude>
</whitelist>
</filter>
</phpunit>
16 changes: 16 additions & 0 deletions BigQuery/phpunit-system.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="./vendor/google-cloud/cloud-core/system-bootstrap.php" colors="true">
<testsuites>
<testsuite>
<directory>tests/System</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">src</directory>
<exclude>
<directory suffix=".php">src/V[!a-zA-Z]*</directory>
</exclude>
</whitelist>
</filter>
</phpunit>
16 changes: 16 additions & 0 deletions BigQuery/phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit colors="true">
<testsuites>
<testsuite>
<directory>tests/Unit</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">src</directory>
<exclude>
<directory suffix=".php">src/V[!a-zA-Z]*</directory>
</exclude>
</whitelist>
</filter>
</phpunit>
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

namespace Google\Cloud\BigQuery;

use Google\Auth\FetchAuthTokenInterface;
use Google\Cloud\BigQuery\Connection\ConnectionInterface;
use Google\Cloud\BigQuery\Connection\Rest;
use Google\Cloud\BigQuery\Exception\JobException;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

namespace Google\Cloud\Tests\Perf;
namespace Google\Cloud\BigQuery\Tests\Perf;

use Google\Cloud\BigQuery\BigQueryClient;
use PHPUnit\Framework\TestCase;
Expand Down Expand Up @@ -67,7 +67,7 @@ public function testPerf($query)

public function queries()
{
$queries = json_decode(file_get_contents(__DIR__ .'/fixtures/'. self::SOURCE), true);
$queries = json_decode(file_get_contents(__DIR__ . '/fixtures/' . self::SOURCE), true);
foreach ($queries as $key => $q) {
$queries[$key] = is_array($q)
? $q
Expand Down
5 changes: 5 additions & 0 deletions BigQuery/tests/Perf/bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

use Google\Cloud\Core\Testing\TestHelpers;

TestHelpers::requireKeyfile('GOOGLE_CLOUD_PHP_TESTS_KEY_PATH');
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

namespace Google\Cloud\Tests\Snippets\BigQuery;
namespace Google\Cloud\BigQuery\Tests\Snippet;

use Google\Cloud\BigQuery\BigQueryClient;
use Google\Cloud\BigQuery\Bytes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

namespace Google\Cloud\Tests\Snippets\BigQuery;
namespace Google\Cloud\BigQuery\Tests\Snippet;

use Google\Cloud\BigQuery\Bytes;
use Google\Cloud\Core\Testing\Snippet\SnippetTestCase;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

namespace Google\Cloud\Tests\Snippets\BigQuery;
namespace Google\Cloud\BigQuery\Tests\Snippet;

use Google\Cloud\BigQuery\BigQueryClient;
use Google\Cloud\BigQuery\CopyJobConfiguration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

namespace Google\Cloud\Tests\Snippets\BigQuery;
namespace Google\Cloud\BigQuery\Tests\Snippet;

use Google\Cloud\BigQuery\Connection\ConnectionInterface;
use Google\Cloud\BigQuery\Dataset;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

namespace Google\Cloud\Tests\Snippets\BigQuery;
namespace Google\Cloud\BigQuery\Tests\Snippet;

use Google\Cloud\BigQuery\Date;
use Google\Cloud\Core\Testing\Snippet\SnippetTestCase;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

namespace Google\Cloud\Tests\Snippets\BigQuery;
namespace Google\Cloud\BigQuery\Tests\Snippet;

use Google\Cloud\BigQuery\BigQueryClient;
use Google\Cloud\BigQuery\ExtractJobConfiguration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

namespace Google\Cloud\Tests\Snippets\BigQuery;
namespace Google\Cloud\BigQuery\Tests\Snippet;

use Google\Cloud\BigQuery\InsertResponse;
use Google\Cloud\Core\Testing\Snippet\SnippetTestCase;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

namespace Google\Cloud\Tests\Snippets\BigQuery;
namespace Google\Cloud\BigQuery\Tests\Snippet;

use Google\Cloud\BigQuery\Connection\ConnectionInterface;
use Google\Cloud\BigQuery\Job;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

namespace Google\Cloud\Tests\Snippets\BigQuery;
namespace Google\Cloud\BigQuery\Tests\Snippet;

use Google\Cloud\BigQuery\BigQueryClient;
use Google\Cloud\BigQuery\LoadJobConfiguration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

namespace Google\Cloud\Tests\Snippets\BigQuery;
namespace Google\Cloud\BigQuery\Tests\Snippet;

use Google\Cloud\BigQuery\BigQueryClient;
use Google\Cloud\BigQuery\QueryJobConfiguration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

namespace Google\Cloud\Tests\Snippets\BigQuery;
namespace Google\Cloud\BigQuery\Tests\Snippet;

use Google\Cloud\BigQuery\Connection\ConnectionInterface;
use Google\Cloud\BigQuery\Job;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

namespace Google\Cloud\Tests\Snippets\BigQuery;
namespace Google\Cloud\BigQuery\Tests\Snippet;

use Google\Cloud\BigQuery\BigQueryClient;
use Google\Cloud\BigQuery\Connection\ConnectionInterface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

namespace Google\Cloud\Tests\Snippets\BigQuery;
namespace Google\Cloud\BigQuery\Tests\Snippet;

use Google\Cloud\BigQuery\BigQueryClient;
use Google\Cloud\BigQuery\Time;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

namespace Google\Cloud\Tests\Snippets\BigQuery;
namespace Google\Cloud\BigQuery\Tests\Snippet;

use Google\Cloud\BigQuery\BigQueryClient;
use Google\Cloud\BigQuery\Timestamp;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

namespace Google\Cloud\Tests\System\BigQuery;
namespace Google\Cloud\BigQuery\Tests\System;

use Google\Cloud\BigQuery\BigQueryClient;
use Google\Cloud\Storage\StorageClient;
Expand All @@ -38,7 +38,7 @@ public static function setUpBeforeClass()
}

$keyFilePath = getenv('GOOGLE_CLOUD_PHP_TESTS_KEY_PATH');
$schema = json_decode(file_get_contents(__DIR__ . '/../data/table-schema.json'), true);
$schema = json_decode(file_get_contents(__DIR__ . '/data/table-schema.json'), true);

$storage = new StorageClient([
'keyFilePath' => $keyFilePath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

namespace Google\Cloud\Tests\System\BigQuery;
namespace Google\Cloud\BigQuery\Tests\System;

use Google\Cloud\BigQuery\Bytes;
use Google\Cloud\BigQuery\Date;
Expand Down Expand Up @@ -367,19 +367,19 @@ public function testLoadsDataToTable($data)
$this->fail('Job failed to complete within the allotted time.');
}

self::$expectedRows += count(file(__DIR__ . '/../data/table-data.json'));
self::$expectedRows += count(file(__DIR__ . '/data/table-data.json'));
$actualRows = count(iterator_to_array(self::$table->rows()));

$this->assertEquals(self::$expectedRows, $actualRows);
}

public function rowProvider()
{
$data = file_get_contents(__DIR__ . '/../data/table-data.json');
$data = file_get_contents(__DIR__ . '/data/table-data.json');

return [
[$data],
[fopen(__DIR__ . '/../data/table-data.json', 'r')],
[fopen(__DIR__ . '/data/table-data.json', 'r')],
[Psr7\stream_for($data)]
];
}
Expand All @@ -390,7 +390,7 @@ public function rowProvider()
public function testLoadsDataFromStorageToTable()
{
$object = self::$bucket->upload(
fopen(__DIR__ . '/../data/table-data.json', 'r')
fopen(__DIR__ . '/data/table-data.json', 'r')
);

$loadJobConfig = self::$table->loadFromStorage($object)
Expand All @@ -408,7 +408,7 @@ public function testLoadsDataFromStorageToTable()
$this->fail('Job failed to complete within the allotted time.');
}

self::$expectedRows += count(file(__DIR__ . '/../data/table-data.json'));
self::$expectedRows += count(file(__DIR__ . '/data/table-data.json'));
$actualRows = count(iterator_to_array(self::$table->rows()));

$this->assertEquals(self::$expectedRows, $actualRows);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

namespace Google\Cloud\Tests\System\BigQuery;
namespace Google\Cloud\BigQuery\Tests\System;

/**
* @group bigquery
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

namespace Google\Cloud\Tests\System\BigQuery;
namespace Google\Cloud\BigQuery\Tests\System;

use Google\Cloud\BigQuery\Job;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

namespace Google\Cloud\Tests\System\BigQuery;
namespace Google\Cloud\BigQuery\Tests\System;

use Google\Cloud\Core\ExponentialBackoff;

Expand Down
File renamed without changes.
5 changes: 5 additions & 0 deletions BigQuery/tests/System/bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

use Google\Cloud\Core\Testing\TestHelpers;

TestHelpers::requireKeyfile('GOOGLE_CLOUD_PHP_TESTS_KEY_PATH');
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

namespace Google\Cloud\Tests\Unit\BigQuery;
namespace Google\Cloud\BigQuery\Tests\Unit;

use Google\Cloud\BigQuery\BigQueryClient;
use Google\Cloud\BigQuery\Bytes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

namespace Google\Cloud\Tests\Unit\BigQuery;
namespace Google\Cloud\BigQuery\Tests\Unit;

use Google\Cloud\BigQuery\Bytes;
use GuzzleHttp\Psr7;
Expand Down
Loading