ddtrace 0.12.1 → 0.13.0.beta1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/.env +11 -21
  3. data/.rubocop.yml +1 -4
  4. data/Appraisals +75 -439
  5. data/CHANGELOG.md +16 -19
  6. data/Rakefile +89 -259
  7. data/circle.yml +69 -0
  8. data/ddtrace.gemspec +6 -6
  9. data/docker-compose.yml +37 -222
  10. data/docs/GettingStarted.md +260 -19
  11. data/gemfiles/contrib.gemfile +5 -0
  12. data/gemfiles/contrib_old.gemfile +4 -1
  13. data/gemfiles/rails30_postgres.gemfile +0 -1
  14. data/gemfiles/rails30_postgres_sidekiq.gemfile +0 -1
  15. data/gemfiles/rails32_mysql2.gemfile +0 -1
  16. data/gemfiles/rails32_postgres.gemfile +0 -1
  17. data/gemfiles/rails32_postgres_redis.gemfile +0 -1
  18. data/gemfiles/rails32_postgres_sidekiq.gemfile +0 -1
  19. data/gemfiles/rails5_mysql2.gemfile +1 -1
  20. data/gemfiles/rails5_postgres.gemfile +1 -1
  21. data/gemfiles/rails5_postgres_redis.gemfile +1 -1
  22. data/gemfiles/rails5_postgres_sidekiq.gemfile +1 -1
  23. data/lib/ddtrace.rb +6 -0
  24. data/lib/ddtrace/configuration.rb +2 -2
  25. data/lib/ddtrace/contrib/active_model_serializers/event.rb +57 -0
  26. data/lib/ddtrace/contrib/active_model_serializers/events.rb +30 -0
  27. data/lib/ddtrace/contrib/active_model_serializers/events/render.rb +32 -0
  28. data/lib/ddtrace/contrib/active_model_serializers/events/serialize.rb +35 -0
  29. data/lib/ddtrace/contrib/active_model_serializers/patcher.rb +62 -0
  30. data/lib/ddtrace/contrib/active_record/event.rb +30 -0
  31. data/lib/ddtrace/contrib/active_record/events.rb +30 -0
  32. data/lib/ddtrace/contrib/active_record/events/instantiation.rb +51 -0
  33. data/lib/ddtrace/contrib/active_record/events/sql.rb +48 -0
  34. data/lib/ddtrace/contrib/active_record/patcher.rb +3 -73
  35. data/lib/ddtrace/contrib/active_record/utils.rb +1 -15
  36. data/lib/ddtrace/contrib/active_support/notifications/event.rb +62 -0
  37. data/lib/ddtrace/contrib/aws/instrumentation.rb +2 -2
  38. data/lib/ddtrace/contrib/elasticsearch/patcher.rb +2 -2
  39. data/lib/ddtrace/contrib/elasticsearch/quantize.rb +8 -40
  40. data/lib/ddtrace/contrib/excon/middleware.rb +140 -0
  41. data/lib/ddtrace/contrib/excon/patcher.rb +50 -0
  42. data/lib/ddtrace/contrib/grpc/datadog_interceptor.rb +65 -0
  43. data/lib/ddtrace/contrib/grpc/datadog_interceptor/client.rb +49 -0
  44. data/lib/ddtrace/contrib/grpc/datadog_interceptor/server.rb +66 -0
  45. data/lib/ddtrace/contrib/grpc/intercept_with_datadog.rb +49 -0
  46. data/lib/ddtrace/contrib/grpc/patcher.rb +62 -0
  47. data/lib/ddtrace/contrib/http/patcher.rb +16 -18
  48. data/lib/ddtrace/contrib/racecar/event.rb +61 -0
  49. data/lib/ddtrace/contrib/racecar/events.rb +30 -0
  50. data/lib/ddtrace/contrib/racecar/events/batch.rb +27 -0
  51. data/lib/ddtrace/contrib/racecar/events/message.rb +27 -0
  52. data/lib/ddtrace/contrib/racecar/patcher.rb +6 -52
  53. data/lib/ddtrace/contrib/rack/middlewares.rb +65 -11
  54. data/lib/ddtrace/contrib/rack/patcher.rb +16 -0
  55. data/lib/ddtrace/contrib/rack/request_queue.rb +34 -0
  56. data/lib/ddtrace/contrib/rails/action_view.rb +65 -0
  57. data/lib/ddtrace/contrib/rails/active_support.rb +8 -9
  58. data/lib/ddtrace/contrib/rails/core_extensions.rb +115 -74
  59. data/lib/ddtrace/contrib/rake/instrumentation.rb +70 -0
  60. data/lib/ddtrace/contrib/rake/patcher.rb +53 -0
  61. data/lib/ddtrace/contrib/sequel/database.rb +58 -0
  62. data/lib/ddtrace/contrib/sequel/dataset.rb +59 -0
  63. data/lib/ddtrace/contrib/sequel/patcher.rb +56 -0
  64. data/lib/ddtrace/contrib/sequel/utils.rb +28 -0
  65. data/lib/ddtrace/ext/distributed.rb +5 -0
  66. data/lib/ddtrace/ext/grpc.rb +7 -0
  67. data/lib/ddtrace/ext/http.rb +35 -5
  68. data/lib/ddtrace/propagation/grpc_propagator.rb +54 -0
  69. data/lib/ddtrace/quantization/hash.rb +89 -0
  70. data/lib/ddtrace/tracer.rb +1 -4
  71. data/lib/ddtrace/utils.rb +4 -10
  72. data/lib/ddtrace/utils/database.rb +21 -0
  73. data/lib/ddtrace/version.rb +3 -3
  74. metadata +38 -13
  75. data/.circleci/config.yml +0 -456
  76. data/.circleci/images/primary/Dockerfile-1.9.3 +0 -69
  77. data/.circleci/images/primary/Dockerfile-2.0.0 +0 -69
  78. data/.circleci/images/primary/Dockerfile-2.1.10 +0 -69
  79. data/.circleci/images/primary/Dockerfile-2.2.10 +0 -69
  80. data/.circleci/images/primary/Dockerfile-2.3.7 +0 -73
  81. data/.circleci/images/primary/Dockerfile-2.4.4 +0 -73
  82. data/lib/ddtrace/contrib/rails/action_controller_patch.rb +0 -77
data/CHANGELOG.md CHANGED
@@ -4,27 +4,24 @@
4
4
 
5
5
  ## [Unreleased (beta)]
6
6
 
7
- ## [0.12.1] - 2018-06-12
7
+ ## [0.13.0.beta1] - 2018-05-09
8
8
 
9
- Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.12.1
9
+ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.13.0.beta1
10
10
 
11
- Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.12.0...v0.12.1
11
+ Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.12.0...v0.13.0.beta1
12
12
 
13
- ### Changed
14
- - Cache configuration `Proxy` objects (#446)
15
- - `freeze` more constant strings, to improve memory usage (#446)
16
- - `Utils#truncate` to use slightly less memory (#446)
17
-
18
- ### Fixed
19
- - Net/HTTP integration not permitting `service_name` to be overridden. (#407, #430) (@undergroundwebdesigns)
20
- - Block not being passed through Elasticsearch client initialization. (#421) (@shayonj)
21
- - Devise raising `NoMethodError` when bad login attempts are made. (#419, #420) (@frsantos)
22
- - AWS spans using wrong resource name (#374, #377) (@jfrancoist)
23
- - ActionView `NoMethodError` on very long traces. (#445, #447) (@jvalanen)
13
+ ### Added
14
+ - Sequel integration (supporting Ruby 2.0+) (#171, #367) (@randy-girard, @twe4ked, @palin)
15
+ - gRPC integration (supporting Ruby 2.2+) (#379, #403) (@Jared-Prime)
16
+ - ActiveModelSerializers integration (#340) (@sullimander)
17
+ - Excon integration (#211) (@walterking)
18
+ - Rake integration (supporting Ruby 2.0+, Rake 12.0+) (#409)
19
+ - Request queuing tracing to Rack (experimental) (#272)
20
+ - ActiveSupport::Notifications::Event helper for event tracing (#400)
21
+ - Request and response header tags to Rack (#389)
24
22
 
25
23
  ### Refactored
26
- - ActionController patching strategy using modules. (#439)
27
- - ActionView tracing strategy. (#445, #447)
24
+ - Hash quantization into core library (#410)
28
25
 
29
26
  ## [0.12.0] - 2018-05-08
30
27
 
@@ -307,9 +304,9 @@ Release notes: https://github.com/DataDog/dd-trace-rb/releases/tag/v0.3.1
307
304
 
308
305
  Git diff: https://github.com/DataDog/dd-trace-rb/compare/v0.3.0...v0.3.1
309
306
 
310
- [Unreleased (stable)]: https://github.com/DataDog/dd-trace-rb/compare/v0.12.1...master
311
- [Unreleased (beta)]: https://github.com/DataDog/dd-trace-rb/compare/v0.12.1...0.13-dev
312
- [0.12.1]: https://github.com/DataDog/dd-trace-rb/compare/v0.12.0...v0.12.1
307
+ [Unreleased (stable)]: https://github.com/DataDog/dd-trace-rb/compare/v0.12.0...master
308
+ [Unreleased (beta)]: https://github.com/DataDog/dd-trace-rb/compare/v0.13.0.beta1...0.13-dev
309
+ [0.13.0.beta1]: https://github.com/DataDog/dd-trace-rb/compare/v0.12.0...v0.13.0.beta1
313
310
  [0.12.0]: https://github.com/DataDog/dd-trace-rb/compare/v0.11.4...v0.12.0
314
311
  [0.12.0.rc1]: https://github.com/DataDog/dd-trace-rb/compare/v0.11.4...v0.12.0.rc1
315
312
  [0.12.0.beta2]: https://github.com/DataDog/dd-trace-rb/compare/v0.12.0.beta1...v0.12.0.beta2
data/Rakefile CHANGED
@@ -40,20 +40,25 @@ namespace :spec do
40
40
  end
41
41
 
42
42
  [
43
+ :active_model_serializers,
43
44
  :active_record,
44
45
  :active_support,
45
46
  :aws,
46
47
  :dalli,
47
48
  :elasticsearch,
49
+ :excon,
48
50
  :faraday,
49
51
  :grape,
50
52
  :graphql,
53
+ :grpc,
51
54
  :http,
52
55
  :mongodb,
53
56
  :racecar,
54
57
  :rack,
58
+ :rake,
55
59
  :redis,
56
60
  :resque,
61
+ :sequel,
57
62
  :sidekiq,
58
63
  :sinatra,
59
64
  :sucker_punch
@@ -114,10 +119,7 @@ namespace :test do
114
119
  :elasticsearch,
115
120
  :grape,
116
121
  :http,
117
- :mongodb,
118
- :resque,
119
122
  :rack,
120
- :resque,
121
123
  :sidekiq,
122
124
  :sinatra,
123
125
  :sucker_punch
@@ -142,7 +144,7 @@ end
142
144
  if RUBY_VERSION >= '2.1.0'
143
145
  RuboCop::RakeTask.new(:rubocop) do |t|
144
146
  t.options << ['-D']
145
- t.patterns = ['lib/**/*.rb', 'test/**/*.rb', 'spec/**/*.rb', 'Gemfile', 'Rakefile']
147
+ t.patterns = ['lib/**/*.rb', 'test/**/*.rb', 'Gemfile', 'Rakefile']
146
148
  end
147
149
  end
148
150
 
@@ -196,262 +198,90 @@ task :'release:docs' => :docs do
196
198
  sh "aws s3 cp --recursive doc/ s3://#{S3_BUCKET}/#{S3_DIR}/docs/"
197
199
  end
198
200
 
199
- # rubocop:disable Style/YodaCondition
200
- desc 'CI task; it runs all tests for current version of Ruby'
201
+ desc 'CI dependent task; it runs all parallel tests'
201
202
  task :ci do
202
- if RUBY_VERSION < '1.9.3'
203
- raise NotImplementedError, 'Ruby versions < 1.9.3 are not supported!'
204
- elsif '1.9.3' <= RUBY_VERSION && RUBY_VERSION < '2.0.0'
205
- # Main library
206
- sh 'rake test:main'
207
- sh 'rake spec:main'
208
-
209
- if RUBY_PLATFORM != 'java'
210
- # Contrib minitests
211
- sh 'appraisal contrib-old rake test:aws'
212
- sh 'appraisal contrib-old rake test:elasticsearch'
213
- sh 'appraisal contrib-old rake test:http'
214
- sh 'appraisal contrib-old rake test:mongodb'
215
- sh 'appraisal contrib-old rake test:monkey'
216
- sh 'appraisal contrib-old rake test:rack'
217
- sh 'appraisal contrib-old rake test:resque'
218
- sh 'appraisal contrib-old rake test:sinatra'
219
- sh 'appraisal contrib-old rake test:sucker_punch'
220
- # Contrib specs
221
- sh 'appraisal contrib-old rake spec:active_record'
222
- sh 'appraisal contrib-old rake spec:active_support'
223
- sh 'appraisal contrib-old rake spec:dalli'
224
- sh 'appraisal contrib-old rake spec:faraday'
225
- sh 'appraisal contrib-old rake spec:http'
226
- sh 'appraisal contrib-old rake spec:redis'
227
- # Rails minitests
228
- sh 'appraisal rails30-postgres rake test:rails'
229
- sh 'appraisal rails30-postgres rake test:railsdisableenv'
230
- sh 'appraisal rails32-mysql2 rake test:rails'
231
- sh 'appraisal rails32-postgres rake test:rails'
232
- sh 'appraisal rails32-postgres-redis rake test:railsredis'
233
- sh 'appraisal rails32-postgres rake test:railsdisableenv'
234
- # Rails specs
235
- sh 'appraisal rails30-postgres rake spec:rails'
236
- sh 'appraisal rails32-mysql2 rake spec:rails'
237
- sh 'appraisal rails32-postgres rake spec:rails'
238
- end
239
- elsif '2.0.0' <= RUBY_VERSION && RUBY_VERSION < '2.1.0'
240
- # Main library
241
- sh 'rake test:main'
242
- sh 'rake spec:main'
243
-
244
- if RUBY_PLATFORM != 'java'
245
- # Contrib minitests
246
- sh 'appraisal contrib-old rake test:aws'
247
- sh 'appraisal contrib-old rake test:elasticsearch'
248
- sh 'appraisal contrib-old rake test:http'
249
- sh 'appraisal contrib-old rake test:mongodb'
250
- sh 'appraisal contrib-old rake test:monkey'
251
- sh 'appraisal contrib-old rake test:rack'
252
- sh 'appraisal contrib-old rake test:resque'
253
- sh 'appraisal contrib-old rake test:sinatra'
254
- sh 'appraisal contrib-old rake test:sucker_punch'
255
- # Contrib specs
256
- sh 'appraisal contrib-old rake spec:active_record'
257
- sh 'appraisal contrib-old rake spec:active_support'
258
- sh 'appraisal contrib-old rake spec:dalli'
259
- sh 'appraisal contrib-old rake spec:faraday'
260
- sh 'appraisal contrib-old rake spec:http'
261
- sh 'appraisal contrib-old rake spec:redis'
262
- # Rails minitests
263
- sh 'appraisal contrib-old rake test:sidekiq'
264
- sh 'appraisal rails30-postgres rake test:rails'
265
- sh 'appraisal rails30-postgres rake test:railsdisableenv'
266
- sh 'appraisal rails32-mysql2 rake test:rails'
267
- sh 'appraisal rails32-postgres rake test:rails'
268
- sh 'appraisal rails32-postgres-redis rake test:railsredis'
269
- sh 'appraisal rails32-postgres rake test:railsdisableenv'
270
- sh 'appraisal rails30-postgres-sidekiq rake test:railssidekiq'
271
- sh 'appraisal rails32-postgres-sidekiq rake test:railssidekiq'
272
- # Rails specs
273
- sh 'appraisal rails30-postgres rake spec:rails'
274
- sh 'appraisal rails32-mysql2 rake spec:rails'
275
- sh 'appraisal rails32-postgres rake spec:rails'
276
- end
277
- elsif '2.1.0' <= RUBY_VERSION && RUBY_VERSION < '2.2.0'
278
- # Main library
279
- sh 'rake test:main'
280
- sh 'rake spec:main'
281
-
282
- if RUBY_PLATFORM != 'java'
283
- # Contrib minitests
284
- sh 'appraisal contrib-old rake test:aws'
285
- sh 'appraisal contrib-old rake test:elasticsearch'
286
- sh 'appraisal contrib-old rake test:http'
287
- sh 'appraisal contrib-old rake test:mongodb'
288
- sh 'appraisal contrib-old rake test:monkey'
289
- sh 'appraisal contrib-old rake test:rack'
290
- sh 'appraisal contrib-old rake test:resque'
291
- sh 'appraisal contrib-old rake test:sinatra'
292
- sh 'appraisal contrib-old rake test:sucker_punch'
293
- # Contrib specs
294
- sh 'appraisal contrib-old rake spec:active_record'
295
- sh 'appraisal contrib-old rake spec:active_support'
296
- sh 'appraisal contrib-old rake spec:dalli'
297
- sh 'appraisal contrib-old rake spec:faraday'
298
- sh 'appraisal contrib-old rake spec:http'
299
- sh 'appraisal contrib-old rake spec:redis'
300
- # Rails minitests
301
- sh 'appraisal contrib-old rake test:sidekiq'
302
- sh 'appraisal rails30-postgres rake test:rails'
303
- sh 'appraisal rails30-postgres rake test:railsdisableenv'
304
- sh 'appraisal rails32-mysql2 rake test:rails'
305
- sh 'appraisal rails32-postgres rake test:rails'
306
- sh 'appraisal rails32-postgres-redis rake test:railsredis'
307
- sh 'appraisal rails32-postgres rake test:railsdisableenv'
308
- sh 'appraisal rails4-mysql2 rake test:rails'
309
- sh 'appraisal rails4-postgres rake test:rails'
310
- sh 'appraisal rails4-postgres-redis rake test:railsredis'
311
- sh 'appraisal rails4-postgres rake test:railsdisableenv'
312
- sh 'appraisal rails30-postgres-sidekiq rake test:railssidekiq'
313
- sh 'appraisal rails32-postgres-sidekiq rake test:railssidekiq'
314
- # Rails specs
315
- sh 'appraisal rails30-postgres rake spec:rails'
316
- sh 'appraisal rails32-mysql2 rake spec:rails'
317
- sh 'appraisal rails32-postgres rake spec:rails'
318
- sh 'appraisal rails4-mysql2 rake spec:rails'
319
- sh 'appraisal rails4-postgres rake spec:rails'
320
- end
321
- elsif '2.2.0' <= RUBY_VERSION && RUBY_VERSION < '2.3.0'
322
- # Main library
323
- sh 'rake test:main'
324
- sh 'rake spec:main'
325
-
326
- if RUBY_PLATFORM != 'java'
327
- # Contrib minitests
328
- sh 'appraisal contrib rake test:aws'
329
- sh 'appraisal contrib rake test:elasticsearch'
330
- sh 'appraisal contrib rake test:grape'
331
- sh 'appraisal contrib rake test:http'
332
- sh 'appraisal contrib rake test:mongodb'
333
- sh 'appraisal contrib rake test:rack'
334
- sh 'appraisal contrib rake test:resque'
335
- sh 'appraisal contrib rake test:sucker_punch'
336
- # Contrib specs
337
- sh 'appraisal contrib rake spec:active_record'
338
- sh 'appraisal contrib rake spec:active_support'
339
- sh 'appraisal contrib rake spec:dalli'
340
- sh 'appraisal contrib rake spec:faraday'
341
- sh 'appraisal contrib rake spec:graphql'
342
- sh 'appraisal contrib rake spec:http'
343
- sh 'appraisal contrib rake spec:racecar'
344
- sh 'appraisal contrib rake spec:redis'
345
- # Rails minitests
346
- sh 'appraisal contrib rake test:sidekiq'
347
- sh 'appraisal rails30-postgres rake test:rails'
348
- sh 'appraisal rails30-postgres rake test:railsdisableenv'
349
- sh 'appraisal rails32-mysql2 rake test:rails'
350
- sh 'appraisal rails32-postgres rake test:rails'
351
- sh 'appraisal rails32-postgres-redis rake test:railsredis'
352
- sh 'appraisal rails32-postgres rake test:railsdisableenv'
353
- sh 'appraisal rails4-mysql2 rake test:rails'
354
- sh 'appraisal rails4-postgres rake test:rails'
355
- sh 'appraisal rails4-postgres-redis rake test:railsredis'
356
- sh 'appraisal rails4-postgres rake test:railsdisableenv'
357
- sh 'appraisal rails4-postgres-sidekiq rake test:railssidekiq'
358
- sh 'appraisal rails4-postgres-sidekiq rake test:railsactivejob'
359
- sh 'appraisal rails5-mysql2 rake test:rails'
360
- sh 'appraisal rails5-postgres rake test:rails'
361
- sh 'appraisal rails5-postgres-redis rake test:railsredis'
362
- sh 'appraisal rails5-postgres-sidekiq rake test:railssidekiq'
363
- sh 'appraisal rails5-postgres-sidekiq rake test:railsactivejob'
364
- sh 'appraisal rails5-postgres rake test:railsdisableenv'
365
- # Rails specs
366
- sh 'appraisal rails30-postgres rake spec:rails'
367
- sh 'appraisal rails32-mysql2 rake spec:rails'
368
- sh 'appraisal rails32-postgres rake spec:rails'
369
- sh 'appraisal rails4-mysql2 rake spec:rails'
370
- sh 'appraisal rails4-postgres rake spec:rails'
371
- sh 'appraisal rails5-mysql2 rake spec:rails'
372
- sh 'appraisal rails5-postgres rake spec:rails'
373
- end
374
- elsif '2.3.0' <= RUBY_VERSION && RUBY_VERSION < '2.4.0'
375
- # Main library
376
- sh 'rake test:main'
377
- sh 'rake spec:main'
378
-
379
- if RUBY_PLATFORM != 'java'
380
- # Contrib minitests
381
- sh 'appraisal contrib rake test:aws'
382
- sh 'appraisal contrib rake test:elasticsearch'
383
- sh 'appraisal contrib rake test:grape'
384
- sh 'appraisal contrib rake test:http'
385
- sh 'appraisal contrib rake test:mongodb'
386
- sh 'appraisal contrib rake test:rack'
387
- sh 'appraisal contrib rake test:resque'
388
- sh 'appraisal contrib rake test:sucker_punch'
389
- # Contrib specs
390
- sh 'appraisal contrib rake spec:active_record'
391
- sh 'appraisal contrib rake spec:active_support'
392
- sh 'appraisal contrib rake spec:dalli'
393
- sh 'appraisal contrib rake spec:faraday'
394
- sh 'appraisal contrib rake spec:graphql'
395
- sh 'appraisal contrib rake spec:graphql'
396
- sh 'appraisal contrib rake spec:racecar'
397
- sh 'appraisal contrib rake spec:redis'
398
- # Rails minitests
399
- sh 'appraisal contrib rake test:sidekiq'
400
- sh 'appraisal rails30-postgres rake test:rails'
401
- sh 'appraisal rails30-postgres rake test:railsdisableenv'
402
- sh 'appraisal rails32-mysql2 rake test:rails'
403
- sh 'appraisal rails32-postgres rake test:rails'
404
- sh 'appraisal rails32-postgres-redis rake test:railsredis'
405
- sh 'appraisal rails32-postgres rake test:railsdisableenv'
406
- sh 'appraisal rails4-mysql2 rake test:rails'
407
- sh 'appraisal rails4-postgres rake test:rails'
408
- sh 'appraisal rails4-postgres-redis rake test:railsredis'
409
- sh 'appraisal rails4-postgres rake test:railsdisableenv'
410
- sh 'appraisal rails4-postgres-sidekiq rake test:railssidekiq'
411
- sh 'appraisal rails4-postgres-sidekiq rake test:railsactivejob'
412
- sh 'appraisal rails5-mysql2 rake test:rails'
413
- sh 'appraisal rails5-postgres rake test:rails'
414
- sh 'appraisal rails5-postgres-redis rake test:railsredis'
415
- sh 'appraisal rails5-postgres-sidekiq rake test:railssidekiq'
416
- sh 'appraisal rails5-postgres-sidekiq rake test:railsactivejob'
417
- sh 'appraisal rails5-postgres rake test:railsdisableenv'
418
- # Rails specs
419
- sh 'appraisal rails30-postgres rake spec:rails'
420
- sh 'appraisal rails32-mysql2 rake spec:rails'
421
- sh 'appraisal rails32-postgres rake spec:rails'
422
- sh 'appraisal rails4-mysql2 rake spec:rails'
423
- sh 'appraisal rails4-postgres rake spec:rails'
424
- sh 'appraisal rails5-mysql2 rake spec:rails'
425
- sh 'appraisal rails5-postgres rake spec:rails'
426
- end
427
- elsif '2.4.0' <= RUBY_VERSION
428
- # Main library
429
- sh 'rake test:main'
430
- sh 'rake spec:main'
431
-
432
- if RUBY_PLATFORM != 'java'
433
- # Contrib minitests
434
- sh 'appraisal contrib rake test:aws'
435
- sh 'appraisal contrib rake test:elasticsearch'
436
- sh 'appraisal contrib rake test:grape'
437
- sh 'appraisal contrib rake test:http'
438
- sh 'appraisal contrib rake test:mongodb'
439
- sh 'appraisal contrib rake test:rack'
440
- sh 'appraisal contrib rake test:resque'
441
- sh 'appraisal contrib rake test:sucker_punch'
442
- # Contrib specs
443
- sh 'appraisal contrib rake spec:active_record'
444
- sh 'appraisal contrib rake spec:active_support'
445
- sh 'appraisal contrib rake spec:dalli'
446
- sh 'appraisal contrib rake spec:faraday'
447
- sh 'appraisal contrib rake spec:graphql'
448
- sh 'appraisal contrib rake spec:graphql'
449
- sh 'appraisal contrib rake spec:racecar'
450
- sh 'appraisal contrib rake spec:redis'
451
- # Rails minitests
452
- sh 'appraisal contrib rake test:sidekiq'
453
- sh 'rake benchmark'
454
- end
203
+ # CircleCI uses this environment to store the node index (starting from 0)
204
+ # check: https://circleci.com/docs/parallel-manual-setup/#env-splitting
205
+ case ENV['CIRCLE_NODE_INDEX'].to_i
206
+ when 0
207
+ sh 'rvm $MRI_VERSIONS,$MRI_OLD_VERSIONS,$JRUBY_VERSIONS --verbose do rake test:main'
208
+ # RSpec
209
+ sh 'rvm $MRI_VERSIONS,$MRI_OLD_VERSIONS,$JRUBY_VERSIONS --verbose do rake spec:main'
210
+ when 1
211
+ sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake test:elasticsearch'
212
+ sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake test:http'
213
+ sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake test:sinatra'
214
+ sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake test:rack'
215
+ sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake test:grape'
216
+ sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake test:aws'
217
+ sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake test:sucker_punch'
218
+ sh 'rvm $MRI_OLD_VERSIONS --verbose do appraisal contrib-old rake test:monkey'
219
+ sh 'rvm $MRI_OLD_VERSIONS --verbose do appraisal contrib-old rake test:elasticsearch'
220
+ sh 'rvm $MRI_OLD_VERSIONS --verbose do appraisal contrib-old rake test:http'
221
+ sh 'rvm $MRI_OLD_VERSIONS --verbose do appraisal contrib-old rake test:sinatra'
222
+ sh 'rvm $MRI_OLD_VERSIONS --verbose do appraisal contrib-old rake test:rack'
223
+ sh 'rvm $MRI_OLD_VERSIONS --verbose do appraisal contrib-old rake test:aws'
224
+ sh 'rvm $MRI_OLD_VERSIONS --verbose do appraisal contrib-old rake test:sucker_punch'
225
+ # RSpec
226
+ sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake spec:active_model_serializers'
227
+ sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake spec:active_record'
228
+ sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake spec:active_support'
229
+ sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake spec:dalli'
230
+ sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake spec:excon'
231
+ sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake spec:faraday'
232
+ sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake spec:graphql'
233
+ sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake spec:mongodb'
234
+ sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake spec:grpc'
235
+ sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake spec:racecar'
236
+ sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake spec:rake'
237
+ sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake spec:redis'
238
+ sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake spec:resque'
239
+ sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake spec:sequel'
240
+ sh 'rvm $MRI_OLD_VERSIONS --verbose do appraisal contrib-old rake spec:active_model_serializers'
241
+ sh 'rvm $MRI_OLD_VERSIONS --verbose do appraisal contrib-old rake spec:active_record'
242
+ sh 'rvm $MRI_OLD_VERSIONS --verbose do appraisal contrib-old rake spec:active_support'
243
+ sh 'rvm $MRI_OLD_VERSIONS --verbose do appraisal contrib-old rake spec:dalli'
244
+ sh 'rvm $MRI_OLD_VERSIONS --verbose do appraisal contrib-old rake spec:excon'
245
+ sh 'rvm $MRI_OLD_VERSIONS --verbose do appraisal contrib-old rake spec:faraday'
246
+ sh 'rvm $MRI_OLD_VERSIONS --verbose do appraisal contrib-old rake spec:mongodb'
247
+ sh 'rvm $MRI_OLD_VERSIONS --verbose do appraisal contrib-old rake spec:rake'
248
+ sh 'rvm $MRI_OLD_VERSIONS --verbose do appraisal contrib-old rake spec:redis'
249
+ sh 'rvm $MRI_OLD_VERSIONS --verbose do appraisal contrib-old rake spec:resque'
250
+ sh 'rvm $MRI_OLD_VERSIONS --verbose do appraisal contrib-old rake spec:sequel'
251
+ when 2
252
+ sh 'rvm $MRI_VERSIONS --verbose do appraisal contrib rake test:sidekiq'
253
+ sh 'rvm $SIDEKIQ_OLD_VERSIONS --verbose do appraisal contrib-old rake test:sidekiq'
254
+ sh 'rvm $RAILS3_VERSIONS --verbose do appraisal rails30-postgres rake test:rails'
255
+ sh 'rvm $RAILS3_VERSIONS --verbose do appraisal rails30-postgres rake test:railsdisableenv'
256
+ sh 'rvm $RAILS3_VERSIONS --verbose do appraisal rails32-mysql2 rake test:rails'
257
+ sh 'rvm $RAILS3_VERSIONS --verbose do appraisal rails32-postgres rake test:rails'
258
+ sh 'rvm $RAILS3_VERSIONS --verbose do appraisal rails32-postgres-redis rake test:railsredis'
259
+ sh 'rvm $RAILS3_VERSIONS --verbose do appraisal rails32-postgres rake test:railsdisableenv'
260
+ sh 'rvm $RAILS4_VERSIONS --verbose do appraisal rails4-mysql2 rake test:rails'
261
+ sh 'rvm $RAILS4_VERSIONS --verbose do appraisal rails4-postgres rake test:rails'
262
+ sh 'rvm $RAILS4_VERSIONS --verbose do appraisal rails4-postgres-redis rake test:railsredis'
263
+ sh 'rvm $RAILS4_VERSIONS --verbose do appraisal rails4-postgres rake test:railsdisableenv'
264
+ sh 'rvm $RAILS3_SIDEKIQ_VERSIONS --verbose do appraisal rails30-postgres-sidekiq rake test:railssidekiq'
265
+ sh 'rvm $RAILS3_SIDEKIQ_VERSIONS --verbose do appraisal rails32-postgres-sidekiq rake test:railssidekiq'
266
+ sh 'rvm $RAILS4_SIDEKIQ_VERSIONS --verbose do appraisal rails4-postgres-sidekiq rake test:railssidekiq'
267
+ sh 'rvm $RAILS4_SIDEKIQ_VERSIONS --verbose do appraisal rails4-postgres-sidekiq rake test:railsactivejob'
268
+ sh 'rvm $RAILS5_VERSIONS --verbose do appraisal rails5-mysql2 rake test:rails'
269
+ sh 'rvm $RAILS5_VERSIONS --verbose do appraisal rails5-postgres rake test:rails'
270
+ sh 'rvm $RAILS5_VERSIONS --verbose do appraisal rails5-postgres-redis rake test:railsredis'
271
+ sh 'rvm $RAILS5_VERSIONS --verbose do appraisal rails5-postgres-sidekiq rake test:railssidekiq'
272
+ sh 'rvm $RAILS5_VERSIONS --verbose do appraisal rails5-postgres-sidekiq rake test:railsactivejob'
273
+ sh 'rvm $RAILS5_VERSIONS --verbose do appraisal rails5-postgres rake test:railsdisableenv'
274
+ # RSpec
275
+ sh 'rvm $LAST_STABLE --verbose do rake benchmark'
276
+ sh 'rvm $RAILS3_VERSIONS --verbose do appraisal rails30-postgres rake spec:rails'
277
+ sh 'rvm $RAILS3_VERSIONS --verbose do appraisal rails32-mysql2 rake spec:rails'
278
+ sh 'rvm $RAILS3_VERSIONS --verbose do appraisal rails32-postgres rake spec:rails'
279
+ sh 'rvm $RAILS4_VERSIONS --verbose do appraisal rails4-mysql2 rake spec:rails'
280
+ sh 'rvm $RAILS4_VERSIONS --verbose do appraisal rails4-postgres rake spec:rails'
281
+ sh 'rvm $RAILS5_VERSIONS --verbose do appraisal rails5-mysql2 rake spec:rails'
282
+ sh 'rvm $RAILS5_VERSIONS --verbose do appraisal rails5-postgres rake spec:rails'
283
+ else
284
+ puts 'Too many workers than parallel tasks'
455
285
  end
456
286
  end
457
287
 
data/circle.yml ADDED
@@ -0,0 +1,69 @@
1
+ machine:
2
+ services:
3
+ - docker
4
+ ruby:
5
+ version:
6
+ 2.2.7
7
+ environment:
8
+ LAST_STABLE: 2.4.1
9
+ EARLY_STABLE: 2.2.7
10
+ MRI_VERSIONS: 2.4.1,2.3.4,2.2.7
11
+ MRI_OLD_VERSIONS: 2.1.10,2.0.0,1.9.3
12
+ SIDEKIQ_OLD_VERSIONS: 2.1.10,2.0.0
13
+ RAILS3_VERSIONS: 2.3.4,2.2.7,2.1.10,2.0.0,1.9.3
14
+ RAILS4_VERSIONS: 2.3.4,2.2.7,2.1.10
15
+ RAILS5_VERSIONS: 2.3.4,2.2.7
16
+ RAILS3_SIDEKIQ_VERSIONS: 2.1.10,2.0.0
17
+ RAILS4_SIDEKIQ_VERSIONS: 2.3.4,2.2.7
18
+ JRUBY_VERSIONS: jruby-9.1.13.0
19
+ AGENT_BUILD_PATH: "/home/ubuntu/agent"
20
+ TEST_DATADOG_INTEGRATION: 1
21
+
22
+ dependencies:
23
+ cache_directories:
24
+ # Cache Ruby binaries and gems
25
+ - "/opt/circleci/.rvm/"
26
+ - ~/rubies_cache
27
+ pre:
28
+ - mkdir -p ~/rubies_cache
29
+ - rsync -a -v --ignore-existing ~/rubies_cache/ /opt/circleci/.rvm/rubies
30
+ # we should use an old docker-compose because CircleCI supports
31
+ # only docker-engine==1.9
32
+ - pip install docker-compose==1.7.1
33
+ - docker-compose up -d | cat
34
+ # installing dev dependencies
35
+ - |
36
+ for version in $(echo "$MRI_VERSIONS,$MRI_OLD_VERSIONS,$JRUBY_VERSIONS" | tr "," "\n"); do
37
+ $(rvm list | grep -q $version) || rvm install $version --rubygems 2.6.11
38
+ done
39
+ - gem install bundler
40
+ # remove line below once `msgpack` have a consistent version for jruby
41
+ - bundle inject msgpack 1.1.0 && sed -i "y/\"/'/" Gemfile
42
+ - bundle install
43
+ override:
44
+ - rvm $MRI_VERSIONS,$MRI_OLD_VERSIONS,$JRUBY_VERSIONS --verbose do gem install bundler
45
+ - rvm $MRI_VERSIONS,$MRI_OLD_VERSIONS,$JRUBY_VERSIONS --verbose do bundle install
46
+ # [FIXME] appraisal does not work with jruby (problem with native ext, eg sqlite3)
47
+ - rvm $MRI_VERSIONS,$MRI_OLD_VERSIONS --verbose do bundle exec appraisal install || echo FIX-ME: Ignoring non-zero exit status
48
+ post:
49
+ - rsync -a -v --ignore-existing /opt/circleci/.rvm/rubies/ ~/rubies_cache
50
+
51
+ test:
52
+ override:
53
+ - rvm $EARLY_STABLE --verbose do bundle exec rake rubocop
54
+ # TODO: integration tests should run with the master branch of the agent
55
+ - bundle exec rake ci:
56
+ parallel: true
57
+
58
+ deployment:
59
+ develop:
60
+ branch: /(master)|(develop)/
61
+ # CircleCI is configured to provide VERSION_SUFFIX=$CIRCLE_BUILD_NUM
62
+ commands:
63
+ - S3_DIR=trace-dev bundle exec rake release:docs
64
+ - S3_DIR=trace-dev bundle exec rake release:gem
65
+ - cp -r ./rubygems/* $CIRCLE_ARTIFACTS
66
+ public:
67
+ tag: /v[0-9]+(\.[0-9]+)*/
68
+ commands:
69
+ - S3_DIR=trace bundle exec rake release:docs