Skip to content

Commit 3aa5d83

Browse files
committed
[ci] Fail workflow if Node image failed to build
Signed-off-by: Viet Nguyen Duc <[email protected]>
1 parent 7cdcd1a commit 3aa5d83

File tree

9 files changed

+45
-13
lines changed

9 files changed

+45
-13
lines changed

.github/workflows/release-chrome-versions.yml

+1
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ jobs:
119119
retry_wait_seconds: 60
120120
command: |
121121
./tests/build-backward-compatible/bootstrap.sh ${GRID_VERSION} ${BROWSER_VERSION} ${BROWSER_NAME} ${REUSE_BASE}
122+
cat .env | xargs -I {} echo {} >> $GITHUB_ENV
122123
- name: Build Hub image for testing
123124
if: env.REUSE_BASE == 'false'
124125
run: make hub

.github/workflows/release-edge-versions.yml

+1
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ jobs:
119119
retry_wait_seconds: 60
120120
command: |
121121
./tests/build-backward-compatible/bootstrap.sh ${GRID_VERSION} ${BROWSER_VERSION} ${BROWSER_NAME} ${REUSE_BASE}
122+
cat .env | xargs -I {} echo {} >> $GITHUB_ENV
122123
- name: Build Hub image for testing
123124
if: env.REUSE_BASE == 'false'
124125
run: make hub

.github/workflows/release-firefox-versions.yml

+10-4
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ on:
3131
browser-versions:
3232
description: 'List browser version to build. E.g: [130, 131]'
3333
required: true
34-
default: '[97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134]'
34+
default: '[98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134]'
3535
push-image:
3636
description: 'Push image after testing successfully'
3737
required: true
@@ -119,13 +119,19 @@ jobs:
119119
retry_wait_seconds: 60
120120
command: |
121121
./tests/build-backward-compatible/bootstrap.sh ${GRID_VERSION} ${BROWSER_VERSION} ${BROWSER_NAME} ${REUSE_BASE}
122+
cat .env | xargs -I {} echo {} >> $GITHUB_ENV
122123
- name: Build Hub image for testing
123124
if: env.REUSE_BASE == 'false'
124125
run: make hub
125126
- name: Test images with Grid core ${{ env.GRID_VERSION }} and ${{ env.BROWSER_NAME }} v${{ env.BROWSER_VERSION }}
126-
run: |
127-
make test_firefox
128-
make test_firefox_standalone
127+
uses: nick-invision/retry@master
128+
with:
129+
timeout_minutes: 20
130+
max_attempts: 3
131+
retry_wait_seconds: 60
132+
command: |
133+
FIREFOX_VERSION=${FIREFOX_VERSION} make test_firefox
134+
FIREFOX_VERSION=${FIREFOX_VERSION} make test_firefox_standalone
129135
- name: Push images with Grid core ${{ env.GRID_VERSION }} and ${{ env.BROWSER_NAME }} v${{ env.BROWSER_VERSION }}
130136
if: env.PUSH_IMAGE == 'true'
131137
run: |

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@ test_edge_standalone:
664664
esac
665665

666666
test_firefox_download_lang_packs:
667-
FIREFOX_VERSION=$$(curl -sk https://product-details.mozilla.org/1.0/firefox_versions.json | jq -r '.LATEST_FIREFOX_VERSION') ; \
667+
FIREFOX_VERSION=$(or $(FIREFOX_VERSION), $$(curl -sk https://product-details.mozilla.org/1.0/firefox_versions.json | jq -r '.LATEST_FIREFOX_VERSION')) ; \
668668
./NodeFirefox/get_lang_package.sh $$FIREFOX_VERSION ./tests/target/firefox_lang_packs
669669

670670
test_firefox: test_firefox_download_lang_packs

NodeFirefox/Dockerfile

+5-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ RUN apt-get update -qqy && \
3030
ln -fs $(which firefox$FIREFOX_VERSION) /usr/bin/firefox ; \
3131
fi ; \
3232
else \
33-
FIREFOX_DOWNLOAD_URL="https://download-installer.cdn.mozilla.net/pub/firefox/releases/$FIREFOX_VERSION/linux-x86_64/en-US/firefox-$FIREFOX_VERSION.deb" ; \
33+
FIREFOX_DOWNLOAD_URL="https://download-installer.cdn.mozilla.net/pub/firefox/releases/$FIREFOX_VERSION/linux-x86_64/en-US/firefox-$FIREFOX_VERSION.deb" \
34+
&& if [ "404" = "$(curl -s -o /dev/null -w "%{http_code}" $FIREFOX_DOWNLOAD_URL)" ]; then \
35+
FIREFOX_DOWNLOAD_URL="https://download-installer.cdn.mozilla.net/pub/firefox/releases/$FIREFOX_VERSION/linux-x86_64/en-US/firefox-$FIREFOX_VERSION.tar.bz2" ; \
36+
fi ; \
3437
fi \
3538
else \
3639
if [ ${FIREFOX_VERSION} = "latest" ] && [ ${FIREFOX_DOWNLOAD_URL} = "" ]; then \
@@ -52,7 +55,7 @@ RUN apt-get update -qqy && \
5255
/opt/bin/install-firefox-package.sh "${FIREFOX_DOWNLOAD_URL}" "${FIREFOX_VERSION}" ; \
5356
fi \
5457
# Download the language pack for Firefox
55-
&& /opt/bin/get_lang_package.sh \
58+
&& /opt/bin/get_lang_package.sh ${FIREFOX_VERSION} \
5659
# Do one more upgrade to fix possible CVEs from Firefox dependencies
5760
&& apt-get update -qqy \
5861
&& apt-get upgrade -yq \

NodeFirefox/get_lang_package.sh

+4
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ trap on_exit EXIT ERR
1313
VERSION=${1:-$(curl -sk https://product-details.mozilla.org/1.0/firefox_versions.json | jq -r '.LATEST_FIREFOX_VERSION')}
1414
TARGET_DIR="${2:-$(dirname $(readlink -f $(which firefox)))/distribution/extensions}"
1515
BASE_URL="https://ftp.mozilla.org/pub/firefox/releases/$VERSION/linux-x86_64/xpi/"
16+
if [ "404" = "$(curl -s -o /dev/null -w "%{http_code}" ${BASE_URL})" ]; then
17+
VERSION="$(curl -sk https://product-details.mozilla.org/1.0/firefox_versions.json | jq -r '.LATEST_FIREFOX_VERSION')"
18+
BASE_URL="https://ftp.mozilla.org/pub/firefox/releases/$VERSION/linux-x86_64/xpi/"
19+
fi
1620

1721
# Create target directory if it doesn't exist
1822
mkdir -p "${TARGET_DIR}"

tests/SeleniumTests/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,10 @@ def test_visit_basic_auth_secured_page(self):
101101

102102
def test_play_video(self):
103103
driver = self.driver
104-
driver.get('https://docs.flowplayer.com/tools/stream-tester')
104+
driver.get('https://googleads.github.io/googleads-ima-html5/vsi/')
105105
wait = WebDriverWait(driver, WEB_DRIVER_WAIT_TIMEOUT)
106106
play_button = wait.until(
107-
EC.element_to_be_clickable((By.TAG_NAME, 'flowplayer-play-icon'))
107+
EC.element_to_be_clickable((By.ID, 'play-button'))
108108
)
109109
play_button.click()
110110
video = driver.find_element(By.TAG_NAME, 'video')

tests/build-backward-compatible/bootstrap.sh

+19-4
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,14 @@ for CDP_VERSION in "${VERSION_LIST[@]}"; do
3131
if [ -n "${FIREFOX_VERSION}" ]; then
3232
BUILD_ARGS="--build-arg FIREFOX_VERSION=${FIREFOX_VERSION} --build-arg FIREFOX_DOWNLOAD_URL=${FIREFOX_DOWNLOAD_URL}"
3333
if [ "${REUSE_BASE}" = "true" ]; then
34-
BUILD_ARGS="${BUILD_ARGS}" make firefox_only standalone_firefox_only
34+
BUILD_ARGS="${BUILD_ARGS}" PLATFORMS=${PLATFORMS} make firefox_only
35+
if [ $? -ne 0 ]; then
36+
echo "Error building Node image"
37+
exit 1
38+
fi
39+
BUILD_ARGS="${BUILD_ARGS}" PLATFORMS=${PLATFORMS} make standalone_firefox_only
3540
else
36-
BUILD_ARGS="${BUILD_ARGS}" make standalone_firefox
41+
BUILD_ARGS="${BUILD_ARGS}" PLATFORMS=${PLATFORMS} make standalone_firefox
3742
fi
3843
else
3944
echo "Firefox version not found in matrix for input ${CDP_VERSION}"
@@ -44,7 +49,12 @@ for CDP_VERSION in "${VERSION_LIST[@]}"; do
4449
if [ -n "${EDGE_VERSION}" ]; then
4550
BUILD_ARGS="--build-arg EDGE_VERSION=${EDGE_VERSION}"
4651
if [ "${REUSE_BASE}" = "true" ]; then
47-
BUILD_ARGS="${BUILD_ARGS}" make edge_only standalone_edge_only
52+
BUILD_ARGS="${BUILD_ARGS}" make edge_only
53+
if [ $? -ne 0 ]; then
54+
echo "Error building Node image"
55+
exit 1
56+
fi
57+
BUILD_ARGS="${BUILD_ARGS}" make standalone_edge_only
4858
else
4959
BUILD_ARGS="${BUILD_ARGS}" make standalone_edge
5060
fi
@@ -57,7 +67,12 @@ for CDP_VERSION in "${VERSION_LIST[@]}"; do
5767
if [ -n "${CHROME_VERSION}" ]; then
5868
BUILD_ARGS="--build-arg CHROME_VERSION=${CHROME_VERSION}"
5969
if [ "${REUSE_BASE}" = "true" ]; then
60-
BUILD_ARGS="${BUILD_ARGS}" make chrome_only standalone_chrome_only
70+
BUILD_ARGS="${BUILD_ARGS}" make chrome_only
71+
if [ $? -ne 0 ]; then
72+
echo "Error building Node image"
73+
exit 1
74+
fi
75+
BUILD_ARGS="${BUILD_ARGS}" make standalone_chrome_only
6176
else
6277
BUILD_ARGS="${BUILD_ARGS}" make standalone_chrome
6378
fi

tests/build-backward-compatible/builder.py

+2
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ def recursive_merge(dict1, dict2):
5050
if "FIREFOX_PLATFORMS" in matrix["CDP"][cdp_version]:
5151
FIREFOX_PLATFORMS = matrix["CDP"][cdp_version]["FIREFOX_PLATFORMS"]
5252
f.write(f"PLATFORMS={FIREFOX_PLATFORMS}\n")
53+
else:
54+
f.write(f"PLATFORMS=linux/amd64\n")
5355
if browser_name == "edge" or browser_name == "all":
5456
EDGE_VERSION = matrix["CDP"][cdp_version]["EDGE_VERSION"]
5557
f.write(f"EDGE_VERSION={EDGE_VERSION}\n")

0 commit comments

Comments
 (0)