integ-tests/ruby/README.md
Install mise to manage ruby
installations.
Build the ruby FFI client:
cd ../engine/language_client_ruby
cargo build
mise exec -- bundle install
mise exec -- rake compile
To speed it up, you can try building the dev mode before doing rake compile:
export RB_SYS_CARGO_PROFILE="dev"
Or you can add it in-place so you don't have to export again after closing the terminal:
RB_SYS_CARGO_PROFILE="dev" mise exec -- rake compile
In this directory (integ-tests/ruby)
Install deps
mise exec -- bundle install
Generate the BAML client code:
mise exec -- rake generate
infisical run --env=test -- mise exec -- rake test
# Run a specific test file
infisical run --env=test -- mise exec -- ruby test_functions.rb
# Run a specific test
infisical run --env=test -- mise exec -- rake test test_collector.rb TEST_OPTS="--name=/test_collector_no_stream_success/ -v"
infisical (default)infisical run --env=test -- mise exec -- rake test
mise exec -- rake test
baml_client/ - Generated BAML client codetest_functions.rb - Main test filestreaming-example.rb - Streaming functionality examplestracing-demo1.rb - Tracing functionality examplesGemfile - Ruby dependenciesRakefile - Test and build tasksputs statements in your testsBAML_LOG=trace for detailed BAML client logs:BAML_LOG=trace infisical run --env=test -- mise exec -- rake test
Missing API Keys
.env file exists if not using Infisicalinfisical runBuild Issues
# Clean and rebuild
(cd ../../engine/language_client_ruby && mise exec -- rake clean compile)
mise exec -- bundle install --clean
Ruby Version Issues
mise install
mise exec -- ruby --version
mise trust
mise install
BAML Client Generation Issues
../baml_src are validrm -rf baml_client
mise exec -- baml-cli generate --from ../baml_src
Test Load Path Issues
mise exec -- ruby -I. test_functions.rb
infisical run --env=test -- mise exec -- rake test TESTOPTS="--verbose"
infisical run --env=test -- mise exec -- ruby -rdebug test_functions.rb