Skip to content

Commit 6adc69c

Browse files
committed
chore(gax): changes to the monorepo to support GAX
1 parent 0104c2b commit 6adc69c

24 files changed

Lines changed: 242 additions & 35 deletions

.github/run-package-tests.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ for DIR in ${DIRS}; do
6363
cp "${DIR}/composer.json" "${DIR}/composer-local.json"
6464
# Update composer to use local packages
6565
PACKAGE_DEPENDENCIES=(
66+
"Gax,gax"
6667
"CommonProtos,common-protos,4.100"
6768
"BigQuery,cloud-bigquery"
6869
"Core,cloud-core"
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Run GAX Conformance Tests With Showcase
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
permissions:
8+
contents: read
9+
jobs:
10+
gapic-showcase:
11+
runs-on: ubuntu-latest
12+
env:
13+
GAPIC_SHOWCASE_VERSION: 0.36.2
14+
OS: linux
15+
ARCH: amd64
16+
name: GAPIC Showcase Conformance Tests
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v6
20+
21+
- name: Setup PHP
22+
uses: shivammathur/setup-php@v2
23+
with:
24+
php-version: '8.1'
25+
extensions: grpc
26+
27+
- name: Install and run GAPIC Showcase
28+
run: |
29+
curl -L https://github.com/googleapis/gapic-showcase/releases/download/v${GAPIC_SHOWCASE_VERSION}/gapic-showcase-${GAPIC_SHOWCASE_VERSION}-${OS}-${ARCH}.tar.gz | tar -zx
30+
./gapic-showcase run &
31+
32+
- name: Install dependencies
33+
run: |
34+
composer update --prefer-dist --no-interaction --no-suggest -d Gax/
35+
36+
- name: Run PHPUnit
37+
run: Gax/vendor/bin/phpunit -c Gax/phpunit-conformance.xml.dist
38+

.github/workflows/unit-tests.yaml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,22 @@ jobs:
1212
strategy:
1313
matrix:
1414
platform: [ubuntu-latest, windows-latest]
15-
php: [ "8.1", "8.2", "8.3", "8.4", "8.5" ]
16-
extensions: ["grpc-1.54.0"]
15+
php: [ "8.2", "8.3", "8.4", "8.5" ]
16+
extensions: ["grpc-1.78.0"]
1717
type: ["Unit Test"]
1818
include:
1919
- platform: "ubuntu-latest"
2020
php: "8.1"
21-
extensions: "protobuf,grpc-1.54.0"
21+
extensions: "grpc-1.78.0"
22+
type: "Unit Test"
23+
- platform: "ubuntu-latest"
24+
php: "8.1"
25+
extensions: "protobuf,grpc"
2226
type: "Unit Test + protobuf extension"
27+
- platform: "ubuntu-latest"
28+
php: "8.1"
29+
extensions: ""
30+
type: "Unit Test (no gRPC)"
2331
name: PHP ${{ matrix.php }} ${{ matrix.type }} (${{ matrix.platform }})
2432
runs-on: ${{ matrix.platform }}
2533
continue-on-error: true
@@ -30,7 +38,7 @@ jobs:
3038
uses: shivammathur/cache-extensions@v1
3139
with:
3240
php-version: ${{ matrix.php }}
33-
extensions: sodium,${{ matrix.extensions }}
41+
extensions: sodium,sysvshm,${{ matrix.extensions }}
3442
key: cache-key-1 # increment to bust the cache
3543
- name: Cache extensions
3644
uses: actions/cache@v5
@@ -42,7 +50,7 @@ jobs:
4250
uses: shivammathur/setup-php@verbose
4351
with:
4452
php-version: ${{ matrix.php }}
45-
extensions: sodium,${{ matrix.extensions }}
53+
extensions: sodium,sysvshm,${{ matrix.extensions }}
4654
- name: Install Dependencies
4755
uses: nick-invision/retry@v4
4856
with:

.kokoro/docs/publish.sh

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,6 @@ do
4242
$VERBOSITY_FLAG
4343
done
4444

45-
# Add GAX repo
46-
GAX_DIR=$PROJECT_DIR/dev/vendor/google/gax
47-
$PROJECT_DIR/dev/google-cloud docfx \
48-
--path $GAX_DIR \
49-
--out gax-out \
50-
--metadata-version $(cat $GAX_DIR/VERSION) \
51-
$STAGING_FLAG \
52-
$VERBOSITY_FLAG
53-
5445
# Add Auth repo
5546
AUTH_DIR=$PROJECT_DIR/dev/vendor/google/auth
5647
$PROJECT_DIR/dev/google-cloud docfx \

.repo-metadata-full.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -805,6 +805,14 @@
805805
"library_type": "GAPIC_AUTO",
806806
"api_shortname": "cloudfunctions"
807807
},
808+
"Gax": {
809+
"language": "php",
810+
"distribution_name": "google/gax",
811+
"release_level": "stable",
812+
"client_documentation": "https://cloud.google.com/php/docs/reference/gax/latest",
813+
"library_type": "CORE",
814+
"api_shortname": ""
815+
},
808816
"GSuiteAddOns": {
809817
"language": "php",
810818
"distribution_name": "google/cloud-gsuite-addons",

CommonProtos/renovate.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

Core/composer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@
4747
},
4848
"autoload-dev": {
4949
"psr-4": {
50-
"Google\\Cloud\\Core\\Tests\\": "tests"
50+
"Google\\Cloud\\Core\\Tests\\": "tests",
51+
"Google\\ApiCore\\Testing\\": "tests/Unit/generated",
52+
"GPBMetadata\\ApiCore\\Testing\\": "tests/Unit/metadata"
5153
}
5254
}
5355
}

Core/src/Testing/Snippet/SnippetTestCase.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
namespace Google\Cloud\Core\Testing\Snippet;
1919

2020
use Google\Cloud\Core\Testing\CheckForClassTrait;
21+
use Google\Cloud\Core\Testing\GrpcTestTrait;
2122
use Google\Cloud\Core\Testing\Snippet\Container;
2223
use Google\Cloud\Core\Testing\Snippet\Parser\Snippet;
2324
use PHPUnit\Framework\TestCase;
@@ -35,6 +36,7 @@ class SnippetTestCase extends TestCase
3536
const PROJECT = 'my-awesome-project';
3637

3738
use CheckForClassTrait;
39+
use GrpcTestTrait;
3840

3941
private static $coverage;
4042
private static $parser;

Core/tests/Snippet/Iam/IamTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ public function testClass()
5454
$this->checkAndSkipTest([
5555
SpannerClient::class,
5656
]);
57+
$this->checkAndSkipGrpcTests();
5758
$res = $snippet->invoke('iam');
5859

5960
$this->assertInstanceOf(IamManager::class, $res->returnVal());

Core/tests/Unit/generated/MockRequest.php

Lines changed: 85 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)