Skip to content

Commit

Permalink
Use @puppeteer/browsers to lock chromium version to 112 (#1123) (#1127)
Browse files Browse the repository at this point in the history
Update scripts

Add browser_downloader.sh independent of runtime env for cypress tests

Add more

Add more

Add more

Add download_chromium to integtest.sh for standalone chromium installation

Add more

Signed-off-by: Peter Zhu <[email protected]>
(cherry picked from commit 463125a)

Co-authored-by: Peter Zhu <[email protected]>
  • Loading branch information
1 parent f92d151 commit 7fbb1da
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 1 deletion.
55 changes: 55 additions & 0 deletions browser_downloader.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/bin/bash

set -e

BROWSER_DIR=`dirname $(realpath $0)` && cd $BROWSER_DIR

function download_chromium {

# Set defaults
arch="x64"
os="linux"
chromium_version="112"
chromium_binary="chrome"
ARCHTYPE=`uname -m`
force=$1

# Architecture
if [ "$ARCHTYPE" = "aarch64" ] || [ "$ARCHTYPE" = "arm64" ]; then
arch="arm64"
fi

# Platform
if (echo "$OSTYPE" | grep -qi darwin); then
os="mac"
chromium_binary="Chromium.app/Contents/MacOS/Chromium"
elif [ "$OSTYPE" = "msys" ] || [ "$OSTYPE" = "cygwin" ] || [ "$OSTYPE" = "win32" ]; then
os="win"
chromium_binary="chrome.exe"
BROWSER_DIR=`pwd -W`
fi

# Variables
artifact="chromium-$os-$arch.zip"
chromium_url="https://ci.opensearch.org/ci/dbc/tools/chromium/$chromium_version/zip/$artifact"
chromium_path="$BROWSER_DIR/chromium/chrome-$os/$chromium_binary"

# Get artifact
if [ "$force" = "true" ] || [ ! -f "$chromium_path" ]; then
rm -rf chromium
mkdir -p chromium
cd chromium
curl -sSLO $chromium_url
unzip -qq $artifact
rm $artifact
fi

echo "$chromium_path chromium-$chromium_version os-$os arch-$arch"

# Verify binary
if [ "$os" = "win" ]; then
powershell -command "(Get-Item $chromium_path)".VersionInfo
else
$chromium_path --version
fi
}
6 changes: 5 additions & 1 deletion integtest.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

set -e

. ./browser_downloader.sh

function usage() {
echo ""
echo "This script is used to run integration tests for plugin installed on a remote OpenSearch/Dashboards cluster."
Expand Down Expand Up @@ -99,7 +101,9 @@ PASSWORD=`echo $CREDENTIAL | awk -F ':' '{print $2}'`
# User can send custom browser path through env variable
if [ -z "$BROWSER_PATH" ]
then
BROWSER_PATH="chromium"
# chromium@1108766 is version 112 with revision r1108766
# Please keep this version until cypress upgrade or test will freeze: https://github.com/opensearch-project/opensearch-build/issues/4241
BROWSER_PATH=`download_chromium | head -n 1 | cut -d ' ' -f1`
fi

. ./test_finder.sh
Expand Down

0 comments on commit 7fbb1da

Please sign in to comment.