Skip to content

API, HTTP, E2E and load testing ​

Functions of the tools module at v0.7.0. Each returns what a command runs in; import it with import * as tools from "tools".

playwright.env ​

Playwright: Node.js with Chromium, Firefox and WebKit and the libraries they need, configured by its parameters.

lask
playwright.env(
  --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,
  --base_access: String | Map<String> | Null = null,
  --with: Array<Record<env: Map<String>, volumes: Array<String>>> = [],
  --extra_env: Map<String> = {}
): Runnable

The 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

  • --image The image to run; another release is passed as image = #mcr.microsoft.com/playwright:<tag>.
  • --shm_size Size of /dev/shm; null leaves Docker's default.
  • --registry npm_config_registry: the registry npm installs from.
  • --npm_token!! NPM_TOKEN, for an .npmrc that reads ${NPM_TOKEN}; masked in the command log.
  • --cache_dir Host directory mounted at /cache, where npm keeps its cache (npm_config_cache).
  • --base_access What the container may do with the project directory: "rw" (the default), "ro", "none", or a table of paths such as {".": "ro", "dist": "rw"} (lask spec 10.2).
  • --with Setups of other tools this environment should also carry.
  • --extra_env Any 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

lib/playwright.lask

k6.env ​

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.

lask
k6.env(
  --image: Environment = #grafana/k6:1.8.1,
  --cloud_token: String | Null = <secret>,
  --network: String | Null = null,
  --base_access: String | Map<String> | Null = null,
  --with: Array<Record<env: Map<String>, volumes: Array<String>>> = [],
  --extra_env: Map<String> = {}
): Runnable

Parameters

  • --image The 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.
  • --network The container's network: a Compose network, or "host".
  • --base_access What the container may do with the project directory: "rw" (the default), "ro", "none", or a table of paths such as {".": "ro", "dist": "rw"} (lask spec 10.2).
  • --with Setups of other tools this environment should also carry.
  • --extra_env Any 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"

bash
lask eval k6.env --network host

lib/k6.lask

grpcurl.env ​

grpcurl, fullstorydev/grpcurl:v1.9.3-alpine by default.

lask
grpcurl.env(
  --image: Environment = #fullstorydev/grpcurl:v1.9.3-alpine,
  --network: String | Null = null,
  --base_access: String | Map<String> | Null = null,
  --with: Array<Record<env: Map<String>, volumes: Array<String>>> = [],
  --extra_env: Map<String> = {}
): Runnable

Parameters

  • --image The image to run; another release is passed as image = #fullstorydev/grpcurl:<tag>.
  • --network The container's network: a Compose network, or "host".
  • --base_access What the container may do with the project directory: "rw" (the default), "ro", "none", or a table of paths such as {".": "ro", "dist": "rw"} (lask spec 10.2).
  • --with Setups of other tools this environment should also carry.
  • --extra_env Any 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"

bash
lask eval grpcurl.env --network host

lib/grpcurl.lask

newman.env ​

Newman, Postman's collection runner, postman/newman:6.1.3-alpine by default.

lask
newman.env(
  --image: Environment = #postman/newman:6.1.3-alpine,
  --network: String | Null = null,
  --base_access: String | Map<String> | Null = null,
  --with: Array<Record<env: Map<String>, volumes: Array<String>>> = [],
  --extra_env: Map<String> = {}
): Runnable

Parameters

  • --image The image to run; another release is passed as image = #postman/newman:<tag>.
  • --network The container's network: a Compose network, or "host".
  • --base_access What the container may do with the project directory: "rw" (the default), "ro", "none", or a table of paths such as {".": "ro", "dist": "rw"} (lask spec 10.2).
  • --with Setups of other tools this environment should also carry.
  • --extra_env Any 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"

bash
lask eval newman.env

lib/newman.lask

robot.env ​

Robot Framework, with RequestsLibrary for API tests.

lask
robot.env(
  --options: String | Null = null,
  --network: String | Null = null,
  --base_access: String | Map<String> | Null = null,
  --with: Array<Record<env: Map<String>, volumes: Array<String>>> = [],
  --extra_env: Map<String> = {}
): Runnable

There 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.env(). 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.env().

Parameters

  • --options ROBOT_OPTIONS, which robot reads before its command line, e.g. "--outputdir results".
  • --network The container's network: a Compose network, or "host".
  • --base_access What the container may do with the project directory: "rw" (the default), "ro", "none", or a table of paths such as {".": "ro", "dist": "rw"} (lask spec 10.2).
  • --with Setups of other tools this environment should also carry.
  • --extra_env Any 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"

bash
lask eval robot.env --options "--outputdir results"

lib/robot.lask

ab.env ​

ApacheBench, from the Apache HTTP Server image, httpd:2.4.68-alpine3.24 by default.

lask
ab.env(
  --image: Environment = #httpd:2.4.68-alpine3.24,
  --network: String | Null = null,
  --base_access: String | Map<String> | Null = null,
  --with: Array<Record<env: Map<String>, volumes: Array<String>>> = [],
  --extra_env: Map<String> = {}
): Runnable

Parameters

  • --image The image to run; another release is passed as image = #httpd:<tag>.
  • --network The container's network: a Compose network, or "host".
  • --base_access What the container may do with the project directory: "rw" (the default), "ro", "none", or a table of paths such as {".": "ro", "dist": "rw"} (lask spec 10.2).
  • --with Setups of other tools this environment should also carry.
  • --extra_env Any 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"

bash
lask eval ab.env --network host

lib/ab.lask

Released under the MIT License.