Skip to content

Commit 67fa967

Browse files
Use @puppeteer/browsers to lock chromium version to 112 (opensearch-project#1123) (opensearch-project#1126)
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 <zhujiaxi@amazon.com> (cherry picked from commit 463125a) Co-authored-by: Peter Zhu <zhujiaxi@amazon.com>
1 parent 76e0d16 commit 67fa967

File tree

2 files changed

+60
-1
lines changed

2 files changed

+60
-1
lines changed

browser_downloader.sh

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
BROWSER_DIR=`dirname $(realpath $0)` && cd $BROWSER_DIR
6+
7+
function download_chromium {
8+
9+
# Set defaults
10+
arch="x64"
11+
os="linux"
12+
chromium_version="112"
13+
chromium_binary="chrome"
14+
ARCHTYPE=`uname -m`
15+
force=$1
16+
17+
# Architecture
18+
if [ "$ARCHTYPE" = "aarch64" ] || [ "$ARCHTYPE" = "arm64" ]; then
19+
arch="arm64"
20+
fi
21+
22+
# Platform
23+
if (echo "$OSTYPE" | grep -qi darwin); then
24+
os="mac"
25+
chromium_binary="Chromium.app/Contents/MacOS/Chromium"
26+
elif [ "$OSTYPE" = "msys" ] || [ "$OSTYPE" = "cygwin" ] || [ "$OSTYPE" = "win32" ]; then
27+
os="win"
28+
chromium_binary="chrome.exe"
29+
BROWSER_DIR=`pwd -W`
30+
fi
31+
32+
# Variables
33+
artifact="chromium-$os-$arch.zip"
34+
chromium_url="https://ci.opensearch.org/ci/dbc/tools/chromium/$chromium_version/zip/$artifact"
35+
chromium_path="$BROWSER_DIR/chromium/chrome-$os/$chromium_binary"
36+
37+
# Get artifact
38+
if [ "$force" = "true" ] || [ ! -f "$chromium_path" ]; then
39+
rm -rf chromium
40+
mkdir -p chromium
41+
cd chromium
42+
curl -sSLO $chromium_url
43+
unzip -qq $artifact
44+
rm $artifact
45+
fi
46+
47+
echo "$chromium_path chromium-$chromium_version os-$os arch-$arch"
48+
49+
# Verify binary
50+
if [ "$os" = "win" ]; then
51+
powershell -command "(Get-Item $chromium_path)".VersionInfo
52+
else
53+
$chromium_path --version
54+
fi
55+
}

integtest.sh

100644100755
+5-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
set -e
44

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

105109
. ./test_finder.sh

0 commit comments

Comments
 (0)