This repository has been archived by the owner on Mar 25, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 40
/
Rakefile.rb
69 lines (50 loc) · 1.57 KB
/
Rakefile.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
ENV['PYTHONPATH'] = './src:' + (ENV['PYTHONPATH'] or '')
# Assign some test keys if they aren't already set.
ENV["DATADOG_API_KEY"] ||= '9775a026f1ca7d1c6c5af9d94d9595a4'
ENV["DATADOG_APP_KEY"] ||= '87ce4a24b5553d2e482ea8a8500e71b8ad4554ff'
task :default => [:clean, :test, :build]
task :clean => [:clean_pyc, :clean_build, :clean_dist]
task :clean_pyc do
sh "find . -name '*.pyc' -exec rm {} \\;"
end
task :clean_build do
sh "rm -rf build/*"
end
task :clean_dist do
sh "rm -f dist/*.egg"
end
task :doc do
sh "python setup.py build_sphinx"
end
task :build do
sh "python setup.py egg_info -b '_#{build_number}' bdist_egg"
end
desc "Run the code through pylint"
task :lint do
sh "find src/dogapi -name '*.py' -type f -exec pylint --rcfile=.pylintrc --reports=n --output-format=colorized {} ';'"
sh "find src/dogshell -name '*.py' -type f -exec pylint --rcfile=.pylintrc --reports=n --output-format=colorized {} ';'"
end
namespace :test do
desc "Run integration tests."
task :integration do
sh 'nosetests --exclude ".*greenlet.*" tests/integration'
# Testing greenlet flush requires another process, so run them seperately.
sh "PYTHONPATH=src:$PYTHONPATH python tests/integration/test_stats_api_greenlet.py"
end
desc "Run unit tests."
task :unit do
sh 'nosetests tests/unit'
end
desc "Run perf tests."
task :perf do
sh 'python tests/performance/*.py'
end
end
desc "Run all tests."
task :test => ['test:unit', 'test:integration']
def build_number
ENV['BUILD_NUMBER'] || 'dev'
end
task :release do
sh "python setup.py sdist upload"
end