From aeadaf4e0d775393453f497d3d1da2493a2fe56c Mon Sep 17 00:00:00 2001 From: David Dworken Date: Sun, 12 Nov 2023 02:11:37 -0800 Subject: [PATCH] Set OPENAI_API_KEY for testTui/ai so that it runs with the hishtory server rather than via directly querying OpenAI --- client/client_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client/client_test.go b/client/client_test.go index 76c7aa7..21c92b7 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -1923,6 +1923,8 @@ func testTui_errors(t *testing.T) { func testTui_ai(t *testing.T) { // Setup defer testutils.BackupAndRestore(t)() + defer testutils.BackupAndRestoreEnv("OPENAI_API_KEY")() + os.Setenv("OPENAI_API_KEY", "") tester, _, _ := setupTestTui(t, Online) req, err := json.Marshal( ai.TestOnlyOverrideAiSuggestionRequest{Query: "myQuery", Suggestions: []string{"result 1", "result 2", "longer result 3"}},