-
Notifications
You must be signed in to change notification settings - Fork 266
PHPLIB-617 Continuous Matrix Testing for 4.0 era drivers #810
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
Merged
Changes from 1 commit
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
c989da5
Add scripts for matrix testing
alcaeus 9830552
Extract composer install to separate script
alcaeus e44e98b
Move some version shenanigans to drivers-matrix-testing
alcaeus 49650ea
Fix wrong exit in function
alcaeus fb2efed
Rename matrix testing env variable
alcaeus 4005292
Simplify driver detection logic
alcaeus a5bd42b
Rename DRIVER_VERSION variable to remove conflicts with matrix testin…
alcaeus 38072fe
Update test info output
alcaeus 199cd73
Remove xtrace option in scripts
alcaeus 2129841
Set PHP patch version automatically
alcaeus ba0c0f8
Use groups to skip tests for matrix testing
alcaeus 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
extension=mongodb.so |
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,99 @@ | ||
#!/bin/sh | ||
set -o xtrace # Write all commands first to stderr | ||
set -o errexit # Exit the script with error if any of the commands fail | ||
|
||
install_extension () | ||
{ | ||
# Workaround to get PECL running on PHP 7.0 | ||
export PHP_PEAR_PHP_BIN=${PHP_PATH}/bin/php | ||
export PHP_PEAR_INSTALL_DIR=${PHP_PATH}/lib/php | ||
|
||
rm -f ${PHP_PATH}/lib/php.ini | ||
|
||
if [ "x${DRIVER_BRANCH}" != "x" ] || [ "x${DRIVER_REPO}" != "x" ]; then | ||
CLONE_REPO=${DRIVER_REPO:-https://github.com/mongodb/mongo-php-driver} | ||
CHECKOUT_BRANCH=${DRIVER_BRANCH:-master} | ||
|
||
echo "Compiling driver branch ${CHECKOUT_BRANCH} from repository ${CLONE_REPO}" | ||
|
||
mkdir -p /tmp/compile | ||
rm -rf /tmp/compile/mongo-php-driver | ||
git clone ${CLONE_REPO} /tmp/compile/mongo-php-driver | ||
cd /tmp/compile/mongo-php-driver | ||
|
||
git checkout ${CHECKOUT_BRANCH} | ||
git submodule update --init | ||
phpize | ||
./configure --enable-mongodb-developer-flags | ||
make all -j20 > /dev/null | ||
make install | ||
|
||
cd ${PROJECT_DIRECTORY} | ||
elif [ "x${DRIVER_VERSION}" != "x" ]; then | ||
echo "Installing driver version ${DRIVER_VERSION} from PECL" | ||
pecl install -f mongodb-${DRIVER_VERSION} | ||
else | ||
echo "Installing latest driver version from PECL" | ||
pecl install -f mongodb | ||
fi | ||
|
||
sudo cp ${PROJECT_DIRECTORY}/.evergreen/config/php.ini ${PHP_PATH}/lib/php.ini | ||
jmikola marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
|
||
# Functions to fetch MongoDB binaries | ||
. ${DRIVERS_TOOLS}/.evergreen/download-mongodb.sh | ||
OS=$(uname -s | tr '[:upper:]' '[:lower:]') | ||
|
||
get_distro | ||
|
||
case "$DISTRO" in | ||
cygwin*) | ||
echo "Install Windows dependencies" | ||
;; | ||
|
||
darwin*) | ||
echo "Install macOS dependencies" | ||
;; | ||
|
||
linux-rhel*) | ||
echo "Install RHEL dependencies" | ||
;; | ||
|
||
linux-ubuntu*) | ||
echo "Install Ubuntu dependencies" | ||
sudo apt-get install -y awscli || true | ||
;; | ||
|
||
sunos*) | ||
echo "Install Solaris dependencies" | ||
sudo /opt/csw/bin/pkgutil -y -i sasl_dev || true | ||
;; | ||
|
||
*) | ||
echo "All other platforms..." | ||
;; | ||
esac | ||
|
||
case "$DEPENDENCIES" in | ||
lowest*) | ||
COMPOSER_FLAGS="${COMPOSER_FLAGS} --prefer-lowest" | ||
;; | ||
|
||
*) | ||
;; | ||
esac | ||
|
||
PHP_PATH=/opt/php/${PHP_VERSION}-64bit | ||
OLD_PATH=$PATH | ||
PATH=$PHP_PATH/bin:$OLD_PATH | ||
|
||
install_extension | ||
|
||
php --ri mongodb | ||
|
||
# Install composer | ||
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" | ||
jmikola marked this conversation as resolved.
Show resolved
Hide resolved
|
||
php composer-setup.php | ||
php -r "unlink('composer-setup.php');" | ||
|
||
php composer.phar update $COMPOSER_FLAGS |
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,41 @@ | ||
#!/bin/sh | ||
set -o xtrace # Write all commands first to stderr | ||
set -o errexit # Exit the script with error if any of the commands fail | ||
|
||
# Supported/used environment variables: | ||
# AUTH Set to enable authentication. Defaults to "noauth" | ||
# SSL Set to enable SSL. Defaults to "nossl" | ||
# MONGODB_URI Set the suggested connection MONGODB_URI (including credentials and topology info) | ||
# MARCH Machine Architecture. Defaults to lowercase uname -m | ||
|
||
|
||
AUTH=${AUTH:-noauth} | ||
SSL=${SSL:-nossl} | ||
MONGODB_URI=${MONGODB_URI:-} | ||
TESTS=${TESTS:-} | ||
PHP_VERSION=${PHP_VERSION:-7.2.21} | ||
jmikola marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
# The PLATFORM environment variable is used by the matrix testing project. | ||
# For the time being, we can use that to install the correct extension version | ||
alcaeus marked this conversation as resolved.
Show resolved
Hide resolved
|
||
if [ "x${PLATFORM}" != "x" ]; then | ||
DIR=$(dirname $0) | ||
DRIVER_VERSION=1.5.5 . $DIR/install-dependencies.sh | ||
jmikola marked this conversation as resolved.
Show resolved
Hide resolved
|
||
fi | ||
alcaeus marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
OS=$(uname -s | tr '[:upper:]' '[:lower:]') | ||
[ -z "$MARCH" ] && MARCH=$(uname -m | tr '[:upper:]' '[:lower:]') | ||
|
||
echo "Running $AUTH tests over $SSL, connecting to $MONGODB_URI" | ||
jmikola marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
OLD_PATH=$PATH | ||
PATH=/opt/php/${PHP_VERSION}-64bit/bin:$OLD_PATH | ||
|
||
# Disable failing PHPUnit due to deprecations | ||
export SYMFONY_DEPRECATIONS_HELPER=999999 | ||
|
||
# Run the tests, and store the results in a Evergreen compatible JSON results file | ||
case "$TESTS" in | ||
*) | ||
php vendor/bin/phpunit --configuration phpunit.evergreen.xml | ||
alcaeus marked this conversation as resolved.
Show resolved
Hide resolved
|
||
;; | ||
esac |
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,32 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<phpunit | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.3/phpunit.xsd" | ||
backupGlobals="false" | ||
backupStaticAttributes="false" | ||
colors="true" | ||
convertErrorsToExceptions="true" | ||
convertNoticesToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
stopOnFailure="false" | ||
syntaxCheck="false" | ||
bootstrap="tests/bootstrap.php" | ||
> | ||
|
||
<php> | ||
<ini name="error_reporting" value="-1"/> | ||
jmikola marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<env name="MONGODB_URI" value="mongodb://127.0.0.1:27017/?serverSelectionTimeoutMS=100"/> | ||
jmikola marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<env name="MONGODB_DATABASE" value="phplib_test"/> | ||
</php> | ||
|
||
<testsuites> | ||
<testsuite name="Default Test Suite"> | ||
<directory>./tests/</directory> | ||
</testsuite> | ||
</testsuites> | ||
|
||
<logging> | ||
<log type="junit" target="test-results.xml" /> | ||
</logging> | ||
</phpunit> |
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.
Uh oh!
There was an error while loading. Please reload this page.