API, HTTP, E2E and load testing
Functions of the tools module at v0.3.2. Each returns what a command runs in; import it with import * as tools from "tools".
playwright
Playwright: Node.js with Chromium, Firefox and WebKit and the libraries they need, configured by its parameters.
playwright(
--image: Environment = #mcr.microsoft.com/playwright:v1.63.0-noble,
--shm_size: String | Null = "1g",
--registry: String | Null = null,
--npm_token: String | Null = <secret>,
--cache_dir: String | Null = null,
--with: Array<Record<env: Map<String>, volumes: Array<String>>> = [],
--extra_env: Map<String> = {}
): RunnableThe image is #mcr.microsoft.com/playwright:v1.63.0-noble (Ubuntu 24.04) unless --image names another. Pick the tag of the
@playwright/test version the project installs: the image carries the browsers of one Playwright release, and another release does not find them. The browsers are never downloaded here (PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1), so a mismatch fails at once rather than fetching browsers into the container on every run. lask sync pulls and pins whichever image is used (lask spec 10.3); a run never pulls.
The container runs with an init process, which reaps the browser's child processes, and with a larger /dev/shm than Docker's 64MB, which Chromium otherwise runs out of.
The project's own Playwright runs through npx, so no command word is exported: npx is node's. Give the environment where it is used, $[tools.playwright()] npx playwright test.
Parameters
--imageThe image to run; another release is passed as image = #mcr.microsoft.com/playwright:<tag>.--shm_sizeSize of /dev/shm; null leaves Docker's default.--registrynpm_config_registry: the registry npm installs from.--npm_token!!NPM_TOKEN, for an .npmrc that reads ${NPM_TOKEN}; masked in the command log.--cache_dirHost directory mounted at /cache, where npm keeps its cache (npm_config_cache).--withSetups of other tools this environment should also carry.--extra_envAny other variable, e.g. the base URL the tests read; below --with and the named parameters.
Returns Runnable: The environment, for $[...] or command { "npx" } on ....
Image mcr.microsoft.com/playwright:v1.63.0-noble
k6
k6, grafana/k6:1.8.1 by default. It sends no usage report (K6_NO_USAGE_REPORT=true). The image runs as the user k6, not root.
k6(
--image: Environment = #grafana/k6:1.8.1,
--cloud_token: String | Null = <secret>,
--network: String | Null = null,
--with: Array<Record<env: Map<String>, volumes: Array<String>>> = [],
--extra_env: Map<String> = {}
): RunnableParameters
--imageThe image to run; another release is passed as image = #grafana/k6:<tag>.--cloud_token!!K6_CLOUD_TOKEN, for Grafana Cloud k6; masked in the command log.--networkThe container's network: a Compose network, or "host".--withSetups of other tools this environment should also carry.--extra_envAny other variable, e.g. a value the script reads through __ENV; below --with and the named parameters.
Returns Runnable: The environment, for command { "k6" } on ... or $[...].
Image grafana/k6:1.8.1
Command words k6: import command { "k6" } from "tools"
lask eval k6 --network hostgrpcurl
grpcurl, fullstorydev/grpcurl:v1.9.3-alpine by default.
grpcurl(
--image: Environment = #fullstorydev/grpcurl:v1.9.3-alpine,
--network: String | Null = null,
--with: Array<Record<env: Map<String>, volumes: Array<String>>> = [],
--extra_env: Map<String> = {}
): RunnableParameters
--imageThe image to run; another release is passed as image = #fullstorydev/grpcurl:<tag>.--networkThe container's network: a Compose network, or "host".--withSetups of other tools this environment should also carry.--extra_envAny other variable; below --with.
Returns Runnable: The environment, for command { "grpcurl" } on ... or $[...].
Image fullstorydev/grpcurl:v1.9.3-alpine
Command words grpcurl: import command { "grpcurl" } from "tools"
lask eval grpcurl --network hostnewman
Newman, Postman's collection runner, postman/newman:6.1.3-alpine by default.
newman(
--image: Environment = #postman/newman:6.1.3-alpine,
--network: String | Null = null,
--with: Array<Record<env: Map<String>, volumes: Array<String>>> = [],
--extra_env: Map<String> = {}
): RunnableParameters
--imageThe image to run; another release is passed as image = #postman/newman:<tag>.--networkThe container's network: a Compose network, or "host".--withSetups of other tools this environment should also carry.--extra_envAny other variable; below --with.
Returns Runnable: The environment, for command { "newman" } on ... or $[...].
Image postman/newman:6.1.3-alpine
Command words newman: import command { "newman" } from "tools"
lask eval newmanrobot
Robot Framework, with RequestsLibrary for API tests.
robot(
--options: String | Null = null,
--network: String | Null = null,
--with: Array<Record<env: Map<String>, volumes: Array<String>>> = [],
--extra_env: Map<String> = {}
): RunnableThere is no official image, so the image is built from lib/images/robot/Dockerfile: Robot Framework 7.5 and RequestsLibrary 0.9.7 on the Python image of python(). It takes no --image, and lask sync builds it. Another library is installed in the same command, pip install -r requirements.txt && robot tests; a browser library is better served by playwright().
Parameters
--optionsROBOT_OPTIONS, which robot reads before its command line, e.g. "--outputdir results".--networkThe container's network: a Compose network, or "host".--withSetups of other tools this environment should also carry.--extra_envAny other variable; below --with and the named parameters.
Returns Runnable: The environment, for command { "robot" } on ... or $[...].
Image recipe lib/images/robot/Dockerfile
Command words libdoc, rebot, robot: import command { "libdoc", "rebot", "robot" } from "tools"
lask eval robot --options "--outputdir results"ab
ApacheBench, from the Apache HTTP Server image, httpd:2.4.68-alpine3.24 by default.
ab(
--image: Environment = #httpd:2.4.68-alpine3.24,
--network: String | Null = null,
--with: Array<Record<env: Map<String>, volumes: Array<String>>> = [],
--extra_env: Map<String> = {}
): RunnableParameters
--imageThe image to run; another release is passed as image = #httpd:<tag>.--networkThe container's network: a Compose network, or "host".--withSetups of other tools this environment should also carry.--extra_envAny other variable; below --with.
Returns Runnable: The environment, for command { "ab" } on ... or $[...].
Image httpd:2.4.68-alpine3.24
Command words ab: import command { "ab" } from "tools"
lask eval ab --network host