From 202088fc8e879780eded61600ba3c062b6d7f628 Mon Sep 17 00:00:00 2001 From: Jorge Manrubia Date: Fri, 16 May 2025 17:01:57 +0200 Subject: [PATCH] Comment AI in tests --- README.md | 6 ++++++ config/deploy.yml | 1 + 2 files changed, 7 insertions(+) diff --git a/README.md b/README.md index 908e2cf98..7caa8ffb7 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,12 @@ Card.find_each(&:refresh_search_embedding) Comment.find_each(&:refresh_search_embedding) ``` +### Tests + +For testing OpenAI API requests, we use [VCR](https://github.com/vcr/vcr). If you want to test AI features exercising the API, you need to place the `config/credentials/test.key` +that you can get from 1Password in "Fizzy - test.key". Then, when running tests that use Open AI API, you must either set the env variable VCR_RECORD=1 +or to add `vcr_record!` to the test. See `VcrTestHelper`. + ## Running tests For fast feedback loops, unit tests can be run with: diff --git a/config/deploy.yml b/config/deploy.yml index 9617a8b87..39ffd195a 100644 --- a/config/deploy.yml +++ b/config/deploy.yml @@ -24,6 +24,7 @@ builder: env: secret: - SECRET_KEY_BASE + - OPEN_AI_API_KEY aliases: console: app exec -i --reuse "bin/rails console"