Quick development Setup
To get started developing with the integrations-core repo you will need:
To install rvm:
- Make sure you have xcode and accepted the license:
sudo xcode-select --install
curl -L https://get.rvm.io | bash -s stable --auto-dotfiles --autolibs=enable --ruby
We’ve written a gem and a set of scripts to help you get set up, ease development, and provide testing. To begin:
gem install bundler
Once the required Ruby gems have been installed by Bundler, you can easily create a Python environment:
rake setup_env. This will install a Python virtual environment along with all the components necessary for integration development including the core agent used by the integrations. (Note that it clones the agent repo, which branch is used is configured by the env variable
ENV['DD_AGENT_BRANCH']in the RakeFile.) Some basic software might be needed to install the python dependencies like
source venv/bin/activateto activate the installed Python virtual environment. To exit the virtual environment, run
deactivate. You can learn more about the Python virtual environment on the Virtualenv documentation.
This is a quick setup but from that point you should be able to run the default test suit
To go beyond we advise you to read the full documentation here.
Installing the Integration tests
bundle install # When this fails, check whether the python2 executable is available (solvable with symlink) # When this fails without venv, just retry with the venv rake setup_env ./fix-shadowing.sh source venv/bin/activate
Please note that on a macbook not all integration tests will pass, because some tests only work on unix. (e.g. test_cx_state_linux_ss)
For a check with underscores in its name, its package name replaces underscores with dashes. For example, the
powerdns_recursor check is packaged as
Run a single test:
For more details on how the rake infrastructure is set up see the Rakefile and /var/lib/gems/2.3.0/gems/datadog-sdk-testing-0.5.1/lib/sdk.rake
Switching dd-agent branches:
Update the branch in .travis-ci Update the branch in Rakefile rm -rf embedded/dd-agent Rerun setup_env
Running the agent from the dev environment
First do the setup of running integration tests
./run.sh install to install all checks and config files in embedded/dd-agent.
Edit the config file in embedded/dd-agent and embedded/dd-agent/conf.d for the checks you want to run.
./run.sh start to start and
./run.sh stop to stop.
if you have situation, when rake commands fail to find
obvious solution would be use
bundle exec rake <original command> to ensure,
that gem installed from source is found.
If you experience import errors near
add agent directory