Testing Wikantik

Adapted from docs/developer/Testing.md in the Wikantik repository; current as of release 2.4.56.

This page is for developers who write or run Wikantik tests. It describes how the unit and integration tests are laid out, the database test helpers, the canonical pre-commit gate, Docker and embedder requirements, the quality ratchets, and how to handle flaky tests. It was written from the poms, bin/run-tests.sh --help and bin/agent-build.sh; run those for the current flags. For build commands see docs/developer/Building.md.

Know the two test layers

Test against a real database

There is no H2 schema. Tests that touch a database run against a real pgvector/pgvector:pg18 container started through Docker. The helpers ship in the wikantik-jdbc test-jar under com.wikantik.jdbc.testing:

To add a repository: hold a Jdbc, write the migration first, and test against PostgresTestDb.

Run the canonical gate

Run this before you commit:

bin/run-tests.sh --parallel 4

Phase 1 runs every unit test once (-T 1C -DskipITs) and installs the artifacts, including the WAR and the wikantik-selenide-tests test-jar. Phase 2 runs the five default IT modules in one -T 4 reactor with per-module reserved ports and uniquely named pgvector containers. The IT phase does not re-run the unit tests. The script takes a per-checkout run lock (.run.lock) and writes a summary to .test-suite-logs/report.txt. Parallel IT runs are supported only through this script; do not add -T to a raw mvn ... -Pintegration-tests command.

Other modes from bin/run-tests.sh --help:

bin/run-tests.sh                    # default gate with a sequential IT phase
bin/run-tests.sh --all              # default gate plus the opt-in scim-fullloop
bin/run-tests.sh --unit             # unit phase only
bin/run-tests.sh --it --parallel 4  # IT phase only (needs a prior --unit)
bin/run-tests.sh --module rest      # one IT module: rest|sso|knowledge-disabled|custom-jdbc|dense|scim-fullloop
bin/run-tests.sh --list             # modules and their gate
bin/run-tests.sh --all -o both      # stream build output to console and log

Because a full run exceeds an agent's tool timeout, start it detached:

bin/agent-build.sh start gate -- bin/run-tests.sh --parallel 4
bin/agent-build.sh wait gate 540

The summary's "Tests run: N" line for a phase is the last module's count, not the aggregate. Sum the per-module results in .test-suite-logs/phase1-unit.log if you need a total.

Meet the Docker and embedder requirements

Run the quality ratchets

Handle flaky tests


Cluster Hub: Wikantik Platform Development Hub: Architecture, MCP Protocols, and Agent Briefings (wikantik-development)