datadog-sdk-testing 0.6.1 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9fc133c1e25fece76c1e11cf6c727aa694de449b
4
- data.tar.gz: 54ac372d37276d36f4a2cde6721fbfd95509801c
3
+ metadata.gz: 28e212865bba71f36ee6c349e14cf68370b214cb
4
+ data.tar.gz: a5d7b16ac29f232f03489a1230390efe0d069bc2
5
5
  SHA512:
6
- metadata.gz: 7dd9cc22b242ac9620771459094bc106130ae4bde45a20cf9fa1f8474ee6d02c92c7005979719ea19360d2fcaa47670041b6c177d24f37730005dae1e4a2f103
7
- data.tar.gz: 7f8d96d57c8b5c44e7a5b213913707fe9b7d9f57c969aa6fa11217e86105e5badd339765bba058429d767af9ec8e936b976ee3e7fc85629c6851dbc57663f4f5
6
+ metadata.gz: 91173bd2879394a227fd354033ac83c4440c374f8a51d1cd62e66e4e8d037b7ffe20b56a6cd17efb382979a95fd16e019d11ed4c3a753d01c412ad7a142296bb
7
+ data.tar.gz: dc7e5dd9290400c34c8c88d9dcce969fb45ea76feb9e01a70e1d1c502553e7c0d8df1e629bca6c4e6b65e2ac66bdbdbb70cf881058f1ed54902b89265cffc55e
@@ -40,7 +40,7 @@ namespace :ci do
40
40
  task :execute do
41
41
  exception = nil
42
42
  begin
43
- %w(before_install install before_script).each do |u|
43
+ %w[before_install install before_script].each do |u|
44
44
  Rake::Task["#{flavor.scope.path}:#{u}"].invoke
45
45
  end
46
46
  if !ENV['SKIP_TEST']
@@ -12,8 +12,12 @@ def check_env
12
12
  abort 'SDK_HOME env variable must be defined in your Rakefile to used this gem.' unless ENV['SDK_HOME']
13
13
  end
14
14
 
15
+ def in_ci_env
16
+ ENV['TRAVIS'] || ENV['CIRCLECI']
17
+ end
18
+
15
19
  def travis_circle_env
16
- abort 'You are not in a Travis/Circle CI environment, this task wont apply.' if !ENV['TRAVIS'] && !ENV['CIRCLECI']
20
+ abort 'You are not in a Travis/Circle CI environment, this task wont apply.' unless in_ci_env
17
21
  end
18
22
 
19
23
  def sed(source, op, a, b, mods)
@@ -47,6 +47,25 @@ namespace :ci do
47
47
  sh "#{gem_home}/lib/tasks/ci/hooks/pre-commit.py"
48
48
  end
49
49
 
50
+ task :requirements_file do
51
+ check_env
52
+ violations = []
53
+ # The * is to match any other potential requirement files added later (e.g. requirements-opt)
54
+ req_file_paths = Dir.glob("#{ENV['SDK_HOME']}/*/requirements*.txt")
55
+ req_file_paths.each do |req_file_path|
56
+ f = File.open(req_file_path, 'r')
57
+ reqs = f.read
58
+ reqs[reqs.length - 1] != "\n" && violations.push(req_file_path)
59
+ f.close
60
+ end
61
+ unless violations.empty?
62
+ violations.each do |violation|
63
+ p "violation found: #{violation}"
64
+ end
65
+ raise 'requirements files all must end with a newline.'
66
+ end
67
+ end
68
+
50
69
  task script: ['ci:common:script', :coverage, :lint] do
51
70
  check_env
52
71
  Rake::Task['ci:common:run_tests'].invoke(['default'])
@@ -57,8 +76,7 @@ namespace :ci do
57
76
  task :execute do
58
77
  exception = nil
59
78
  begin
60
- %w(before_install install before_script
61
- script).each do |t|
79
+ %w[before_install install before_script script].each do |t|
62
80
  Rake::Task["#{flavor.scope.path}:#{t}"].invoke
63
81
  end
64
82
  rescue => e
data/lib/tasks/sdk.rake CHANGED
@@ -5,6 +5,7 @@
5
5
  require 'rake/clean'
6
6
  require 'rubocop/rake_task'
7
7
  require 'bundler'
8
+ require 'english'
8
9
 
9
10
  # Flavored Travis CI jobs
10
11
  require 'ci/default'
@@ -39,6 +40,16 @@ task 'setup_env' do
39
40
  FileUtils.rm Dir.glob('setuptools*.zip')
40
41
  end
41
42
 
43
+ desc 'Grab latest external dd-agent libraries'
44
+ task 'setup_agent_libs' do
45
+ check_env
46
+ agent_dir = in_ci_env ? "#{ENV['HOME']}/dd-agent/" : "#{ENV['SDK_HOME']}/embedded/dd-agent/"
47
+
48
+ `cd #{agent_dir} && rake -T | grep setup_libs > /dev/null 2>&1`
49
+ next if $CHILD_STATUS.exitstatus != 0
50
+ `cd #{agent_dir} && rake setup_libs`
51
+ end
52
+
42
53
  desc 'Clean development environment for the SDK (remove!)'
43
54
  task 'clean_env' do
44
55
  check_env
@@ -120,6 +131,10 @@ desc 'Find requirements conflicts'
120
131
  task 'requirements' => ['ci:default:requirements'] do
121
132
  end
122
133
 
134
+ desc 'Check that requirements files are properly structured'
135
+ task 'requirements_file' => ['ci:default:requirements_file'] do
136
+ end
137
+
123
138
  namespace :generate do
124
139
  desc 'Setup a development environment for the SDK'
125
140
  task :skeleton, :option do |_, args|
@@ -150,7 +165,7 @@ namespace :ci do
150
165
  puts 'Assuming you are running these tests locally' unless ENV['TRAVIS']
151
166
  flavor = args[:flavor] || ENV['TRAVIS_FLAVOR'] || 'default'
152
167
  can_skip, checks = can_skip?
153
- can_skip &&= !%w(default).include?(flavor)
168
+ can_skip &&= !%w[default].include?(flavor)
154
169
 
155
170
  flavors = flavor.split(',')
156
171
  flavors.each do |f|
@@ -163,4 +178,4 @@ namespace :ci do
163
178
  end
164
179
  end
165
180
 
166
- task default: ['lint', 'ci:run']
181
+ task default: ['lint', 'requirements_file', 'ci:run']
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: datadog-sdk-testing
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jaime Fullaondo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-30 00:00:00.000000000 Z
11
+ date: 2017-05-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
108
  version: '0'
109
109
  requirements: []
110
110
  rubyforge_project:
111
- rubygems_version: 2.6.8
111
+ rubygems_version: 2.4.6
112
112
  signing_key:
113
113
  specification_version: 4
114
114
  summary: Datadog Integration SDK testing/scaffolding facilities.