Files
zeekay 10e6fec4c0 debrand: the brand token is INSIGHTS_, and a wrong one stops the container
The rule table mapped HOG_ -> FN_ ahead of any POSTHOG rule, so POSTHOG_FOO
split into POST + HOG_ and came out POSTFN_FOO. Nothing sets that. The live
pods set INSIGHTS_SKIP_MIGRATION_CHECKS, which bin/migrate-check reads on the
container entrypoint, so the misspelling does not degrade a feature -- it runs
migrate --check against a database whose history this tree does not share and
the container never starts.

Both replacements are measured against the shipped tree rather than chosen:
every HOG_ name with a counterpart there is spelled INSIGHTS_ (HOG_QL ->
INSIGHTS_QL, HOG_FUNCTION_TEMPLATES -> INSIGHTS_FUNCTION_TEMPLATES, 12 of 12
determinate cases), and FN_ appears in it nowhere. Upstream carries 95 HOG_
tokens and zero FN_ ones, so repairing FN_ back out is exactly the inverse of
the bad rule and cannot collide with an upstream name.

The rule is fixed for the next convergence, and the tree it already produced is
repaired in the same commit -- the codemod is idempotent against its own output,
so it cannot undo this itself.
2026-08-01 17:42:28 -07:00

2.3 KiB

LLMA Acceptance Test Implementation Plan

Overview

Python-based acceptance tests for the AI observability capture pipeline, testing against an existing Insights instance.

Test Execution

Local Development

  • User starts Insights stack manually (using docker-compose or other method)
  • Set INSIGHTS_TEST_BASE_URL environment variable to Insights instance URL
  • Run acceptance tests: python run_tests.py

GitHub Actions

  • Triggered on PRs affecting rust/capture/ or nodejs/
  • Sets up Insights stack in CI
  • Runs acceptance tests against the stack
  • Collects logs on failure

Implementation Steps

Commit 1: Basic acceptance test infrastructure ✓

  1. Create common/ingestion/acceptance_tests/ directory structure
  2. Add utils.py for service URL management
  3. Add requirements.txt with test dependencies
  4. Add run_tests.py test runner script

Commit 2: Insights API client for test setup

  1. Add api_client.py with InsightsTestClient class
  2. Implement organization creation via API
  3. Implement project creation with API key retrieval
  4. Add project deletion for cleanup
  5. Add event querying through Insights Query API
  6. Implement polling mechanism for event arrival

Commit 3: Basic event capture test

  1. Add test_basic_capture.py
  2. Test sending a regular Insights event to /capture
  3. Poll Query API until event appears
  4. Verify event properties match what was sent
  5. Confirm end-to-end pipeline works

Commit 4: Test orchestration

  1. Add conftest.py with pytest fixtures
  2. Add per-test project isolation
  3. Add environment variable handling
  4. Handle cleanup of test data

Commit 5: GitHub Actions workflow

  1. Add .github/workflows/llma-acceptance-tests.yml
  2. Configure triggers for relevant paths
  3. Add Insights stack startup steps
  4. Add test execution with pytest
  5. Implement log collection on failure
  6. Add cleanup steps

Commit 6: Documentation

  1. Add README.md with setup instructions
  2. Document local running procedures
  3. Document environment variables
  4. Add troubleshooting guide
  5. Create .env.example file
  6. Document how to extend the test suite

Usage

# Start Insights manually (e.g., with docker-compose)
docker-compose -f docker-compose.dev-full.yml up -d

# Set environment variable
export INSIGHTS_TEST_BASE_URL=http://localhost:8010

# Run tests
cd common/ingestion/acceptance_tests
python run_tests.py