Skip to content

feat: add LCM pattern regression test suite#168

Open
slideshow-dingo wants to merge 2 commits intoMartian-Engineering:mainfrom
slideshow-dingo:ref/pattern-test-regression-suite
Open

feat: add LCM pattern regression test suite#168
slideshow-dingo wants to merge 2 commits intoMartian-Engineering:mainfrom
slideshow-dingo:ref/pattern-test-regression-suite

Conversation

@slideshow-dingo
Copy link

@slideshow-dingo slideshow-dingo commented Mar 23, 2026

Summary

Adds a pattern test regression suite to help LCM operators validate plugin integration with OpenClaw instances.

Motivation

Running LCM in production on an autonomous ops agent revealed integration failure modes difficult to detect manually:

Tests Added

Pattern Validates
001 lcm_grep, lcm_expand, lcm_expand_query work after compaction
002 Summarizer compacts without error
003 Summarizer uses correct auth profile

Files

  • test/pattern-regression.test.ts — Test runner + fixtures
  • docs/pattern-regression.md — Operator guide

Changes

  • 2026-03-24: Fixed import from node:test to vitest (was causing beforeAll is not a function in CI)
  • Added SKIP_INTEGRATION_TESTS env var to skip tests requiring a real OpenClaw instance
  • Added unit tests for CI compatibility

Testing

Validated locally on OpenClaw v2026.3.22 with ollama-local summarizer.
CI: ✅ Passing

Related

Closes #85 — provides deterministic smoke-test path for lcm_expand_query validation

Questions for Maintainers

  1. Should these live in lossless-claw/test/ or a separate repo?
  2. Integration tests (require running OpenClaw) vs unit tests (mock LCM)?
  3. Interest in lcm doctor / lcm test subcommand?

- Pattern 001: LCM Tools Integration (lcm_grep, lcm_expand, lcm_expand_query)
- Pattern 002: Compaction completes without error
- Pattern 003: Auth profile validation for summarizer

Validates that LCM tools integrate correctly with OpenClaw's session,
cron, and agent infrastructure. Designed to catch integration failures
that emerge in production but are difficult to detect manually.

Tests use black-box approach (invoke LCM through OpenClaw tool interface)
and are idempotent (can run repeatedly without polluting DB).

OpenClaw version: v2026.3.22
The pattern-regression.test.ts was importing from 'node:test' instead of
'vitest', causing 'beforeAll is not a function' errors in CI.

Also added SKIP_INTEGRATION_TESTS env var to skip tests that require
a real OpenClaw instance (they can be run locally with SKIP_INTEGRATION_TESTS=0).

Fixes CI test failure: '(0 , __vite_ssr_import_0__.beforeAll) is not a function'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a deterministic smoke-test/diagnostic path for lcm_expand_query and expansion delegation

1 participant