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

[Backport 2.x] Add download_chromium to integtest.sh for standalone chromium installation #1126

Merged
merged 1 commit into from
Feb 26, 2024
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
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
Loading