Skip to content

PHPC-1994: Fix Evergreen testing for custom libmongoc versions #1271

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 1 commit into from
Nov 2, 2021
Merged
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
37 changes: 14 additions & 23 deletions .evergreen/compile-unix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,13 @@
set -o errexit # Exit the script with error if any of the commands fail

# Supported/used environment variables:
# MARCH Machine Architecture. Defaults to lowercase uname -m
# RELEASE Use the fully qualified release archive

RELEASE=${RELEASE:-no}

# MARCH Machine Architecture. Defaults to lowercase uname -m
# LIBMONGOC_VERSION Optional libmongoc version (regenerate version file if set)

# Automatically retrieve the machine architecture, lowercase, unless provided
# as an environment variable (e.g. to force 32bit)
[ -z "$MARCH" ] && MARCH=$(uname -m | tr '[:upper:]' '[:lower:]')

# Get the kernel name, lowercased
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
echo "OS: $OS"

# --strip-components is an GNU tar extension. Check if the platform
# (e.g. Solaris) has GNU tar installed as `gtar`, otherwise we assume to be on
# platform that supports it
# command -v returns success error code if found and prints the path to it
if command -v gtar 2>/dev/null; then
TAR=gtar
else
TAR=tar
fi
echo "MARCH: $MARCH"

# Any architecture specific configuration here
case "$MARCH" in
Expand All @@ -39,6 +23,9 @@ case "$MARCH" in
;;
esac

# Get the kernel name, lowercased
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
echo "OS: $OS"

# Operating system specific tweaks
case "$OS" in
Expand All @@ -57,11 +44,15 @@ case "$OS" in
;;
esac

echo "MARCH: $MARCH"
echo "RELEASE: $RELEASE"
echo "OS: $OS"
echo "PHP: $PHP_VERSION (`php --version | head -1`)"
# Report the current PHP version
echo "PHP: `php --version | head -1`"

phpize
./configure --enable-mongodb-developer-flags

# If we're testing a specific version of libmongoc, regenerate the version file
if [ -n "$LIBMONGOC_VERSION" ]; then
make libmongoc-version-current
fi

make
20 changes: 11 additions & 9 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,11 @@ functions:
params:
working_dir: "src/src/libmongoc"
script: |
if [ -n "$LIBMONGOC_VERSION" ]; then
if [ -n "${LIBMONGOC_VERSION}" ]; then
echo "Checking out libmongoc version: ${LIBMONGOC_VERSION}"
git fetch
git checkout $LIBMONGOC_VERSION
../../build/calc_release_version.py
git checkout ${LIBMONGOC_VERSION}
# Note: compile-unix.sh will run `make libmongoc-version-current`
fi
# Applies the submitted patch, if any
# Deprecated. Should be removed. But still needed for certain agents (ZAP)
Expand Down Expand Up @@ -114,6 +115,7 @@ functions:

export PHP_VERSION="$PHP_VERSION"
export SSL_DIR="$DRIVERS_TOOLS/.evergreen/x509gen"
export LIBMONGOC_VERSION="${LIBMONGOC_VERSION}"
EOT
# See what we've done
cat expansion.yml
Expand Down Expand Up @@ -1142,15 +1144,15 @@ axes:
display_name: libmongoc version
values:
- id: "lowest-supported"
display_name: "Lowest (1.18.0)"
display_name: "Lowest (1.19.1)"
variables:
LIBMONGOC_VERSION: "1.18.0"
- id: "upccoming-stable"
display_name: "latest (1.18-dev)"
LIBMONGOC_VERSION: "1.19.1"
- id: "upcoming-stable"
display_name: "latest (1.19-dev)"
variables:
LIBMONGOC_VERSION: "r1.18"
LIBMONGOC_VERSION: "r1.19"
- id: "latest-dev"
display_name: "Upcoming release (1.19)"
display_name: "Upcoming release (1.20)"
variables:
LIBMONGOC_VERSION: "master"

Expand Down