Skip to content

Commit 2aaffe7

Browse files
feat(dev): add showcase:generate command (#9347)
1 parent 114dd02 commit 2aaffe7

135 files changed

Lines changed: 1573 additions & 1305 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Gax/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ be found for Mac or Windows.
8080
> vendor/bin/phpunit
8181
```
8282

83+
For Showcase Conformance testing and client generation, see [tests/Conformance/README.md](tests/Conformance/README.md).
84+
8385
4. Run static analysis tools
8486

8587
```sh

Gax/tests/Conformance/README.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# GAX Showcase Conformance Testing
2+
3+
This directory contains the integration conformance test suite (`ShowcaseTest.php`) and generated client SDK for `gapic-showcase`.
4+
5+
## Prerequisites
6+
7+
- **Protobuf Compiler (`protoc`)**: Ensure `protoc` is installed and available in your `$PATH`.
8+
- **Dev Dependencies**: Ensure dev dependencies are installed:
9+
```sh
10+
composer install -d dev/
11+
```
12+
13+
## Generating the Showcase Client
14+
15+
To generate or update the Showcase client SDK, message classes, and metadata using the PHP CLI tool:
16+
17+
```sh
18+
# From the repository root, run the console command:
19+
./dev/google-cloud showcase:generate
20+
```
21+
22+
Options:
23+
- `-o, --out-dir <dir>`: Output directory relative to repository root (defaults to `Gax`).
24+
- `-p, --showcase-path <dir>`: Path to local `gapic-showcase` repository (defaults to installed vendor dependency).
25+
- `-g, --generator-path <dir>`: Path to local `gapic-generator-php` (defaults to installed vendor dependency).
26+
- `-a, --googleapis-path <dir>`: Path to `googleapis` repository (defaults to submodule in `gapic-generator-php`).
27+
28+
## Running Conformance Tests
29+
30+
1. Install and launch the matching `gapic-showcase` mock server in the background:
31+
```sh
32+
# Option 1 (curl)
33+
curl -L https://github.com/googleapis/gapic-showcase/releases/download/v0.41.1/gapic-showcase-0.41.1-linux-amd64.tar.gz | tar -zx
34+
./gapic-showcase run &
35+
36+
# Option 2 (go install)
37+
go install github.com/googleapis/gapic-showcase/cmd/gapic-showcase@latest
38+
gapic-showcase run &
39+
```
40+
41+
2. Run the PHPUnit conformance test suite:
42+
```sh
43+
vendor/bin/phpunit -c Gax/phpunit-conformance.xml.dist
44+
# or from the Gax directory:
45+
cd Gax && vendor/bin/phpunit tests/Conformance/ShowcaseTest.php
46+
```
3.23 KB
Binary file not shown.
1.13 KB
Binary file not shown.
2.53 KB
Binary file not shown.
2.42 KB
Binary file not shown.

Gax/tests/Conformance/metadata/V1Beta1/RestError.php

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

Gax/tests/Conformance/metadata/V1Beta1/Sequence.php

Lines changed: 2 additions & 66 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
1.87 KB
Binary file not shown.

Gax/tests/Conformance/src/V1beta1/AttemptSequenceRequest.php

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

0 commit comments

Comments
 (0)