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

chore(tests): add CI for checking lowest version of dependencies #6899

Merged
merged 23 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
2b206d5
chore(tests): add CI for checking lowest version of dependencies
bshaffer Dec 18, 2023
7801ffa
update dev deps
bshaffer Dec 18, 2023
e632142
update all packages for tests to pass
bshaffer Dec 18, 2023
536fa1d
run lowest dependency tests on lowest version of PHP
bshaffer Dec 18, 2023
c8ebc75
fix language
bshaffer Dec 18, 2023
9023d4e
Merge branch 'main' into add-prefer-lowest-package-tests
bshaffer Jan 5, 2024
cfdcc3a
chore: add Longrunning version to composer.json
bshaffer Jan 5, 2024
20df777
we no longer need COMPOSER_ROOT_VERSION
bshaffer Jan 5, 2024
7edfbda
remove common protos dep
bshaffer Jan 5, 2024
e07a9c6
define minimum common-protos dep
bshaffer Jan 5, 2024
a82edd8
fix usage/comment
bshaffer Jan 5, 2024
e245eee
Merge branch 'main' into add-prefer-lowest-package-tests
bshaffer Jan 5, 2024
4f37dfe
Update Channel/composer.json
bshaffer Jan 5, 2024
1037149
do NOT use local packagess for --prefer-lowest
bshaffer Jan 8, 2024
ce3372c
fix deps for lowest
bshaffer Jan 9, 2024
8f3cdae
allow psr/log v1
bshaffer Jan 9, 2024
49384b8
Merge branch 'main' into add-prefer-lowest-package-tests
bshaffer Jan 18, 2024
ce10711
fix config deps
bshaffer Jan 18, 2024
b1e7c1e
Merge branch 'add-prefer-lowest-package-tests' of github.com:googleap…
bshaffer Jan 18, 2024
43af413
upgrade minimum cloud-common-protos version
bshaffer Jan 18, 2024
8a8f555
Merge branch 'main' into add-prefer-lowest-package-tests
bshaffer Jan 19, 2024
ab0b7b1
Merge branch 'main' into add-prefer-lowest-package-tests
bshaffer Jan 20, 2024
6c88a2f
add vmware common protos
bshaffer Jan 22, 2024
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
50 changes: 36 additions & 14 deletions .github/run-package-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,27 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# first argument can be a directory
DIRS=$(find * -maxdepth 0 -type d -name '[A-Z]*')
PREFER_LOWEST=""
VALID=1
if [ "$#" -eq 1 ]; then
DIRS=$1
# first argument can be a directory or "--prefer-lowest"
if [ "$1" = "--prefer-lowest" ]; then
PREFER_LOWEST="--prefer-lowest"
else
DIRS=$1
fi
elif [ "$#" -eq 2 ]; then
# first argument is a directory, second is "--prefer-lowest"
if [ "$2" = "--prefer-lowest" ]; then
DIRS=$1
PREFER_LOWEST="--prefer-lowest"
else
echo "usage: run-package-tests.sh [DIR] [--prefer-lowest]"
exit 1;
fi
elif [ "$#" -ne 0 ]; then
echo "usage: run-package-tests.sh [DIR]"
echo "usage: run-package-tests.sh [DIR] [--prefer-lowest]"
exit 1;
fi

Expand All @@ -28,21 +43,28 @@ export COMPOSER=composer-local.json
FAILED_FILE=$(mktemp -d)/failed
for DIR in ${DIRS}; do {
cp ${DIR}/composer.json ${DIR}/composer-local.json
# Update composer to use local packages
for i in BigQuery,cloud-bigquery Core,cloud-core Logging,cloud-logging PubSub,cloud-pubsub Storage,cloud-storage ShoppingCommonProtos,shopping-common-protos,0.2; do
IFS=","; set -- $i;
if grep -q "\"google/$2\":" ${DIR}/composer.json; then
if [ -z "$3" ]; then VERSION="1.100"; else VERSION=$3; fi
composer config repositories.$2 "{\"type\": \"path\", \"url\": \"../$1\", \"options\":{\"versions\":{\"google/$2\":\"$VERSION\"}}}" -d ${DIR}
fi
done
if [ "$PREFER_LOWEST" = "" ]; then
# Update composer to use local packages
for i in BigQuery,cloud-bigquery Core,cloud-core Logging,cloud-logging PubSub,cloud-pubsub Storage,cloud-storage ShoppingCommonProtos,shopping-common-protos,0.2; do
IFS=","; set -- $i;
if grep -q "\"google/$2\":" ${DIR}/composer.json; then
if [ -z "$3" ]; then VERSION="1.100"; else VERSION=$3; fi
echo "Use local package $1 as google/$2:$VERSION in $DIR"
composer config repositories.$2 "{\"type\": \"path\", \"url\": \"../$1\", \"options\":{\"versions\":{\"google/$2\":\"$VERSION\"}}}" -d ${DIR}
fi
done
fi

echo "Installing composer in $DIR"
composer -q --no-interaction --no-ansi --no-progress update -d ${DIR};
echo -n "Installing composer in $DIR"
if [ "$PREFER_LOWEST" != "" ]; then
echo -n " (with $PREFER_LOWEST)"
fi
echo ""
composer -q --no-interaction --no-ansi --no-progress $PREFER_LOWEST update -d ${DIR};
if [ $? != 0 ]; then
echo "$DIR: composer install failed" >> "${FAILED_FILE}"
# run again but without "-q" so we can see the error
composer --no-interaction --no-ansi --no-progress update -d ${DIR};
composer --no-interaction --no-ansi --no-progress $PREFER_LOWEST update -d ${DIR};
continue
fi
echo "Running $DIR Unit Tests"
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,19 @@ jobs:
- name: Run Package Test Suites
run: bash .github/run-package-tests.sh

test_packages_lowest:
name: Package Tests (Lowest Dependencies)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@verbose
with:
php-version: '7.4'
extensions: grpc
- name: Run Package Test Suites
run: bash .github/run-package-tests.sh --prefer-lowest

test_dev_commands:
name: Dev Commands Unit Tests
runs-on: ubuntu-latest
Expand Down
3 changes: 2 additions & 1 deletion BigQuery/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"phpunit/phpunit": "^9.0",
"phpspec/prophecy-phpunit": "^2.0",
"squizlabs/php_codesniffer": "2.*",
"phpdocumentor/reflection": "^5.0",
"phpdocumentor/reflection": "^5.3.3",
"phpdocumentor/reflection-docblock": "^5.3",
"erusev/parsedown": "^1.6",
"google/cloud-storage": "^1.3"
},
Expand Down
3 changes: 2 additions & 1 deletion Bigtable/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"require-dev": {
"phpunit/phpunit": "^9.0",
"erusev/parsedown": "^1.6",
"phpdocumentor/reflection": "^5.0",
"phpdocumentor/reflection": "^5.3.3",
"phpdocumentor/reflection-docblock": "^5.3",
"phpspec/prophecy-phpunit": "^2.0"
},
"suggest": {
Expand Down
3 changes: 2 additions & 1 deletion Config/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
},
"require": {
"php": ">=7.4",
"google/gax": "^1.26.0"
"google/gax": "^1.26.0",
"google/common-protos": " ^4.4"
},
"require-dev": {
"phpunit/phpunit": "^9.0"
Expand Down
5 changes: 3 additions & 2 deletions Core/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@
"phpunit/phpunit": "^9.0",
"phpspec/prophecy-phpunit": "^2.0",
"squizlabs/php_codesniffer": "2.*",
"phpdocumentor/reflection": "^5.0",
"phpdocumentor/reflection": "^5.3.3",
"phpdocumentor/reflection-docblock": "^5.3",
"erusev/parsedown": "^1.6",
"google/gax": "^1.26.0",
"opis/closure": "^3",
"google/cloud-common-protos": "^0.5"
"google/cloud-common-protos": "~0.5"
yash30201 marked this conversation as resolved.
Show resolved Hide resolved
},
"suggest": {
"opis/closure": "May be used to serialize closures to process jobs in the batch daemon. Please require version ^3.",
Expand Down
3 changes: 2 additions & 1 deletion Datastore/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"phpunit/phpunit": "^9.0",
"phpspec/prophecy-phpunit": "^2.0",
"squizlabs/php_codesniffer": "2.*",
"phpdocumentor/reflection": "^5.0",
"phpdocumentor/reflection": "^5.3.3",
"phpdocumentor/reflection-docblock": "^5.3",
"erusev/parsedown": "^1.6"
},
"extra": {
Expand Down
5 changes: 3 additions & 2 deletions Debugger/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@
"google/cloud-core": "^1.52.7",
"google/cloud-logging": "^1.16",
"google/gax": "^1.26.0",
"google/cloud-common-protos": "^0.5",
"google/cloud-common-protos": "~0.5",
"psr/log": "^1.0||^2.0"
},
"require-dev": {
"phpunit/phpunit": "^9.0",
"phpspec/prophecy-phpunit": "^2.0",
"squizlabs/php_codesniffer": "2.*",
"phpdocumentor/reflection": "^5.0",
"phpdocumentor/reflection": "^5.3.3",
"phpdocumentor/reflection-docblock": "^5.3",
"erusev/parsedown": "^1.6",
"google/cloud-tools": "^0.13.0",
"kreait/firebase-php": "^5.26.5"
Expand Down
5 changes: 3 additions & 2 deletions ErrorReporting/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
"minimum-stability": "stable",
"require": {
"php": ">=7.4",
"google/cloud-logging": "^1.16",
"google/cloud-logging": "^1.29",
"google/gax": "^1.26.0"
},
"require-dev": {
"phpunit/phpunit": "^9.0",
"phpspec/prophecy-phpunit": "^2.0",
"google/cloud-core": "^1.52.7"
"google/cloud-core": "^1.52.7",
"psr/log": "^1.1.1||^2.0"
},
"suggest": {
"ext-grpc": "The gRPC extension allows more granular control over Error Reporting",
Expand Down
2 changes: 1 addition & 1 deletion Filestore/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"require": {
"php": ">=7.4",
"google/gax": "^1.26.0",
"google/cloud-common-protos": "^0.5"
"google/cloud-common-protos": "~0.5"
},
"require-dev": {
"phpunit/phpunit": "^9.0"
Expand Down
3 changes: 2 additions & 1 deletion Firestore/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"phpunit/phpunit": "^9.0",
"phpspec/prophecy-phpunit": "^2.0",
"squizlabs/php_codesniffer": "2.*",
"phpdocumentor/reflection": "^5.0",
"phpdocumentor/reflection": "^5.3.3",
"phpdocumentor/reflection-docblock": "^5.3",
"erusev/parsedown": "^1.6"
},
"suggest": {
Expand Down
3 changes: 2 additions & 1 deletion Language/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"phpunit/phpunit": "^9.0",
"phpspec/prophecy-phpunit": "^2.0",
"squizlabs/php_codesniffer": "2.*",
"phpdocumentor/reflection": "^5.0",
"phpdocumentor/reflection": "^5.3.3",
"phpdocumentor/reflection-docblock": "^5.3",
"erusev/parsedown": "^1.6",
"google/cloud-storage": "^1.3"
},
Expand Down
6 changes: 4 additions & 2 deletions Logging/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@
"phpunit/phpunit": "^9.0",
"phpspec/prophecy-phpunit": "^2.0",
"squizlabs/php_codesniffer": "2.*",
"phpdocumentor/reflection": "^5.0",
"phpdocumentor/reflection": "^5.3.3",
"phpdocumentor/reflection-docblock": "^5.3",
"erusev/parsedown": "^1.6",
"fig/log-test": "^1.0",
"google/cloud-storage": "^1.3",
"google/cloud-bigquery": "^1.0",
"google/cloud-pubsub": "^1.0",
"opis/closure": "^3"
"opis/closure": "^3",
"monolog/monolog": "^2.9|3.0"
},
"provide": {
"psr/log-implementation": "1.0|2.0"
Expand Down
3 changes: 2 additions & 1 deletion PubSub/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"phpunit/phpunit": "^9.0",
"phpspec/prophecy-phpunit": "^2.0",
"squizlabs/php_codesniffer": "2.*",
"phpdocumentor/reflection": "^5.0",
"phpdocumentor/reflection": "^5.3.3",
"phpdocumentor/reflection-docblock": "^5.3",
"erusev/parsedown": "^1.6",
"flix-tech/avro-php": "^5.0.0"
},
Expand Down
3 changes: 2 additions & 1 deletion Spanner/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"phpunit/phpunit": "^9.0",
"phpspec/prophecy-phpunit": "^2.0",
"squizlabs/php_codesniffer": "2.*",
"phpdocumentor/reflection": "^5.0",
"phpdocumentor/reflection": "^5.3.3",
"phpdocumentor/reflection-docblock": "^5.3",
"erusev/parsedown": "^1.6",
"google/cloud-pubsub": "^1.0"
},
Expand Down
3 changes: 2 additions & 1 deletion Speech/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"phpunit/phpunit": "^9.0",
"phpspec/prophecy-phpunit": "^2.0",
"squizlabs/php_codesniffer": "2.*",
"phpdocumentor/reflection": "^5.0",
"phpdocumentor/reflection": "^5.3.3",
"phpdocumentor/reflection-docblock": "^5.3",
"erusev/parsedown": "^1.6",
"google/cloud-storage": "^1.3"
},
Expand Down
3 changes: 2 additions & 1 deletion Storage/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"phpunit/phpunit": "^9.0",
"phpspec/prophecy-phpunit": "^2.0",
"squizlabs/php_codesniffer": "2.*",
"phpdocumentor/reflection": "^5.0",
"phpdocumentor/reflection": "^5.3.3",
"phpdocumentor/reflection-docblock": "^5.3",
"erusev/parsedown": "^1.6",
"phpseclib/phpseclib": "^2.0||^3.0",
"google/cloud-pubsub": "^1.0"
Expand Down
3 changes: 2 additions & 1 deletion Trace/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"phpunit/phpunit": "^9.0",
"phpspec/prophecy-phpunit": "^2.0",
"squizlabs/php_codesniffer": "2.*",
"phpdocumentor/reflection": "^5.0",
"phpdocumentor/reflection": "^5.3.3",
"phpdocumentor/reflection-docblock": "^5.3",
"erusev/parsedown": "^1.6"
},
"suggest": {
Expand Down
3 changes: 2 additions & 1 deletion Translate/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"phpunit/phpunit": "^9.0",
"phpspec/prophecy-phpunit": "^2.0",
"squizlabs/php_codesniffer": "2.*",
"phpdocumentor/reflection": "^5.0",
"phpdocumentor/reflection": "^5.3.3",
"phpdocumentor/reflection-docblock": "^5.3",
"erusev/parsedown": "^1.6"
},
"suggest": {
Expand Down
3 changes: 2 additions & 1 deletion Vision/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"phpunit/phpunit": "^9.0",
"phpspec/prophecy-phpunit": "^2.0",
"squizlabs/php_codesniffer": "2.*",
"phpdocumentor/reflection": "^5.0",
"phpdocumentor/reflection": "^5.3.3",
"phpdocumentor/reflection-docblock": "^5.3",
"erusev/parsedown": "^1.6",
"google/cloud-storage": "^1.12"
},
Expand Down
3 changes: 2 additions & 1 deletion VmwareEngine/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
},
"require": {
"php": ">=7.4",
"google/gax": "^1.26.0"
"google/gax": "^1.26.0",
"google/common-protos": "^4.4"
},
"require-dev": {
"phpunit/phpunit": "^9.0"
Expand Down
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,16 @@
"google/auth": "^1.34"
},
"require-dev": {
"phpunit/phpunit": "^9.0",
"phpunit/phpunit": "^9.6",
"phpdocumentor/reflection": "^5.0",
"erusev/parsedown": "^1.6",
"phpseclib/phpseclib": "^3.0",
"google/cloud-tools": "^0.13.0",
"opis/closure": "^3.0",
"flix-tech/avro-php": "^5.0.0",
"phpspec/prophecy-phpunit": "^2.0",
"kreait/firebase-php": "^5.26.5"
"phpspec/prophecy-phpunit": "^2.1",
"kreait/firebase-php": "^5.26.5",
"psr/log": "^1.1.1 || 2.0"
},
"conflict": {
"psr/log": ">=3"
Expand Down
Loading