From 42a7173c4cc5adc1b83644045080a5b1e941095a Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev <156273877+p-datadog@users.noreply.github.com> Date: Fri, 10 Jan 2025 10:07:46 -0500 Subject: [PATCH] Instructions for running integration tests (#4260) Co-authored-by: Oleg Pudeyev --- integration/README.md | 46 +++++++++++++++++++++++++ integration/apps/rails-seven/.gitignore | 2 ++ 2 files changed, 48 insertions(+) diff --git a/integration/README.md b/integration/README.md index 0f1e86f0622..2daf0707c61 100644 --- a/integration/README.md +++ b/integration/README.md @@ -42,6 +42,52 @@ The `images/` folders hosts some images for Ruby applications. Ruby base images include `Datadog::DemoEnv` and other helpers. +### Running Integration Tests + +1. Pick an application to run the tests against: + + ``` + cd apps/rails-seven + ``` + +2. Pick a Ruby version and build Docker images: + + ``` + ./script/build-images -v 3.3 + ``` + +Note: you need to build the images using this command whenever you make +any changes in the source code. + +3. Run integration test script: + + ``` + ./script/ci -v 3.3 + ``` + +### Running Integration Tests Not In Docker + +Run the test application manually (in a separate terminal): + +``` +cd apps/rails-seven +export RUBYOPT=-I../../images/include +# Use local dd-trace-rb tree +export DD_DEMO_ENV_GEM_LOCAL_DATADOG=../../.. +export DATABASE_URL=mysql2://user:password@localhost:3306 +bundle exec rake db:create db:migrate +bundle exec rails server -p 3000 +``` + +Run the tests: + +``` +cd apps/rails-seven +export RUBYOPT=-I../../images/include +export TEST_INTEGRATION=1 TEST_HOSTNAME=localhost TEST_PORT=3000 +bundle exec rspec +``` + ### Debugging #### Profiling memory diff --git a/integration/apps/rails-seven/.gitignore b/integration/apps/rails-seven/.gitignore index c91ff4d0528..758cff842c5 100644 --- a/integration/apps/rails-seven/.gitignore +++ b/integration/apps/rails-seven/.gitignore @@ -37,3 +37,5 @@ # Ignore local variables /index.html* .envrc + +db/schema.rb