Files
Jonathan Lennox a19f89487f feat(tests): port malleus, the load tester, from jitsi-meet-torture (#17846)
* refactor(tests): share the grid setup and room name assembly

Factor the Selenium Grid handling out of wdio.grid.conf.ts into helpers/grid.ts so
that the Firefox grid config and other configs can reuse it (the Firefox one was
missing the remote fake-audio path rewrite), split generateRoomName into a
buildRoomName helper that applies the prefix/suffix convention to any base name,
and export the shared Chrome settings from wdio.conf.ts.

* feat(tests): let Participant drive any session and the load-test client

Participant names are no longer limited to p1..p6 and a browser session can be
injected instead of being looked up on the multiremote object, so participants can
be created for sessions (or tabs) outside the fixed multiremote setup. A loadTest
flag skips the UI-only parts of joining and hanging up (prejoin, styling, dialog
checks, toolbar hangup) for the lib-jitsi-meet only load-test client, which exposes
the conference as APP.room. Existing tests are unaffected.

* feat(load-test): bring the load-test client into the repository

The lib-jitsi-meet only client used for load testing lived in
jitsi/jitsi-meet-load-test since it was split out in 0b57bcb20. Port it back as
TypeScript, reusing the URL helpers it had copied, so the load tester (malleus)
can build and inject it into the browsers it drives. It is a separate webpack
entry (`npm run build:load-test`, config name load-test) written to build/ and is
deliberately not deployed: it is not in the Makefile or the Debian install.

Changes from the original: the room can be given as a room hash parameter and
protocol-relative XMPP URLs are absolutized (the page runs from file://), the
bare `room` references in getConnectionState and the stage view participant
selection are fixed, and jQuery/lodash are dropped in favor of DOM APIs.

* feat(tests): port malleus, the load tester, from jitsi-meet-torture

Malleus Jitsificus fills conferences on a deployment with browser-driven
participants and reports whether they all made it. It reuses the WebdriverIO suite
(Chrome setup, grid support, Participant, browser logs) but runs through its own
wdio config, which generates one browser session per participant (or per group of
tabs) from the MALLEUS_* settings, and a single spec kept out of specs/.

Ported: conferences x participants with video/audio sender counts, staggered
joins, duration, regions, extra URL params, stage view, P2P toggle, JWT; load-test
mode with several clients per tab and several tabs per browser; lite mode; P.59
speaker switching; bridge disruption via a site-specific blip script with health
checks; requesting typed grid nodes (nodename:applicationName) for senders and
receivers. The script that re-typed Grid 3 nodes over SSH is not carried over: it
does not apply to a Selenium 4 grid, where the node stereotypes declare the types.

Differences from the Java version: the entry point is a Node CLI
(`npm run malleus -- --flag=value`, scripts/malleus.sh forwards to it, the
positional form is gone); the load-test client is uploaded into the browsers
together with resources/loadTest.html rather than served by the deployment; room
names are prefix, conference index, suffix, reusing ROOM_NAME_SUFFIX (which may be
a comma-separated list spread over the conferences) so a shard name at the end of
the name keeps working; tabs per browser require load-test mode.

* fix(load-test): match jitsi-meet's current receiver constraints

The client's emulation of the receiver video constraints had drifted from what
jitsi-meet sends (react/features/video-quality/subscriber.ts):

- It set one maxHeight in defaultConstraints, i.e. for every source in the
  conference, where jitsi-meet sets defaultConstraints to 0 and constrains only
  the sources visible in the filmstrip (one page of tiles, 25 by default). In
  large conferences that made a load-test receiver ask for every video.
- The tile quality came from a participant-count table (720/360/180); jitsi-meet
  derives it from the tile height for the window size, capped at 360 beyond
  maxFullResolutionParticipants. Port the tile grid selection
  (calculateResponsiveTileViewDimensions) for a configurable virtual window,
  1280x1024 by default like the test suite's Chrome.
- Stage view asked 2160 from everyone; it now asks the large-video quality for
  the on-stage source and 180 for the first filmstrip page, like jitsi-meet.
- lastN still applied lastNLimits, which jitsi-meet dropped in 6efa4f247; send
  startLastN ?? channelLastN ?? -1 instead.
- Stage view is also used below 3 participants, as in jitsi-meet, the on-stage
  participant is re-elected when they leave, and no constraints are sent while
  leaving.
2026-09-18 10:58:08 -04:00

130 lines
5.2 KiB
Plaintext

# Note: any setting below that takes a file path (EXPECTATIONS, JAAS_PRIVATE_KEY_PATH,
# JWT_PRIVATE_KEY_PATH, VIDEO_CAPTURE_FILE) is resolved relative to the current working directory
# at run time, not relative to this file. A relative path only works for whichever way you launch
# the tests: `npm test` from the repo root resolves it against the repo root, while
# `cd tests && npm install && npm run test-grid` resolves it against tests/ instead - use an
# absolute path if you want it to work the same way from both.
# Ignore certificate errors (self-signed certificates)
#ALLOW_INSECURE_CERTS=true
# The base url that will be used for the test (default will be using "https://alpha.jitsi.net")
# If there is a tenant in the URL it must end with a slash (e.g. "https://alpha.jitsi.net/sometenant/")
#BASE_URL=
# Whether to use beta for the first participants
#BROWSER_CHROME_BETA=false
#BROWSER_FF_BETA=false
# A rest URL to be used by dial-in tests to invite jigasi to the conference
#DIAL_IN_REST_URL=
# A destination number to dialout, that auto answers and sends media
#DIAL_OUT_URL=
# Path to a JSON file with test expectation overrides for the environment (see tests/helpers/expectations.ts
# for the supported options and defaults). Silently ignored (falls back to the defaults, logging an error) if
# the path doesn't resolve - see the file-path note at the top of this file.
#EXPECTATIONS=tests/expectations.json
# The grid host url (https://mygrid.com/wd/hub)
#GRID_HOST_URL=
# Whether to run the browser in headless mode
#HEADLESS=false
# The tenant used when executing the iframeAPI tests, will override any tenant from BASE_URL if any
#IFRAME_TENANT=
# Configure properties for jaas-specific tests (specs/jaas). Note that some of the iFrame tests can also
# be used to test JaaS, they are configured separately via IFRAME_TENANT, JWT_KID, JWT_PRIVATE_KEY_PATH.
# Make sure this tenant is configured to not allow guests.
# The key ID
#JAAS_KID=
# The path to the private key used for generating JWT token (.pk) for jaas-specific tests (see the
# file-path note at the top of this file)
#JAAS_PRIVATE_KEY_PATH=
# The JaaS tenant, e.g. vpaas-magic-cookie-abcdabcd1234567890
#JAAS_TENANT=
# Enable debug logging. Note this includes private information from .env.
#JITSI_DEBUG=true
# An access token to use to create meetings (used for the first participant)
#JWT_ACCESS_TOKEN=
# The kid to use in the token for non-jaas-specific tests (though it could be a jaas key).
#JWT_KID=
# The path to the private key used for generating JWT token (.pk) for non-jaas-specific tests (though it could be a
# jaas key). See the file-path note at the top of this file.
#JWT_PRIVATE_KEY_PATH=
# The count of workers that execute the tests in parallel
# MAX_INSTANCES=1
# To be able to match a domain to a specific address
# The format is "MAP example.com 1.2.3.4"
#RESOLVER_RULES=
# Fixed room name to use, overrides generated name (including prefix/suffix)
#ROOM_NAME=
# Room name prefix to use when creating new room names
#ROOM_NAME_PREFIX=
# Room name suffix to use when creating new room names
#ROOM_NAME_SUFFIX=
# A destination number to dialout, that auto answer and sends media audio and video
#SIP_JIBRI_DIAL_OUT_URL=
# The path to the browser video capture file (see the file-path note at the top of this file)
#VIDEO_CAPTURE_FILE=tests/resources/FourPeople_1280x720_30.y4m
# A shared secret to authenticate the webhook proxy connection
#WEBHOOKS_PROXY_SHARED_SECRET=
# The address of the webhooks proxy used to test the webhooks feature (e.g. wss://your.service)
#WEBHOOKS_PROXY_URL=
# A stream key abd broadcast ID that can be used by the tests to stream to YouTube
#YTUBE_TEST_STREAM_KEY=
#YTUBE_TEST_BROADCAST_ID=
# Malleus Jitsificus (the load tester, see malleus/README.md) settings. Normally set through the flags of
# `npm run malleus`, which override these. The regular settings above (BASE_URL, GRID_HOST_URL, HEADLESS,
# ALLOW_INSECURE_CERTS, VIDEO_CAPTURE_FILE, ROOM_NAME_PREFIX, ROOM_NAME_SUFFIX, RESOLVER_RULES) apply too; a
# comma-separated ROOM_NAME_SUFFIX spreads the conferences over the suffixes.
#MALLEUS_CONFERENCES=1
#MALLEUS_PARTICIPANTS=3
#MALLEUS_SENDERS=3
#MALLEUS_AUDIO_SENDERS=3
#MALLEUS_DURATION=60
#MALLEUS_JOIN_DELAY=0
#MALLEUS_ROOM_NAME_PREFIX=anvil-
#MALLEUS_REGIONS=
#MALLEUS_ENABLE_P2P=true
#MALLEUS_USE_STAGE_VIEW=false
#MALLEUS_SWITCH_SPEAKERS=false
#MALLEUS_USE_LOAD_TEST=false
#MALLEUS_USE_LITE_MODE=false
#MALLEUS_SENDERS_PER_TAB=1
#MALLEUS_RECEIVERS_PER_TAB=1
#MALLEUS_SENDER_TABS_PER_BROWSER=1
#MALLEUS_RECEIVER_TABS_PER_BROWSER=1
# Requires the grid to declare nodename:applicationName malleusSender / malleusReceiver stereotypes.
#MALLEUS_USE_NODE_TYPES=false
#MALLEUS_MAX_DISRUPTED_BRIDGES_PCT=0
#MALLEUS_BLIP_SCRIPT=
#MALLEUS_EXTRA_SENDER_PARAMS=
#MALLEUS_EXTRA_RECEIVER_PARAMS=
#MALLEUS_JWT=
# Mint a JaaS token per participant with JAAS_KID / JAAS_PRIVATE_KEY_PATH (default: true when those are set)
#MALLEUS_GENERATE_JAAS_TOKENS=
# Whether minted JaaS tokens are moderator tokens, which bypass a lobby (default: true)
#MALLEUS_JAAS_MODERATOR=
#MALLEUS_SAVE_LOGS=false
# The browserVersion to request from the grid (default: jitsi-stable, the grid's alias for current stable Chrome)
#MALLEUS_BROWSER_VERSION=