fix(test): use standard uiop:getenv for environment modification

This commit is contained in:
2026-04-28 17:35:55 -04:00
parent ea0855f40b
commit 589ff1cb8d

View File

@@ -24,11 +24,14 @@ The *LLM Gateway* skill provides a unified interface for interacting with multip
(test test-llm-gateway-timeout (test test-llm-gateway-timeout
"Tier 2 Chaos: Verify that LLM Gateway handles connection failures gracefully." "Tier 2 Chaos: Verify that LLM Gateway handles connection failures gracefully."
;; Point to a non-existent port to force a connection error ;; Point to a non-existent port to force a connection error
(let ((uiop:*environment* (copy-list uiop:*environment*))) (let ((old-host (uiop:getenv "OLLAMA_HOST")))
(setf (uiop:getenv "OLLAMA_HOST") "localhost:1") (unwind-protect
(let ((result (opencortex::execute-llm-request :prompt "hello" :provider :ollama))) (progn
(is (eq (getf result :status) :error)) (setf (uiop:getenv "OLLAMA_HOST") "localhost:1")
(is (uiop:string-prefix-p "Ollama Failure" (getf result :message)))))) (let ((result (opencortex::execute-llm-request :prompt "hello" :provider :ollama)))
(is (eq (getf result :status) :error))
(is (uiop:string-prefix-p "Ollama Failure" (getf result :message)))))
(setf (uiop:getenv "OLLAMA_HOST") old-host))))
#+end_src #+end_src
* Implementation * Implementation