-
Notifications
You must be signed in to change notification settings - Fork 29
ci: Add integration test runner scripts for GAPIC Showcase #997
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
Merged
robertvoinescu-work
merged 1 commit into
googleapis:main
from
robertvoinescu-work:chore/integration-tests-ci
Aug 25, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,3 +11,7 @@ bazel-* | |
| tmp | ||
| launchSettings.json | ||
| .cr/ | ||
| /gapic-showcase | ||
| /gapic-showcase.exe | ||
| /showcase.pid | ||
| /showcase.log | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,44 @@ | ||||||||||||||||||||||||||||||||||
| #!/bin/bash | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| # This script: | ||||||||||||||||||||||||||||||||||
| # - Builds the Generator solution in Release mode | ||||||||||||||||||||||||||||||||||
| # - Starts GAPIC Showcase | ||||||||||||||||||||||||||||||||||
| # - Runs integration tests for the Generator projects in Release mode | ||||||||||||||||||||||||||||||||||
| # - Tears down GAPIC Showcase on exit | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| set -e | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| cd "$(dirname "$0")" | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export DOTNET_NOLOGO=true | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| CONFIG=Release | ||||||||||||||||||||||||||||||||||
| DOTNET_BUILD_ARGS="-c $CONFIG" | ||||||||||||||||||||||||||||||||||
| DOTNET_TEST_ARGS="--no-build $DOTNET_BUILD_ARGS" | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| echo "Building the solution in $CONFIG mode" | ||||||||||||||||||||||||||||||||||
| dotnet build $DOTNET_BUILD_ARGS Generator.sln | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| cleanup() { | ||||||||||||||||||||||||||||||||||
| echo "Tearing down GAPIC Showcase" | ||||||||||||||||||||||||||||||||||
| if [ -f showcase.pid ]; then | ||||||||||||||||||||||||||||||||||
| kill "$(cat showcase.pid)" 2>/dev/null || true | ||||||||||||||||||||||||||||||||||
| rm -f showcase.pid | ||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||
| rm -f gapic-showcase gapic-showcase.exe | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
robertvoinescu-work marked this conversation as resolved.
|
||||||||||||||||||||||||||||||||||
| trap cleanup EXIT | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| echo "Setup GAPIC Showcase for standard integration tests" | ||||||||||||||||||||||||||||||||||
| ./startshowcase.sh --port :7469 | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export SHOWCASE_ENDPOINT=http://localhost:7469 | ||||||||||||||||||||||||||||||||||
| dotnet test $DOTNET_TEST_ARGS Google.Api.Generator.IntegrationTests | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| echo "Setup GAPIC Showcase with TLS for PQC integration tests" | ||||||||||||||||||||||||||||||||||
| ./startshowcase.sh --port :7469 --tls | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| export SHOWCASE_ENDPOINT=https://localhost:7469 | ||||||||||||||||||||||||||||||||||
| dotnet test $DOTNET_TEST_ARGS Google.Api.Generator.IntegrationTests --filter "FullyQualifiedName~Pqc" | ||||||||||||||||||||||||||||||||||
|
robertvoinescu-work marked this conversation as resolved.
Comment on lines
+32
to
+42
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Everything should run now under TLS, that's closer to real life.
Suggested change
|
||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| echo "Integration testing completed" | ||||||||||||||||||||||||||||||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| #!/bin/bash | ||
| set -eo pipefail | ||
|
|
||
| cd "$(dirname "$0")" | ||
|
|
||
| if [[ "$OSTYPE" == "linux-gnu"* ]]; then OS="linux"; elif [[ "$OSTYPE" == "darwin"* ]]; then OS="darwin"; else OS="windows"; fi | ||
|
|
||
| ARCH="amd64" | ||
| if [[ "$OS" == "darwin" && $(uname -m) == "arm64" ]]; then | ||
| ARCH="arm64" | ||
| fi | ||
|
|
||
| # Clean up any previously running instance | ||
| if [ -f showcase.pid ]; then | ||
| kill "$(cat showcase.pid)" 2>/dev/null || true | ||
| rm -f showcase.pid | ||
| fi | ||
| pkill -f "gapic-showcase run" 2>/dev/null || true | ||
| sleep 1 | ||
|
|
||
| if [ ! -f gapic-showcase ] && [ ! -f gapic-showcase.exe ]; then | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We probably want to always run with the latest version? |
||
| echo "Resolving the latest GAPIC Showcase version for $OS-$ARCH..." | ||
| SHOWCASE_VERSION=$(curl -s https://api.github.com/repos/googleapis/gapic-showcase/releases/latest | sed -n 's/.*"tag_name": "v\([^"]*\)".*/\1/p' || true) | ||
| if [[ -z "$SHOWCASE_VERSION" ]]; then | ||
| # Fallback to known stable version if GitHub API rate limit is exceeded | ||
| SHOWCASE_VERSION="0.43.0" | ||
|
robertvoinescu-work marked this conversation as resolved.
|
||
| echo "Warning: Failed to resolve latest GAPIC Showcase version from GitHub; falling back to v${SHOWCASE_VERSION}." >&2 | ||
| fi | ||
|
|
||
| echo "Downloading gapic-showcase-${SHOWCASE_VERSION}-${OS}-${ARCH}..." | ||
| curl -sSL -f https://github.com/googleapis/gapic-showcase/releases/download/v${SHOWCASE_VERSION}/gapic-showcase-${SHOWCASE_VERSION}-${OS}-${ARCH}.tar.gz | tar -zx | ||
| fi | ||
|
|
||
| if [ $# -eq 0 ]; then | ||
| set -- --port :7469 | ||
| fi | ||
|
|
||
| if [[ "$OS" == "windows" ]]; then | ||
| ./gapic-showcase.exe run "$@" > showcase.log 2>&1 & | ||
| else | ||
| ./gapic-showcase run "$@" > showcase.log 2>&1 & | ||
| fi | ||
|
|
||
| # Write the PID to a file so the caller can easily tear it down | ||
| echo $! > showcase.pid | ||
| echo "Showcase started with PID $!" | ||
| sleep 2 | ||
| if ! kill -0 "$!" 2>/dev/null; then | ||
| echo "gapic-showcase failed to start. Please check showcase.log for details." >&2 | ||
| cat showcase.log >&2 || true | ||
| exit 1 | ||
| fi | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we clean up after ourselves instead?