DataDog/dd-agent — pull request #1154 by LeoCavaille (2014-10-10 14:55:35+00:00)
Title: New travis build system. Fix tests.

@remh if you can take a look at this :elephant: PR
Now the travis build can be run by a simple
rake ci:run

Because we use a lot of external software to run the tests and they
can use a lot of CPU/memory although the travis boxes are not so big.
Here is a very short description of what it does.

1. There are a bunch of different rake tasks ci:flavor:execute.
Each `execute` task will run like in travis 4 steps:
a. before_install (update mirrors/start stuff)
b. install
c. before_script (preload fixtures or change conf files)
d. script (the actual "build" / lint / test suite)
You can find all these tasks in the ci/ folder.
And to execute one flavor or several flavors you can use the same
high-level `ci:run` task if you set the `TRAVIS_FLAVOR` env variable
to a `flavor` or a group of flavors: `flavor1,flavor2`.
This allows the tests to run in a travis matrix and group them so
they don't overload the box.

2. Each task will also call the `common` namespace tasks as dependencies
for the 4 steps (install agent deps, conf files, install agent)

3. There is a run_tests rake task in `common`. When you call a flavored
travis build it will eventually call `run_tests` to launch the test
suite and you need to pass a `provides` array containing the deps for
this flavor.
For instance if I launch `webserver` this provides `[haproxy,nginx]`
and it will launch `nosetests` with a filter so that it runs only tests
which `requires` attributes is in the `provides` list.

Other squashed changes:
- Init set with braces is not python 2.6 compliant
See:
d = { 'test' }
^
SyntaxError: invalid syntax

- Fix nagios passive check class init
- Be less rigid to avoid flakiness on service_checks tests
However it should be fixed, this is not the expected behavior.
Somehow, before the flush things still get processed.