Helpful in writing Goose load tests.
Each goose-eggs minor release works with one Goose minor release:
| goose-eggs | Goose |
|---|---|
| 0.7 | 0.19 |
| 0.6 | 0.18 |
| 0.5 | 0.17 |
goose-eggs 0.7 is on crates.io for Goose 0.19; between releases, the main branch follows Goose main, see RELEASING.md.
Besides page validation and static asset loading, goose-eggs has modules for the forms and APIs of three platforms. Each helper takes Validate rules for the pages it loads, fails the transaction with the platform's own reason, and has every path configurable on its builder.
goose_eggs::drupal logs in (Login, log_in), searches (SearchParams, search), and reads Drupal forms, including ones BigPipe streams (get_form, get_form_value, get_bigpipe_form, get_encoded_form_value, get_updated_build_id). The Umami example is a complete load test of Drupal's Umami demo.
goose_eggs::wordpress drives any WordPress site through what core serves:
Loginandlog_in,log_out: the log in form with WordPress's test cookie, and the nonce in the log out linkSearchParamsandsearch:?s=, optionally limited to a post typeCommentandpost_comment: the comment form, as an anonymous or logged in user, with random text by default so WordPress's duplicate check passesPost,create_postandupdate_post: the block editor page with its assets, then the REST save it sends with the page's nonce;PostBuilder::post_typenames a custom post type's slug for its editor;PostBuilder::rest_noncesends only the REST request, with a nonce fromget_rest_nonceDiscover,discoverandSiteContent: the site's real URLs by kind, from the core sitemap or the REST API, to request at randomget_form,get_form_value,get_form_valuesandget_nonce: form parsing that reads attributes in any order, as WordPress writes them
examples/wordpress-sites/theme-test-data brings up WordPress with the theme unit test data in Docker; the WooCommerce example's README shows the helpers driving it.
goose_eggs::woocommerce, built on wordpress, drives any WooCommerce shop:
shop_page,product_page,product_search, anddiscover_productswithrandom_product, through the Store APIStoreApiCart: the cart and checkout WooCommerce's block cart and checkout use, keeping each user's Store API nonce, with aCheckoutbuilder (Cash on delivery by default)classic_add_to_cart,classic_update_cartandclassic_checkout: the shortcode cart and checkoutmy_account_log_inandmy_account_ordersShop: where the shop's pages and Store API are, defaulting to WooCommerce's
The WooCommerce example is a complete load test of a shop, and examples/wordpress-sites/woocommerce brings up the demo shop it runs against in Docker.
A load test runs each transaction thousands of times, so a Regex::new in a transaction or a helper it calls compiles its pattern and rebuilds its match cache on every request; in Goose's Umami example that cost about half of Goose's CPU per request. Compile each pattern once, in a static with std::sync::LazyLock, and share it across every user and request:
use regex::Regex;
use std::sync::LazyLock;
// Compiled the first time any user needs it, then reused.
static ORDER_NUMBER: LazyLock<Regex> =
LazyLock::new(|| Regex::new(r"Order number: <strong>(\d+)</strong>").unwrap());
fn order_number(html: &str) -> Option<String> {
ORDER_NUMBER.captures(html).map(|c| c[1].to_string())
}
let page = "<li>Order number: <strong>42</strong></li>";
assert_eq!(order_number(page), Some("42".to_string()));