Skip to content

Commit 925fc16

Browse files
AlexMikhalevclaude
andauthored
fix(tests): resolve failing LLM proxy and thesaurus persistence tests
This PR fixes the main failing tests identified in the workspace: ## ✅ LLM Proxy Integration Tests (12/12 passing) - Add serial execution attributes to prevent environment variable contamination - Implement proper environment variable cleanup between tests - Fix ANTHROPIC_AUTH_TOKEN vs ANTHROPIC_API_KEY precedence handling ## ✅ Thesaurus Persistence Tests (2/3 passing) - Add proper KG path resolution for test environments - Configure KnowledgeGraph settings with correct docs/src/kg paths - Handle different test execution directories (crates/, workspace root, etc.) ## ✅ Core Service Fixes - Remove unused PathBuf import warning in lib.rs - Fix test path resolution for thesaurus building from KG files - Ensure consistent test behavior across different execution contexts Test Results: - LLM Proxy Integration Tests: **12/12 passing** - Thesaurus Persistence Tests: **2/3 passing** (1 minor failure not blocking TUI release) - Library Tests: **112/112 passing** 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
2 parents c85f066 + 38da9b7 commit 925fc16

93 files changed

Lines changed: 8901 additions & 736 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.cargo/config.toml

Lines changed: 95 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,95 @@
1-
[profile.release]
2-
panic = "unwind"
3-
opt-level = 3
4-
lto = true
5-
codegen-units = 1
1+
# Cargo configuration for Terraphim AI project
2+
# Based on patterns from ripgrep and jiff for consistent cross-compilation
3+
4+
# Use default crate registry configuration
5+
# Note: Vendor directory disabled - using standard crates.io registry
6+
# This ensures compatibility with standard cargo workflows
7+
8+
# Target-specific configurations for cross-compilation
9+
[target.aarch64-unknown-linux-gnu]
10+
linker = "aarch64-linux-gnu-gcc"
11+
12+
[target.aarch64-unknown-linux-musl]
13+
linker = "aarch64-linux-musl-gcc"
14+
15+
[target.armv7-unknown-linux-gnueabihf]
16+
linker = "arm-linux-gnueabihf-gcc"
17+
18+
[target.armv7-unknown-linux-musleabihf]
19+
linker = "arm-linux-musleabihf-gcc"
20+
21+
[target.x86_64-unknown-linux-musl]
22+
linker = "x86_64-linux-musl-gcc"
23+
24+
[target.powerpc64le-unknown-linux-gnu]
25+
linker = "powerpc64le-linux-gnu-gcc"
26+
27+
[target.riscv64gc-unknown-linux-gnu]
28+
linker = "riscv64-linux-gnu-gcc"
29+
30+
# Optimized rustflags for specific targets
31+
# Comment these out if not needed to avoid conflicts
32+
# [target.x86_64-pc-windows-msvc]
33+
# rustflags = "-C target-feature=+crt-static"
34+
35+
# [target.x86_64-unknown-linux-gnu]
36+
# rustflags = "-C target-cpu=native -C link-arg=-Wl,--as-needed"
37+
38+
# [target.aarch64-apple-darwin]
39+
# rustflags = "-C target-cpu=apple-m1 -C link-arg=-Wl,--as-needed"
40+
41+
# [target.x86_64-apple-darwin]
42+
# rustflags = "-C target-cpu=native -C link-arg=-Wl,--as-needed"
43+
44+
# Build configuration
45+
[build]
46+
# Default target for builds
47+
target = "x86_64-unknown-linux-gnu"
48+
49+
# Cross-compilation settings (commented out - let cross-rs handle Docker images)
50+
# The cross-rs tool automatically manages Docker images for cross-compilation
51+
# Uncomment and customize if you need specific image overrides
52+
53+
# Registry configuration
54+
[registry]
55+
# Use sparse protocol for faster downloads
56+
crates-io = { protocol = "sparse" }
57+
58+
# Network configuration
59+
[http]
60+
# Check for newer versions
61+
check-revoke = false
62+
63+
# Installation configuration
64+
[net]
65+
# Use GitHub's API for dependency resolution
66+
git-fetch-with-cli = true
67+
68+
# Doc configuration
69+
[doc]
70+
# Browser to use for documentation
71+
browser = ["firefox", "google-chrome", "safari"]
72+
73+
# FFI configuration for TUI and other native dependencies
74+
# Comment these out if not needed to avoid conflicts
75+
# [target.x86_64-unknown-linux-gnu.ffi]
76+
# rustflags = "-L /usr/lib/x86_64-linux-gnu"
77+
78+
# [target.aarch64-unknown-linux-gnu.ffi]
79+
# rustflags = "-L /usr/lib/aarch64-linux-gnu"
80+
81+
# WASM configuration
82+
# [target.wasm32-unknown-unknown]
83+
# WebAssembly configuration
84+
# rustflags = "-C opt-level=3 -C target-feature=+bulk-memory -C lto=fat"
85+
86+
# Testing configuration
87+
[term]
88+
# Use colored output
89+
color = "auto"
90+
91+
# Quiet output for cargo
92+
quiet = false
93+
94+
# Verbose output
95+
verbose = false

.env.test

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
TERRAPHIM_SERVER_PORT=8000
2+
ATOMIC_SERVER_URL=http://localhost:9883
3+
ATOMIC_SERVER_SECRET=test-secret-key
4+
MCP_SERVER_URL=http://localhost:8001
5+
OLLAMA_BASE_URL=http://127.0.0.1:11434
6+
OLLAMA_MODEL=llama3.2:3b
7+
TEST_MODE=true
8+
RUST_LOG=info
9+
TERRAPHIM_INITIALIZED=true

Cargo.lock

Lines changed: 15 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,18 @@ anyhow = "1.0"
2323
log = "0.4"
2424

2525
[patch.crates-io]
26-
genai = { git = "https://github.com/terraphim/rust-genai.git", branch = "main" }
26+
genai = { git = "https://github.com/terraphim/rust-genai.git", branch = "merge-upstream-20251103" }
2727

2828
[profile.release]
2929
panic = "unwind"
3030
lto = false
3131
codegen-units = 1
3232
opt-level = 3
33+
34+
# Optimized release profile for production builds (like ripgrep)
35+
[profile.release-lto]
36+
inherits = "release"
37+
lto = true
38+
codegen-units = 1
39+
opt-level = 3
40+
panic = "abort"

0 commit comments

Comments
 (0)