Compare commits
29
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
63bff8a86d
|
||
|
|
f304afb0be | ||
|
|
f76b9f7a7c | ||
|
|
fdf62a2f5a | ||
|
|
94341ef481 | ||
|
|
2debeada5d | ||
|
|
6febeff590 | ||
|
|
8b58a45f35 | ||
|
|
fbe36d683d | ||
|
|
bd5ee3bec5 | ||
|
|
d4d6e97df0 | ||
|
|
c288a8864f | ||
|
|
9906c8f120 | ||
|
|
4dcf2c1891 | ||
|
|
cc30f599e6 | ||
|
|
05a2a5217a | ||
|
|
7d73ac90b6 | ||
|
|
edc1365ac9 | ||
|
|
0f33ddadf8 | ||
|
|
5e9bbb54ec | ||
|
|
5bcec90e33 | ||
|
|
a50b07d927 | ||
|
|
6318d90e96 | ||
|
|
a6fea661ff | ||
|
|
2894bae29a | ||
|
|
a14e8f9b24 | ||
|
|
83611872a3 | ||
|
|
30c4e0e85c | ||
|
|
f429d9f3c4 |
No files matched your search
@@ -85,8 +85,6 @@ jobs:
|
||||
bash tests/test_maven_ci_cache.sh
|
||||
bash tests/test_maven_test_results.sh
|
||||
bash tests/test_maven_ci_install.sh
|
||||
bash tests/test_browser_install.sh
|
||||
bash tests/test_frontend_build_reuse.sh
|
||||
bash tests/test_snapshot_refresh.sh
|
||||
bash tests/test_maven_settings_output.sh
|
||||
# Create jobs to test the commands of your orbs.
|
||||
|
||||
@@ -10,11 +10,6 @@ description: >
|
||||
- Collects JUnit XML test results
|
||||
- Stores test results and screenshots
|
||||
- Saves Maven cache for future builds
|
||||
parameters:
|
||||
build_before_test:
|
||||
type: boolean
|
||||
default: true
|
||||
description: "Build the React app first; combined jobs already build it with frontend_build"
|
||||
steps:
|
||||
# Ensure no stale Chrome/Driver is shadowing the PATH (your base image had Chrome 109)
|
||||
- run:
|
||||
@@ -22,7 +17,7 @@ steps:
|
||||
command: <<include(scripts/frontend_test_cleanup.sh)>>
|
||||
|
||||
# Install current Chrome; DO NOT install chromedriver (let Selenium 4 auto-manage it)
|
||||
- install_chrome
|
||||
- browser-tools/install-chrome
|
||||
|
||||
# System libs Chrome needs in headless CI
|
||||
- run:
|
||||
@@ -57,8 +52,6 @@ steps:
|
||||
# GPG signing will happen later in mvn_jar_deploy when deploying to Maven Central.
|
||||
- run:
|
||||
name: Build app, start server, run tests
|
||||
environment:
|
||||
PARAM_BUILD_BEFORE_TEST: << parameters.build_before_test >>
|
||||
command: <<include(scripts/frontend_test_run.sh)>>
|
||||
|
||||
# Always collect and publish test results & screenshots
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
description: Install stable Chrome using only its signed repository and existing Ubuntu dependency indexes.
|
||||
steps:
|
||||
- run:
|
||||
name: Install Google Chrome
|
||||
command: <<include(scripts/install_chrome.sh)>>
|
||||
@@ -21,7 +21,7 @@ steps:
|
||||
- when:
|
||||
condition: << parameters.install_browsers >>
|
||||
steps:
|
||||
- install_chrome
|
||||
- browser-tools/install-chrome
|
||||
- browser-tools/install-chromedriver
|
||||
- when:
|
||||
condition: << parameters.compile_before_verify >>
|
||||
|
||||
@@ -27,8 +27,7 @@ steps:
|
||||
- git_full_checkout
|
||||
- mvn_manage_version
|
||||
- frontend_build
|
||||
- frontend_test:
|
||||
build_before_test: false
|
||||
- frontend_test
|
||||
- frontend_package
|
||||
- mvn_jar_deploy
|
||||
- git_operations:
|
||||
|
||||
@@ -23,5 +23,4 @@ steps:
|
||||
node_version: << parameters.node_version >>
|
||||
- git_full_checkout
|
||||
- frontend_build
|
||||
- frontend_test:
|
||||
build_before_test: false
|
||||
- frontend_test
|
||||
@@ -11,20 +11,10 @@
|
||||
## Output: Installs required system libraries
|
||||
############################################################################
|
||||
|
||||
set -euo pipefail
|
||||
set -e
|
||||
|
||||
echo "Installing browser dependencies"
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
ubuntu_sources=/etc/apt/sources.list
|
||||
if [[ ! -s "$ubuntu_sources" ]]; then
|
||||
ubuntu_sources=/etc/apt/sources.list.d/ubuntu.sources
|
||||
fi
|
||||
if [[ ! -s "$ubuntu_sources" ]]; then
|
||||
echo 'Cannot locate Ubuntu package sources' >&2
|
||||
exit 1
|
||||
fi
|
||||
sudo env DEBIAN_FRONTEND=noninteractive NEEDRESTART_MODE=l apt-get update \
|
||||
-o "Dir::Etc::sourcelist=$ubuntu_sources" \
|
||||
-o Dir::Etc::sourceparts=- -o APT::Get::List-Cleanup=0
|
||||
sudo apt-get update
|
||||
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y \
|
||||
libnss3-dev libgdk-pixbuf2.0-dev libgtk-3-dev libxss-dev
|
||||
@@ -15,9 +15,7 @@ set -e
|
||||
|
||||
echo "Building app, starting server, running tests"
|
||||
echo "HTTPS=true" >> ./.env
|
||||
if [[ "${PARAM_BUILD_BEFORE_TEST:-true}" == true ]]; then
|
||||
npm run build
|
||||
fi
|
||||
npm run build
|
||||
export REACT_APP_PROXY_LOCALHOST_PORT=8001
|
||||
export PORT=3001
|
||||
npm run start &
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
# Machine executors are Ubuntu amd64. Preserve an existing browser for Maven
|
||||
# consumers; frontend_test deliberately removes its stale browser beforehand.
|
||||
if command -v google-chrome >/dev/null 2>&1; then
|
||||
google-chrome --version
|
||||
exit 0
|
||||
fi
|
||||
architecture=$(dpkg --print-architecture)
|
||||
if [[ "$architecture" != amd64 ]]; then
|
||||
echo "Google Chrome requires an amd64 machine executor" >&2
|
||||
exit 1
|
||||
fi
|
||||
curl --fail --silent --show-error --location https://dl.google.com/linux/linux_signing_key.pub \
|
||||
| sudo gpg --batch --yes --dearmor -o /usr/share/keyrings/qqq-google-chrome.gpg
|
||||
printf '%s\n' 'deb [arch=amd64 signed-by=/usr/share/keyrings/qqq-google-chrome.gpg] https://dl.google.com/linux/chrome/deb/ stable main' \
|
||||
| sudo tee /etc/apt/sources.list.d/qqq-google-chrome.list >/dev/null
|
||||
# Ubuntu dependency indexes were refreshed by install_java. Only the newly added
|
||||
# signed Google repository needs refreshing; image PPAs are unrelated to Chrome.
|
||||
sudo env DEBIAN_FRONTEND=noninteractive NEEDRESTART_MODE=l apt-get update \
|
||||
-o Dir::Etc::sourcelist=/etc/apt/sources.list.d/qqq-google-chrome.list \
|
||||
-o Dir::Etc::sourceparts=- -o APT::Get::List-Cleanup=0
|
||||
sudo env DEBIAN_FRONTEND=noninteractive NEEDRESTART_MODE=l apt-get install -y google-chrome-stable
|
||||
google-chrome --version
|
||||
@@ -1,69 +0,0 @@
|
||||
#!/bin/bash
|
||||
# Exercise real browser scripts without sudo, package installation or network.
|
||||
set -euo pipefail
|
||||
root=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
|
||||
scratch=$(mktemp -d)
|
||||
trap 'rm -rf "$scratch"' EXIT
|
||||
mkdir "$scratch/bin"
|
||||
export INSTALL_LOG="$scratch/install.log"
|
||||
cat > "$scratch/bin/sudo" <<'STUB'
|
||||
#!/bin/bash
|
||||
printf '%s\n' "$*" >> "$INSTALL_LOG"
|
||||
if [[ "$*" == *'apt-get update'* ]]; then
|
||||
[[ "$*" == *'Dir::Etc::sourceparts=-'* ]] || { echo 'unrelated image PPA: 503' >&2; exit 100; }
|
||||
[[ "$*" == *'APT::Get::List-Cleanup=0'* ]] || exit 91
|
||||
[[ ${REQUIRED_REPO_FAIL:-0} == 0 ]] || exit 100
|
||||
fi
|
||||
if [[ "$1" == tee ]]; then cat >> "$INSTALL_LOG"; fi
|
||||
if [[ "$1" == gpg ]]; then cat >/dev/null; fi
|
||||
STUB
|
||||
chmod +x "$scratch/bin/sudo"
|
||||
export PATH="$scratch/bin:$PATH"
|
||||
bash "$root/src/scripts/frontend_test_dependencies.sh"
|
||||
echo 'PASS: browser dependencies ignore unavailable image PPAs'
|
||||
# Model Chrome presence without depending on the host's installed browsers.
|
||||
export CHROME_MARKER="$scratch/chrome-installed"
|
||||
export BASH_ENV="$scratch/shell-env"
|
||||
cat > "$BASH_ENV" <<'STUB'
|
||||
command() {
|
||||
if [[ "$*" == '-v google-chrome' ]]; then [[ -f "$CHROME_MARKER" ]]; else builtin command "$@"; fi
|
||||
}
|
||||
google-chrome() { [[ -f "$CHROME_MARKER" ]] && echo 'Google Chrome test'; }
|
||||
STUB
|
||||
cat > "$scratch/bin/curl" <<'STUB'
|
||||
#!/bin/bash
|
||||
printf '%s\n' "$*" >> "$INSTALL_LOG"
|
||||
[[ ${KEY_FAIL:-0} == 0 ]] || exit 22
|
||||
printf 'signing-key\n'
|
||||
STUB
|
||||
cat > "$scratch/bin/dpkg" <<'STUB'
|
||||
#!/bin/bash
|
||||
echo amd64
|
||||
STUB
|
||||
# Successful installation makes Chrome available to the final version check.
|
||||
# shellcheck disable=SC2016
|
||||
sed -i '/if \[\[ "$1" == tee/i if [[ "$*" == *"apt-get install -y google-chrome-stable"* ]]; then touch "$CHROME_MARKER"; fi' "$scratch/bin/sudo"
|
||||
chmod +x "$scratch/bin/"*
|
||||
: > "$INSTALL_LOG"
|
||||
bash "$root/src/scripts/install_chrome.sh" >/dev/null
|
||||
grep -q 'Dir::Etc::sourcelist=/etc/apt/sources.list.d/qqq-google-chrome.list' "$INSTALL_LOG"
|
||||
grep -q 'gpg --batch --yes --dearmor -o /usr/share/keyrings/qqq-google-chrome.gpg' "$INSTALL_LOG"
|
||||
grep -q 'signed-by=/usr/share/keyrings/qqq-google-chrome.gpg] https://dl.google.com/linux/chrome/deb/' "$INSTALL_LOG"
|
||||
grep -q 'apt-get install -y google-chrome-stable' "$INSTALL_LOG"
|
||||
: > "$INSTALL_LOG"
|
||||
bash "$root/src/scripts/install_chrome.sh" >/dev/null
|
||||
[[ ! -s "$INSTALL_LOG" ]] # Existing Chrome needs no network/package work.
|
||||
rm "$CHROME_MARKER"
|
||||
for script in install_chrome frontend_test_dependencies; do
|
||||
: > "$INSTALL_LOG"
|
||||
if REQUIRED_REPO_FAIL=1 bash "$root/src/scripts/$script.sh" >/dev/null 2>&1; then
|
||||
echo "Required repository outage accepted: $script" >&2; exit 1
|
||||
fi
|
||||
if grep -q 'apt-get install' "$INSTALL_LOG"; then exit 1; fi
|
||||
done
|
||||
: > "$INSTALL_LOG"
|
||||
if KEY_FAIL=1 bash "$root/src/scripts/install_chrome.sh" >/dev/null 2>&1; then
|
||||
echo 'Signing key failure accepted' >&2; exit 1
|
||||
fi
|
||||
if grep -q 'apt-get' "$INSTALL_LOG"; then exit 1; fi
|
||||
echo 'PASS: Chrome ignores unrelated PPAs; required repositories and signing key fail closed; existing browser reused'
|
||||
@@ -1,37 +0,0 @@
|
||||
#!/bin/bash
|
||||
# Exercise the actual test runner with no server, browser, network or Maven work.
|
||||
set -euo pipefail
|
||||
root=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
|
||||
scratch=$(mktemp -d)
|
||||
trap 'rm -rf "$scratch"' EXIT
|
||||
mkdir "$scratch/bin"
|
||||
export RUN_LOG="$scratch/calls"
|
||||
cat > "$scratch/bin/npm" <<'STUB'
|
||||
#!/bin/bash
|
||||
printf 'npm %s\n' "$*" >> "$RUN_LOG"
|
||||
if [[ "$*" == 'run build' && ${BUILD_FAIL:-0} == 1 ]]; then exit 12; fi
|
||||
STUB
|
||||
for tool in mvn dockerize; do
|
||||
# shellcheck disable=SC2016
|
||||
printf '#!/bin/bash\nprintf "%s %%s\\n" "$*" >> "$RUN_LOG"\n' "$tool" > "$scratch/bin/$tool"
|
||||
done
|
||||
chmod +x "$scratch/bin/"*
|
||||
export PATH="$scratch/bin:$PATH"
|
||||
cd "$scratch"
|
||||
PARAM_BUILD_BEFORE_TEST=false bash "$root/src/scripts/frontend_test_run.sh" >/dev/null
|
||||
if grep -qx 'npm run build' "$RUN_LOG"; then
|
||||
echo 'FAIL: combined job rebuilt the already-built React app' >&2; exit 1
|
||||
fi
|
||||
grep -q '^mvn .* -B test$' "$RUN_LOG"
|
||||
echo 'PASS: combined job retains tests without a duplicate build'
|
||||
|
||||
: > "$RUN_LOG"
|
||||
bash "$root/src/scripts/frontend_test_run.sh" >/dev/null
|
||||
grep -qx 'npm run build' "$RUN_LOG"
|
||||
grep -q '^mvn .* -B test$' "$RUN_LOG"
|
||||
: > "$RUN_LOG"
|
||||
if BUILD_FAIL=1 bash "$root/src/scripts/frontend_test_run.sh" >/dev/null 2>&1; then
|
||||
echo 'FAIL: required standalone build failure ignored' >&2; exit 1
|
||||
fi
|
||||
if grep -q '^mvn ' "$RUN_LOG"; then exit 1; fi
|
||||
echo 'PASS: standalone command still builds and fails before tests when its build fails'
|
||||
Reference in new issue
Block a user