BoxcarsAI / boxcars

Building applications with composability using Boxcars with LLM's. Inspired by LangChain.
MIT License
434 stars 39 forks source link

Specs need environment variables to be set to run green #4

Closed petergoldstein closed 1 year ago

petergoldstein commented 1 year ago

Currently the specs require that the OPENAI_ACCESS_TOKEN and SERPAPI_API_KEY environment variables to be set for the specs to run green. It doesn't matter what they're set to (provided that you're running specs against VCR). This is the pattern used in ruby-openai.

It has a lot of downsides, most notably that you can't actually write tests for your key checking logic or write tests that have meaningful and different settings for the corresponding configuration values. I used a different approach - adding a global default configuration and the ability to override - in the asimov gem. I would suggest a similar change be considered in the future.

That said, if we'd like to get specs to green on GitHub Actions without making that kind of change I think there are two ways of doing so:

  1. Use the GitHub Actions environment variables - https://docs.github.com/en/actions/learn-github-actions/variables - and set dummy variables for these values in the context run by GitHub. This has downsides for forks, which will need to set their own variables.
  2. In the spec/spec_helper.rb check for existing values for these environment variables. If they don't exist, set the dummy variable in the environment.

I can do the second if that's the desired approach. Doing the first requires admin access to the repository. Thoughts @francis ?

francis commented 1 year ago

I was thinking the first approach Peter. Hmm, but the second one is pretty easy too.

francis commented 1 year ago

@petergoldstein - I put dummy ones right in the action. This make 3 out of 5 work.

Java runtime has an issue with the debug gem. Probably should take this off of the dependencies.

For some reason, the sqlite3 gem does not support the latest ruby:

sqlite3-1.6.0-x86_64-linux requires ruby version < 3.3.dev, >= 2.7, which is 34 incompatible with the current version, 3.3.0.dev 35 Error: The process '/home/runner/.rubies/ruby-head/bin/bundle' failed with exit code 5

francis commented 1 year ago

Nevermind. You fixed this in your latest pr. It is all Green now.