Skip to content
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
2 changes: 1 addition & 1 deletion e2e-tests/.ci/.e2erc
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ case $MME2E_OSTYPE in
export IS_LINUX="-linux"
;;
darwin )
export BROWSER_DEFAULT="electron"
export BROWSER_DEFAULT="chrome"
export IS_LINUX=""
;;
* )
Expand Down
11 changes: 8 additions & 3 deletions e2e-tests/.ci/server.generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ $(if mme2e_is_token_in_list "cypress" "$ENABLED_DOCKER_SERVICES"; then
echo '
cypress:
image: "cypress/browsers:node-24.14.0-chrome-145.0.7632.116-1-ff-148.0-edge-145.0.3800.70-1"
platform: linux/amd64
entrypoint: ["/bin/bash", "-c"]
command: ["until [ -f /var/run/mm_terminate ]; do sleep 5; done"]
env_file:
Expand All @@ -254,16 +255,20 @@ $(if mme2e_is_token_in_list "cypress" "$ENABLED_DOCKER_SERVICES"; then
# avoid too many progress messages
# https://github.com/cypress-io/cypress/issues/1243
CI: "1"
# Use /tmp for Cypress cache and config so any UID can write without permission issues
CYPRESS_CACHE_FOLDER: /tmp/cypress-cache
XDG_CONFIG_HOME: /tmp/xdg-config
# Ensure we are independent from the global node environment
PATH: /cypress/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PATH: /e2e-tests/cypress/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
ulimits:
nofile:
soft: 8096
hard: 1048576
working_dir: /cypress
working_dir: /e2e-tests/cypress
network_mode: host
volumes:
- "../../e2e-tests/cypress/:/cypress"'
- "../../e2e-tests/cypress/:/e2e-tests/cypress"
- "../../webapp/platform/eslint-plugin/:/webapp/platform/eslint-plugin"'
fi)

$(if mme2e_is_token_in_list "webhook-interactions" "$ENABLED_DOCKER_SERVICES"; then
Expand Down
19 changes: 16 additions & 3 deletions e2e-tests/.ci/server.run_cypress.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,26 @@ firefox: $(firefox --version || true)
INNEREOF
EOF

mme2e_log "Prepare Cypress: ensure container user entry exists for UID $MME2E_UID"
${MME2E_DC_SERVER} exec -T -- cypress bash <<EOF
getent passwd $MME2E_UID >/dev/null 2>&1 || \
useradd --uid $MME2E_UID --gid 0 --home /root --no-create-home --shell /bin/bash mme2euser 2>/dev/null || true
EOF

mme2e_log "Prepare Cypress: install dependencies"
${MME2E_DC_SERVER} exec -T -u "$MME2E_UID" -- cypress bash <<EOF
cd webapp/
npm install --cache /tmp/empty-cache
cd ../e2e-tests/cypress
npm install --cache /tmp/empty-cache
EOF
# cypress install verifies the Electron binary, which needs a display and dbus session.
# Use xvfb-run and dbus-run-session for the headless virtual display and bus.
${MME2E_DC_SERVER} exec -T -u "$MME2E_UID" -- cypress bash <<'EOF'
set -euo pipefail
Xvfb :99 -screen 0 1280x1024x24 -nolisten tcp &
XVFB_PID=$!
trap 'kill "$XVFB_PID" 2>/dev/null || true' EXIT
sleep 1
DISPLAY=:99 dbus-run-session -- cypress install
EOF

# Initialize cypress report directory
mme2e_log "Prepare Cypress: clean and initialize report and logs directory"
Expand Down
Loading
Loading