From 488f17a2f440395e126b6093bfa85d3f0f2c51d1 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Mon, 4 Nov 2024 10:01:37 -0600 Subject: [PATCH] Revert "DRIVERS-3030 Ensure mongosh download is properly working (#540)" This reverts commit c5418bbee65929f8157fda9a2ee7bed034c0217c. --- .evergreen/config.yml | 48 ++++++++++++++++++++++---- .evergreen/mongosh-dl.py | 11 ++---- .evergreen/tests/test-mongodl.sh | 59 -------------------------------- 3 files changed, 43 insertions(+), 75 deletions(-) delete mode 100755 .evergreen/tests/test-mongodl.sh diff --git a/.evergreen/config.yml b/.evergreen/config.yml index e430e3c9..de1cde69 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -512,18 +512,52 @@ functions: make test "run mongodl test partial": - - command: subprocess.exec + - command: shell.exec type: test params: - binary: bash - args: [src/.evergreen/tests/test-mongodl.sh, partial] + shell: bash + script: |- + set -o errexit + cd ${DRIVERS_TOOLS}/.evergreen + . find-python3.sh + PYTHON=$(ensure_python3) + echo "Using PYTHON: $PYTHON" + $PYTHON mongodl.py --edition enterprise --version 7.0 --component archive-debug --no-download + $PYTHON mongodl.py --edition enterprise --version 7.0 --component cryptd --test + $PYTHON mongosh-dl.py --no-download + $PYTHON mongosh-dl.py --version 2.1.1 --no-download + $PYTHON mongosh-dl.py --version 2.1.1 --out $(pwd) "run mongodl test full": - - command: subprocess.exec + - command: shell.exec type: test params: - binary: bash - args: [src/.evergreen/tests/test-mongodl.sh] + shell: bash + script: |- + set -o errexit + cd ${DRIVERS_TOOLS}/.evergreen + . find-python3.sh + PYTHON=$(ensure_python3 2>/dev/null) + echo "Using PYTHON: $PYTHON" + # Ensure that all distros are accounted for in DISTRO_ID_TO_TARGET + export VALIDATE_DISTROS=1 + $PYTHON mongodl.py --list + if [ "$OS" != "Windows_NT" ]; then + $PYTHON mongodl.py --edition enterprise --version 7.0.1 --component archive-debug --test + fi + $PYTHON mongodl.py --edition enterprise --version 3.6 --component archive --test + $PYTHON mongodl.py --edition enterprise --version 4.0 --component archive --test + $PYTHON mongodl.py --edition enterprise --version 4.2 --component archive --test + $PYTHON mongodl.py --edition enterprise --version 4.4 --component archive --test + $PYTHON mongodl.py --edition enterprise --version 5.0 --component archive --test + $PYTHON mongodl.py --edition enterprise --version 6.0 --component crypt_shared --test + $PYTHON mongodl.py --edition enterprise --version 8.0 --component archive --test + $PYTHON mongodl.py --edition enterprise --version rapid --component archive --test + $PYTHON mongodl.py --edition enterprise --version latest --component archive --out $(pwd) + $PYTHON mongodl.py --edition enterprise --version v6.0-perf --component cryptd --test + $PYTHON mongodl.py --edition enterprise --version v8.0-perf --component cryptd --test + $PYTHON mongosh-dl.py --no-download + $PYTHON mongosh-dl.py --version 2.1.1 --out $(pwd) "teardown assets": - command: subprocess.exec @@ -1252,7 +1286,7 @@ axes: - id: amazon-2023-x64 display_name: "Amazon Linux 2023 x64" - run_on: amazon2023.3-small + run_on: amazon2023.0-small - id: macos-14-arm64 display_name: "macOS 14 arm64" diff --git a/.evergreen/mongosh-dl.py b/.evergreen/mongosh-dl.py index fc072173..69cb8e86 100644 --- a/.evergreen/mongosh-dl.py +++ b/.evergreen/mongosh-dl.py @@ -65,21 +65,14 @@ def _download(out_dir: Path, version: str, target: str, elif arch == "aarch64": arch = "arm64" if target == "linux": - suffix = '.tgz' - if sys.platform == 'linux' and arch in ["x64", "arm64"]: - openssl = subprocess.check_output(["openssl", "version"]) - if "3.0" in openssl.decode('utf-8'): - suffix = "-openssl3.tgz" - elif "1.1" in openssl.decode('utf-8'): - suffix = "-openssl11.tgz" + suffix = ".tgz" else: suffix = ".zip" dl_url = f"https://downloads.mongodb.com/compass/mongosh-{version}-{target}-{arch}{suffix}" - print(dl_url) if no_download: + print(dl_url) return ExpandResult.Okay - req = urllib.request.Request(dl_url) resp = urllib.request.urlopen(req) diff --git a/.evergreen/tests/test-mongodl.sh b/.evergreen/tests/test-mongodl.sh deleted file mode 100755 index 91e684a4..00000000 --- a/.evergreen/tests/test-mongodl.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/env bash - -# Test mongodl and mongosh-dl. -set -eux - -SCRIPT_DIR=$(dirname ${BASH_SOURCE[0]}) -. $SCRIPT_DIR/../handle-paths.sh - -pushd $SCRIPT_DIR/.. - -. find-python3.sh -PYTHON=$(ensure_python3) -echo "Using PYTHON: $PYTHON" -DOWNLOAD_DIR=mongodl_test - -if [ "${OS:-}" != "Windows_NT" ]; then - $PYTHON mongodl.py --edition enterprise --version 7.0 --component archive-debug --no-download -else - DOWNLOAD_DIR=$(cygpath -m $DOWNLOAD_DIR) -fi - -$PYTHON mongodl.py --edition enterprise --version 7.0 --component archive --test -$PYTHON mongodl.py --edition enterprise --version 7.0 --component cryptd --out ${DOWNLOAD_DIR} --strip-path-components 1 -$PYTHON mongosh-dl.py --no-download -$PYTHON mongosh-dl.py --version 2.1.1 --no-download - -export PATH="${DOWNLOAD_DIR}/bin:$PATH" -if [ "${OS:-}" != "Windows_NT" ]; then - $PYTHON mongosh-dl.py --version 2.1.1 --out ${DOWNLOAD_DIR} --strip-path-components 1 - chmod +x ./mongodl_test/bin/mongosh - ./mongodl_test/bin/mongosh --version -else - $PYTHON mongosh-dl.py --version 2.1.1 --out ${DOWNLOAD_DIR} --strip-path-components 1 -fi - -if [ ${1:-} == "partial" ]; then - popd - make -C ${DRIVERS_TOOLS} test - exit 0 -fi - -# Ensure that all distros are accounted for in DISTRO_ID_TO_TARGET -export VALIDATE_DISTROS=1 -$PYTHON mongodl.py --list -$PYTHON mongodl.py --edition enterprise --version 7.0.6 --component archive --no-download -$PYTHON mongodl.py --edition enterprise --version 3.6 --component archive --test -$PYTHON mongodl.py --edition enterprise --version 4.0 --component archive --test -$PYTHON mongodl.py --edition enterprise --version 4.2 --component archive --test -$PYTHON mongodl.py --edition enterprise --version 4.4 --component archive --test -$PYTHON mongodl.py --edition enterprise --version 5.0 --component archive --test -$PYTHON mongodl.py --edition enterprise --version 6.0 --component crypt_shared --test -$PYTHON mongodl.py --edition enterprise --version 8.0 --component archive --test -$PYTHON mongodl.py --edition enterprise --version rapid --component archive --test -$PYTHON mongodl.py --edition enterprise --version latest --component archive --out ${DOWNLOAD_DIR} -$PYTHON mongodl.py --edition enterprise --version v6.0-perf --component cryptd --test -$PYTHON mongodl.py --edition enterprise --version v8.0-perf --component cryptd --test - -popd -make -C ${DRIVERS_TOOLS} test