Wikibase Suite (WBS)

Testing

Run the fast development-tooling tests and browser-based integration suites through the repository’s wbs-dev container. Use wbs-dev test --help for the current command reference.

Current Test Suites

Test Suite Type What It Covers
wbs-dev-tools Tooling The wbs-dev CLI, development commands, and shared development libraries.
wikibase Integration Core Wikibase repository behavior; runs up to three WDIO workers.
upgrade Integration Upgrades from earlier Wikibase Suite configuration and data layouts.
wikibase-extensions Integration Bundled MediaWiki and Wikibase extensions; runs up to three WDIO workers.
wikibase-client Integration Repository/client federation and change dispatch.
wdqs Integration WDQS, its updater, and the WDQS frontend through the wdqs and wdqs-frontend Compose profiles.
quickstatements Integration QuickStatements through the quickstatements Compose profile.
opensearch Integration OpenSearch-backed search through the opensearch Compose profile.
ontology-presets Integration Bundled preset validation and the administrator onboarding flow.
wbs-tools Integration WBS Tools lifecycle, including bootstrap selection, web configuration, deployment health, and administrator login.

Integration suite settings live in tests/<suite>/<suite>.conf.ts. Each combines the published deployment Compose file with the shared test override and any suite-specific override. Test results are written beneath the suite’s results directory; CI uploads them after a failure.

Run Tests

# Run every test target sequentially
wbs-dev test all

# Run the WBS DevTools test suite
wbs-dev test wbs-dev-tools

# Run one integration suite
wbs-dev test wikibase-client

# Run multiple suites
wbs-dev test wikibase wdqs

# Run one spec within a suite's environment
wbs-dev test wikibase-extensions --spec wikibase-extensions/babel.spec.ts

# Start a suite's services and leave them running
wbs-dev test wdqs --setup

Write Tests

Conventions

Choose Where the Test Belongs

An existing suite automatically discovers a new spec only when its <suite>.conf.ts specs patterns include the new path. A suite is a test target when tests/<suite>/<suite>.conf.ts exists; underscore-prefixed directories and node_modules are excluded. The scattered development-tooling specs are exposed explicitly as the synthetic wbs-dev-tools target.

WBS Tools Suite

The wbs-tools suite is the dedicated end-to-end suite for the WBS Tools image and its installer lifecycle. In contrast, wbs-dev-tools tests the development CLI and its supporting libraries.

It runs the selected WBS Tools image against a temporary WBS checkout and covers:

It exercises the supported --local path. Public DNS matching, certificate issuance, firewall configuration, and reachability from outside the Docker host remain separate deployment concerns.

Run it with wbs-dev test wbs-tools.

WBS DevTools Tests

The wbs-dev-tools suite uses Mocha to test the development tooling rather than a browser environment.

Run the suite with wbs-dev test wbs-dev-tools.

Test Configuration Notes

Most local development needs no configuration. wbs-dev test all builds local images before running integration suites; use --skip-build only when those images were built separately. Running wbs-dev test in an interactive terminal presents a target picker.

Common Local Adjustments

Advanced Configuration

development/local.env overrides the test defaults. The root .env.example, test-services.env, and test-runner.env define service URLs, credentials, test-property IDs, runner timeouts, logging, and other test-system settings. Most contributors do not need to change them.

CI uses --skip-build and supplies WBS_TEST_IMAGE_REGISTRY and WBS_TEST_IMAGE_TAG to select its workflow images. These settings are normally not needed for local development.

Architecture Coverage in CI

PR/main and release CI run every suite against native AMD64 images. With WBS_RELEASE_ARM64=true, they also build and test on native ARM64 runners.

The manual Build and Test inputs can additionally enable ARM64 for that run. Building ARM64 alone does not test it; enable Run every test suite against the ARM64 image set too for test coverage.

Further Reading

When working on the browser tests, consult the documentation of the following libraries: