Skip to content

Commit

Permalink
Merge pull request openedx-unsupported#57 from edx/benp/coverage-stat…
Browse files Browse the repository at this point in the history
…s-to-datadog

Report coverage stats to datadog.
  • Loading branch information
Ben Patterson committed Feb 11, 2015
2 parents 9b75ed3 + 6b6c067 commit 78c4921
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions scripts/build-stats-to-datadog.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env bash

#
# This script will report various coverage metrics to datadog.
#
#

if [ "${TRAVIS_BRANCH}" = "master" ] && [ "${TRAVIS_PULL_REQUEST}" = "false" ] && [ -n "${DATADOG_API_KEY}" ]

then
echo "Reporting coverage stats to datadog"
git clone https://github.com/wedaly/test-metrics

cd test-metrics
virtualenv venv
source ./venv/bin/activate
pip install -q -r requirements.txt

cat > unit_test_groups.json <<END
{
"unit.analytics_data_api": "analytics_data_api/*.py"
}
END

python -m metrics.coverage unit_test_groups.json `find ../build -name "coverage.xml"`

deactivate

else
echo "Note: Not reporting stats to datadog. Those are only reported for builds on master, \
and when the datadog api key is available."

fi

0 comments on commit 78c4921

Please sign in to comment.