Skip to content

Commit

Permalink
test: add php post-processor tests (googleapis#1890)
Browse files Browse the repository at this point in the history
* test: add php post-processor tests

* test: remove e2e test case

* chore: fix copy/paste typo

* build: make owlbot-php-presubmit required check
  • Loading branch information
chingor13 authored Nov 8, 2023
1 parent febaccc commit d53021f
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/sync-repo-settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ branchProtectionRules:
- 'owlbot-nodejs-mono-repo-presubmit (repo-automation-bots)'
- 'owlbot-nodejs-presubmit (repo-automation-bots)'
- 'owlbot-java-presubmit (repo-automation-bots)'
- 'owlbot-php-presubmit (repo-automation-bots)'
requiredApprovingReviewCount: 1
requiresCodeOwnerReviews: true
requiresStrictStatusChecks: true
Expand Down
31 changes: 31 additions & 0 deletions docker/owlbot/php/cloudbuild_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
steps:
# Write the latest commit message to a file in the workspace.
- name: 'gcr.io/cloud-builders/git'
entrypoint: '/bin/sh'
args:
- '-c'
- 'git log -1 --format="%s%n%n%b%nSource-Link: https://github.com/googleapis/synthtool/commit/%H" > post-processor-changes.txt'
# Build the docker image.
- name: "gcr.io/cloud-builders/docker"
args: [ "build",
"-t", "gcr.io/$PROJECT_ID/owlbot-php:$SHORT_SHA",
"-t", "gcr.io/$PROJECT_ID/owlbot-php:latest",
"-f", "docker/owlbot/php/Dockerfile", "." ]
id: "build"
- name: gcr.io/gcp-runtimes/container-structure-test
args:
["test", "--image", "gcr.io/$PROJECT_ID/owlbot-php:$SHORT_SHA", "--config", "docker/owlbot/php/container_test.yaml"]
waitFor: ["build"]
28 changes: 28 additions & 0 deletions docker/owlbot/php/container_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

schemaVersion: 2.0.0
commandTests:
- name: "python"
command: "python"
args: ["--version"]
expectedOutput: ["Python 3.10.6"]
- name: "php synthtool validation"
command: "python"
# Use YAML List Style for this command
# Having to use backslash for quotes (\") was resulting in an invalid test
args:
- -c
- 'import synthtool.languages.php; print("import success")'
expectedOutput: ["import success"]

0 comments on commit d53021f

Please sign in to comment.