[Phase 4] End-to-end integration test: local worker + LLM + memory service #19

Open
opened 2026-09-09 01:05:31 +00:00 by poimen · 0 comments
Member

Goal

Validate full pipeline locally: start worker, trigger synthesis workflow, verify entities extracted via LLM, stored in memory service.

Prerequisites

  • Local Temporal running (docker run temporalio/auto-setup)
  • Memory service running (cargo run -p mem-cli)
  • LLM accessible (LOCAL_LLM_BASE_URL pointing to local ollama or api.riotpiao.com)

Test Script: scripts/e2e-test.sh

#!/bin/bash
set -e

# 1. Start Temporal
docker run -d --name temporal-test -p 7233:7233 temporalio/auto-setup:1.20.0
sleep 10

# 2. Start worker in background
TEMPORAL_HOSTPORT=localhost:7233 \
MEMORY_SERVICE_URL=http://localhost:8080 \
LOCAL_LLM_BASE_URL=https://api.riotpiao.com \
  go run cmd/worker/main.go &
WORKER_PID=$!
sleep 5

# 3. Trigger synthesis workflow
go run cmd/starter/main.go --workflow SynthesisWorkflow \
  --input {"project":"e2e-test","source":"test://e2e","text":"Kubernetes runs on port 8080. ArgoCD deploys to the cluster.","kind":"L1"}

# 4. Wait for completion
sleep 30

# 5. Query memory service for results
RESULT=$(curl -s http://localhost:8080/memory/query \
  -H "Content-Type: application/json" \
  -d {"project":"e2e-test","query":"Kubernetes ArgoCD"})

echo "$RESULT" | jq .

# 6. Verify entities were extracted
ENTITY_COUNT=$(echo "$RESULT" | jq .results | length)
if [ "$ENTITY_COUNT" -gt 0 ]; then
  echo "PASS: $ENTITY_COUNT entities found"
else
  echo "FAIL: no entities found"
  exit 1
fi

# 7. Cleanup
kill $WORKER_PID
docker rm -f temporal-test

Go Integration Test

// tests/e2e_synthesis_test.go
// +build integration

func TestE2E_SynthesisWorkflow(t *testing.T) {
    if os.Getenv("TEMPORAL_HOSTPORT") == "" {
        t.Skip("TEMPORAL_HOSTPORT not set, skipping e2e")
    }
    // Connect to Temporal
    // Start SynthesisWorkflow
    // Wait for completion (timeout 60s)
    // Query memory service
    // Assert entities > 0
}

Effort

~100 LOC, 1 day

## Goal Validate full pipeline locally: start worker, trigger synthesis workflow, verify entities extracted via LLM, stored in memory service. ## Prerequisites - Local Temporal running (`docker run temporalio/auto-setup`) - Memory service running (`cargo run -p mem-cli`) - LLM accessible (`LOCAL_LLM_BASE_URL` pointing to local ollama or api.riotpiao.com) ## Test Script: `scripts/e2e-test.sh` ```bash #!/bin/bash set -e # 1. Start Temporal docker run -d --name temporal-test -p 7233:7233 temporalio/auto-setup:1.20.0 sleep 10 # 2. Start worker in background TEMPORAL_HOSTPORT=localhost:7233 \ MEMORY_SERVICE_URL=http://localhost:8080 \ LOCAL_LLM_BASE_URL=https://api.riotpiao.com \ go run cmd/worker/main.go & WORKER_PID=$! sleep 5 # 3. Trigger synthesis workflow go run cmd/starter/main.go --workflow SynthesisWorkflow \ --input {"project":"e2e-test","source":"test://e2e","text":"Kubernetes runs on port 8080. ArgoCD deploys to the cluster.","kind":"L1"} # 4. Wait for completion sleep 30 # 5. Query memory service for results RESULT=$(curl -s http://localhost:8080/memory/query \ -H "Content-Type: application/json" \ -d {"project":"e2e-test","query":"Kubernetes ArgoCD"}) echo "$RESULT" | jq . # 6. Verify entities were extracted ENTITY_COUNT=$(echo "$RESULT" | jq .results | length) if [ "$ENTITY_COUNT" -gt 0 ]; then echo "PASS: $ENTITY_COUNT entities found" else echo "FAIL: no entities found" exit 1 fi # 7. Cleanup kill $WORKER_PID docker rm -f temporal-test ``` ## Go Integration Test ```go // tests/e2e_synthesis_test.go // +build integration func TestE2E_SynthesisWorkflow(t *testing.T) { if os.Getenv("TEMPORAL_HOSTPORT") == "" { t.Skip("TEMPORAL_HOSTPORT not set, skipping e2e") } // Connect to Temporal // Start SynthesisWorkflow // Wait for completion (timeout 60s) // Query memory service // Assert entities > 0 } ``` ## Effort ~100 LOC, 1 day
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: riotpiao-poimen/poimen-workflows#19