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

feat(tests): organize workflows, add system tests #7691

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
name: Backwards Compatibility Check
name: Backward Compatibility Checks
on:
pull_request:
types: [opened, synchronize, reopened, edited]
branches: ['main']
jobs:
# More info at https://github.com/Roave/BackwardCompatibilityCheck.
backwards-compatibility-check:
name: Breaking Change Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -46,10 +47,44 @@ jobs:
--from=${{ steps.latest-release.outputs.release }} \
--to=origin/main --format=github-actions

# Ensure that PRs labeled "feat" actually contain a new feature
conventional-commit-check:
name: Conventional Commit Check
runs-on: ubuntu-latest
if: github.event.pull_request.user.login == 'gcf-owl-bot[bot]'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: "Install PHP"
uses: shivammathur/setup-php@v2
with:
php-version: "8.1"
- name: "Install dependencies"
run: composer global require "roave/backward-compatibility-check:^8.2"
- name: "Check for an incorrect feat label in the PR"
id: compatibility-checker
continue-on-error: true
# OwlBot PRs which are not labelled feat should not add new files or methods
run: |
~/.composer/vendor/bin/roave-backward-compatibility-check --to=origin/main --format=github-actions
- name: "Print the action item"
run: |
if [[ "${{ steps.compatibility-checker.outcome }}" == 'failure' ]]; then
if [[ "${{ startsWith(github.event.pull_request.title, 'feat') }}" == "true" ]]; then
echo "Action item: Change the conventional commit to use 'feat'"
exit 1
fi
elif [[ "${{ startsWith(github.event.pull_request.title, 'feat') }}" == "false" ]]; then
echo "Action item: No features found, do not use 'feat' for the conventional commit"
exit 1
fi

# Ensure the release PR does not contain an unexpected (e.g. 2.0.0) major version release
# Add "MAJOR_VERSION_ALLOWED=component1,component2" to the PR description to allow major version
# releases for those components
unexpected-major-version-check:
name: Unexpected Major Version Check
runs-on: ubuntu-latest
if: github.event.pull_request.user.login == 'release-please[bot]'
steps:
Expand Down Expand Up @@ -85,4 +120,4 @@ jobs:
echo "Add \"MAJOR_VERSION_ALLOWED=component1,component2\" to the PR description to allow "
echo "major version releases for those components"
exit 1
fi
fi
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ on:
- main
paths:
- 'Storage/**'
- '.github/workflows/storage-emulator-retry-conformance-tests.yaml'
- '.github/workflows/emulator-conformance-tests-storage.yaml'
pull_request:
paths:
- 'Storage/**'
- '.github/workflows/storage-emulator-retry-conformance-tests.yaml'
- '.github/workflows/emulator-conformance-tests-storage.yaml'
name: Run Storage Retry Conformance Tests With Emulator
jobs:
test:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ on:
- main
paths:
- 'Bigtable/**'
- '.github/workflows/bigtable-emulator-system-tests.yaml'
- '.github/workflows/emulator-system-tests-bigtable.yaml'
- '.github/emulator/**'
pull_request:
paths:
- 'Bigtable/**'
- '.github/workflows/bigtable-emulator-system-tests.yaml'
- '.github/workflows/emulator-system-tests-bigtable.yaml'
- '.github/emulator/**'
name: Run Bigtable System Tests With Emulator
permissions:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ on:
- main
paths:
- 'Datastore/**'
- '.github/workflows/datastore-emulator-system-tests.yaml'
- '.github/workflows/emulator-system-tests-datastore.yaml'
- '.github/emulator/**'
pull_request:
paths:
- 'Datastore/**'
- '.github/workflows/datastore-emulator-system-tests.yaml'
- '.github/workflows/emulator-system-tests-datastore.yaml'
- '.github/emulator/**'
permissions:
contents: read
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ on:
- main
paths:
- 'Firestore/**'
- '.github/workflows/firestore-emulator-system-tests.yaml'
- '.github/workflows/emulator-system-tests-firestore.yaml'
- '.github/emulator/**'
pull_request:
paths:
- 'Firestore/**'
- '.github/workflows/firestore-emulator-system-tests.yaml'
- '.github/workflows/emulator-system-tests-firestore.yaml'
- '.github/emulator/**'
name: Run Firestore System Tests With Emulator
permissions:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ on:
- main
paths:
- 'PubSub/**'
- '.github/workflows/pubsub-emulator-system-tests.yaml'
- '.github/workflows/emulator-system-tests-pubsub.yaml'
- '.github/emulator/**'
pull_request:
paths:
- 'PubSub/**'
- '.github/workflows/pubsub-emulator-system-tests.yaml'
- '.github/workflows/emulator-system-tests-pubsub.yaml'
- '.github/emulator/**'
name: Run PubSub System Tests With Emulator
permissions:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ on:
- main
paths:
- 'Spanner/**'
- '.github/workflows/spanner-emulator-system-tests.yaml'
- '.github/workflows/emulator-system-tests-spanner.yaml'
pull_request:
paths:
- 'Spanner/**'
- '.github/workflows/spanner-emulator-system-tests.yaml'
- '.github/workflows/emulator-system-tests-spanner.yaml'
name: Run Spanner System Tests With Emulator
permissions:
contents: read
Expand Down
34 changes: 0 additions & 34 deletions .github/workflows/incorrect-conventional-commit-check.yaml

This file was deleted.

38 changes: 38 additions & 0 deletions .github/workflows/system-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: System Tests
on:
pull_request:
jobs:
# Run system tests on the release PR
system-tests:
name: Run System Test Suite
runs-on: ubuntu-latest
if: github.event.pull_request.user.login == 'release-please[bot]'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup PHP
uses: shivammathur/setup-php@verbose
with:
php-version: "8.1"
- name: Install dependencies and define env vars
run: composer --no-interaction --no-ansi --no-progress update
env:
GOOGLE_CLOUD_PHP_TESTS_KEY_PATH: "${{ runner.temp }}/service-account.json"
GOOGLE_CLOUD_PHP_WHITELIST_TESTS_KEY_PATH: "${{ runner.temp }}/service-account.whitelist.json"
GOOGLE_CLOUD_PHP_FIRESTORE_TESTS_KEY_PATH: "${{ runner.temp }}/service-account.firestore.json"
ASSET_TEST_BUCKET: php_asset_test_bucket
- uses: mobiledevops/secret-to-file-action@v1
with:
base64-encoded-secret: ${{ secrets.GOOGLE_CLOUD_PHP_TESTS_KEY }}
filename: ${{ env.GOOGLE_CLOUD_PHP_TESTS_KEY_PATH }}
- uses: mobiledevops/secret-to-file-action@v1
with:
base64-encoded-secret: ${{ secrets.GOOGLE_CLOUD_PHP_WHITELIST_TESTS_KEY }}
filename: ${{ env.GOOGLE_CLOUD_PHP_WHITELIST_TESTS_KEY_PATH }}
- uses: mobiledevops/secret-to-file-action@v1
with:
base64-encoded-secret: ${{ secrets.GOOGLE_CLOUD_PHP_FIRESTORE_TESTS_KEY }}
filename: ${{ env.GOOGLE_CLOUD_PHP_FIRESTORE_TESTS_KEY_PATH }}
- name: Run System Tests
run: vendor/bin/phpunit -d memory_limit=512M -c phpunit-system.xml.dist --verbose
59 changes: 0 additions & 59 deletions .kokoro/continuous/php81.cfg

This file was deleted.

50 changes: 0 additions & 50 deletions .kokoro/continuous/run-tests.sh

This file was deleted.

7 changes: 0 additions & 7 deletions phpunit-system.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,6 @@
<directory suffix=".php">*/src</directory>
<directory suffix=".php">src</directory>
</include>
<exclude>
<directory suffix=".php">*/src/V[!a-zA-Z]*</directory>
<directory suffix=".php">*/src/*/V[!a-zA-Z]*</directory>
<directory suffix=".php">*/src/*/*/V[!a-zA-Z]*</directory>
<directory suffix=".php">Core/src/Testing</directory>
<directory suffix=".php">dev</directory>
</exclude>
</coverage>
<testsuites>
<testsuite name="System Test Suite">
Expand Down
Loading