chillout 0.6.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +3 -0
- data/.travis.yml +45 -9
- data/CHANGELOG.md +14 -0
- data/Gemfile +8 -0
- data/README.md +43 -7
- data/Rakefile +17 -2
- data/chillout.gemspec +21 -10
- data/lib/chillout/client.rb +26 -5
- data/lib/chillout/config.rb +15 -0
- data/lib/chillout/creation_listener.rb +10 -5
- data/lib/chillout/custom_metric.rb +27 -0
- data/lib/chillout/integrations/sidekiq.rb +22 -0
- data/lib/chillout/job.rb +12 -0
- data/lib/chillout/listener_injector.rb +23 -0
- data/lib/chillout/middleware/creations_monitor.rb +1 -1
- data/lib/chillout/middleware/sidekiq.rb +21 -0
- data/lib/chillout/railtie.rb +12 -14
- data/lib/chillout/server_side/dispatcher.rb +1 -1
- data/lib/chillout/server_side/plain_http_client.rb +22 -2
- data/lib/chillout/version.rb +1 -1
- data/lib/chillout/worker.rb +5 -5
- data/lib/chillout.rb +11 -0
- data/test/acceptance/client_sends_metrics_test.rb +21 -0
- data/test/acceptance/sidekiq_workers_send_metrics_test.rb +22 -0
- data/test/config_test.rb +31 -1
- data/test/custom_metric_test.rb +15 -0
- data/test/event_data_builder_test.rb +47 -41
- data/test/integration/client_test.rb +78 -4
- data/test/integration/worker_test.rb +3 -2
- data/test/middleware/creations_monitor_test.rb +28 -29
- data/test/middleware/sidekiq_test.rb +45 -0
- data/test/plain_http_client_test.rb +13 -0
- data/test/support/rails_3_2_13/Gemfile +5 -0
- data/test/support/rails_3_2_13/Rakefile +7 -0
- data/test/support/rails_3_2_13/app/controllers/application_controller.rb +3 -0
- data/test/support/rails_3_2_13/app/controllers/entities_controller.rb +70 -0
- data/test/support/rails_3_2_13/app/helpers/application_helper.rb +2 -0
- data/test/support/rails_3_2_13/app/models/entity.rb +3 -0
- data/test/support/rails_3_2_13/app/views/entities/_form.html.erb +21 -0
- data/test/support/rails_3_2_13/app/views/entities/edit.html.erb +6 -0
- data/test/support/rails_3_2_13/app/views/entities/index.html.erb +23 -0
- data/test/support/rails_3_2_13/app/views/entities/new.html.erb +5 -0
- data/test/support/rails_3_2_13/app/views/entities/show.html.erb +10 -0
- data/test/support/rails_3_2_13/app/views/layouts/application.html.erb +14 -0
- data/test/support/rails_3_2_13/config/application.rb +63 -0
- data/test/support/rails_3_2_13/config/boot.rb +6 -0
- data/test/support/rails_3_2_13/config/database.yml +11 -0
- data/test/support/rails_3_2_13/config/environment.rb +5 -0
- data/test/support/rails_3_2_13/config/environments/development.rb +32 -0
- data/test/support/rails_3_2_13/config/environments/production.rb +56 -0
- data/test/support/rails_3_2_13/config/environments/test.rb +37 -0
- data/test/support/rails_3_2_13/config/initializers/backtrace_silencers.rb +7 -0
- data/test/support/rails_3_2_13/config/initializers/inflections.rb +15 -0
- data/test/support/rails_3_2_13/config/initializers/load_schema.rb +4 -0
- data/test/support/rails_3_2_13/config/initializers/mime_types.rb +5 -0
- data/test/support/rails_3_2_13/config/initializers/secret_token.rb +7 -0
- data/test/support/rails_3_2_13/config/initializers/session_store.rb +8 -0
- data/test/support/rails_3_2_13/config/initializers/wrap_parameters.rb +14 -0
- data/test/support/rails_3_2_13/config/locales/en.yml +5 -0
- data/test/support/rails_3_2_13/config/routes.rb +3 -0
- data/test/support/rails_3_2_13/config.ru +4 -0
- data/test/support/rails_3_2_13/db/schema.rb +22 -0
- data/test/support/rails_3_2_13/public/404.html +26 -0
- data/test/support/rails_3_2_13/public/422.html +26 -0
- data/test/support/rails_3_2_13/public/500.html +25 -0
- data/test/support/rails_3_2_13/public/favicon.ico +0 -0
- data/test/support/rails_3_2_13/public/robots.txt +5 -0
- data/test/support/rails_3_2_13/script/rails +6 -0
- data/test/support/rails_4_0_0/Gemfile +5 -0
- data/test/support/rails_4_0_0/Rakefile +6 -0
- data/test/support/rails_4_0_0/app/controllers/application_controller.rb +5 -0
- data/test/support/rails_4_0_0/app/controllers/concerns/.keep +0 -0
- data/test/support/rails_4_0_0/app/controllers/entities_controller.rb +70 -0
- data/test/support/rails_4_0_0/app/helpers/application_helper.rb +2 -0
- data/test/support/rails_4_0_0/app/models/.keep +0 -0
- data/test/support/rails_4_0_0/app/models/concerns/.keep +0 -0
- data/test/support/rails_4_0_0/app/models/entity.rb +2 -0
- data/test/support/rails_4_0_0/app/views/entities/_form.html.erb +21 -0
- data/test/support/rails_4_0_0/app/views/entities/edit.html.erb +6 -0
- data/test/support/rails_4_0_0/app/views/entities/index.html.erb +23 -0
- data/test/support/rails_4_0_0/app/views/entities/new.html.erb +5 -0
- data/test/support/rails_4_0_0/app/views/entities/show.html.erb +10 -0
- data/test/support/rails_4_0_0/app/views/layouts/application.html.erb +14 -0
- data/test/support/rails_4_0_0/config/application.rb +31 -0
- data/test/support/rails_4_0_0/config/boot.rb +4 -0
- data/test/support/rails_4_0_0/config/database.yml +11 -0
- data/test/support/rails_4_0_0/config/environment.rb +5 -0
- data/test/support/rails_4_0_0/config/environments/development.rb +25 -0
- data/test/support/rails_4_0_0/config/environments/production.rb +67 -0
- data/test/support/rails_4_0_0/config/environments/test.rb +36 -0
- data/test/support/rails_4_0_0/config/initializers/backtrace_silencers.rb +7 -0
- data/test/support/rails_4_0_0/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/support/rails_4_0_0/config/initializers/inflections.rb +16 -0
- data/test/support/rails_4_0_0/config/initializers/load_schema.rb +4 -0
- data/test/support/rails_4_0_0/config/initializers/mime_types.rb +5 -0
- data/test/support/rails_4_0_0/config/initializers/secret_token.rb +12 -0
- data/test/support/rails_4_0_0/config/initializers/session_store.rb +3 -0
- data/test/support/rails_4_0_0/config/initializers/wrap_parameters.rb +14 -0
- data/test/support/rails_4_0_0/config/locales/en.yml +23 -0
- data/test/support/rails_4_0_0/config/routes.rb +3 -0
- data/test/support/rails_4_0_0/config.ru +4 -0
- data/test/support/rails_4_0_0/db/schema.rb +22 -0
- data/test/support/rails_4_0_0/lib/assets/.keep +0 -0
- data/test/support/rails_4_0_0/lib/tasks/.keep +0 -0
- data/test/support/rails_4_0_0/public/404.html +58 -0
- data/test/support/rails_4_0_0/public/422.html +58 -0
- data/test/support/rails_4_0_0/public/500.html +57 -0
- data/test/support/rails_4_0_0/public/favicon.ico +0 -0
- data/test/support/rails_4_0_0/public/robots.txt +5 -0
- data/test/support/rails_4_0_0/script/bundle +3 -0
- data/test/support/rails_4_0_0/script/rails +4 -0
- data/test/support/rails_4_0_0/script/rake +4 -0
- data/test/support/rails_4_0_13/Gemfile +5 -0
- data/test/support/rails_4_0_13/Rakefile +6 -0
- data/test/support/rails_4_0_13/app/controllers/application_controller.rb +5 -0
- data/test/support/rails_4_0_13/app/controllers/concerns/.keep +0 -0
- data/test/support/rails_4_0_13/app/controllers/entities_controller.rb +70 -0
- data/test/support/rails_4_0_13/app/helpers/application_helper.rb +2 -0
- data/test/support/rails_4_0_13/app/models/.keep +0 -0
- data/test/support/rails_4_0_13/app/models/concerns/.keep +0 -0
- data/test/support/rails_4_0_13/app/models/entity.rb +2 -0
- data/test/support/rails_4_0_13/app/views/entities/_form.html.erb +21 -0
- data/test/support/rails_4_0_13/app/views/entities/edit.html.erb +6 -0
- data/test/support/rails_4_0_13/app/views/entities/index.html.erb +23 -0
- data/test/support/rails_4_0_13/app/views/entities/new.html.erb +5 -0
- data/test/support/rails_4_0_13/app/views/entities/show.html.erb +10 -0
- data/test/support/rails_4_0_13/app/views/layouts/application.html.erb +14 -0
- data/test/support/rails_4_0_13/config/application.rb +31 -0
- data/test/support/rails_4_0_13/config/boot.rb +4 -0
- data/test/support/rails_4_0_13/config/database.yml +11 -0
- data/test/support/rails_4_0_13/config/environment.rb +5 -0
- data/test/support/rails_4_0_13/config/environments/development.rb +25 -0
- data/test/support/rails_4_0_13/config/environments/production.rb +67 -0
- data/test/support/rails_4_0_13/config/environments/test.rb +36 -0
- data/test/support/rails_4_0_13/config/initializers/backtrace_silencers.rb +7 -0
- data/test/support/rails_4_0_13/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/support/rails_4_0_13/config/initializers/inflections.rb +16 -0
- data/test/support/rails_4_0_13/config/initializers/load_schema.rb +4 -0
- data/test/support/rails_4_0_13/config/initializers/mime_types.rb +5 -0
- data/test/support/rails_4_0_13/config/initializers/secret_token.rb +12 -0
- data/test/support/rails_4_0_13/config/initializers/session_store.rb +3 -0
- data/test/support/rails_4_0_13/config/initializers/wrap_parameters.rb +14 -0
- data/test/support/rails_4_0_13/config/locales/en.yml +23 -0
- data/test/support/rails_4_0_13/config/routes.rb +3 -0
- data/test/support/rails_4_0_13/config.ru +4 -0
- data/test/support/rails_4_0_13/db/schema.rb +22 -0
- data/test/support/rails_4_0_13/lib/assets/.keep +0 -0
- data/test/support/rails_4_0_13/lib/tasks/.keep +0 -0
- data/test/support/rails_4_0_13/public/404.html +58 -0
- data/test/support/rails_4_0_13/public/422.html +58 -0
- data/test/support/rails_4_0_13/public/500.html +57 -0
- data/test/support/rails_4_0_13/public/favicon.ico +0 -0
- data/test/support/rails_4_0_13/public/robots.txt +5 -0
- data/test/support/rails_4_0_13/script/bundle +3 -0
- data/test/support/rails_4_0_13/script/rails +4 -0
- data/test/support/rails_4_0_13/script/rake +4 -0
- data/test/support/rails_4_1_0/Gemfile +5 -0
- data/test/support/rails_4_1_0/Rakefile +6 -0
- data/test/support/rails_4_1_0/app/controllers/application_controller.rb +5 -0
- data/test/support/rails_4_1_0/app/controllers/concerns/.keep +0 -0
- data/test/support/rails_4_1_0/app/controllers/entities_controller.rb +70 -0
- data/test/support/rails_4_1_0/app/helpers/application_helper.rb +2 -0
- data/test/support/rails_4_1_0/app/models/.keep +0 -0
- data/test/support/rails_4_1_0/app/models/concerns/.keep +0 -0
- data/test/support/rails_4_1_0/app/models/entity.rb +2 -0
- data/test/support/rails_4_1_0/app/views/entities/_form.html.erb +21 -0
- data/test/support/rails_4_1_0/app/views/entities/edit.html.erb +6 -0
- data/test/support/rails_4_1_0/app/views/entities/index.html.erb +23 -0
- data/test/support/rails_4_1_0/app/views/entities/new.html.erb +5 -0
- data/test/support/rails_4_1_0/app/views/entities/show.html.erb +10 -0
- data/test/support/rails_4_1_0/app/views/layouts/application.html.erb +14 -0
- data/test/support/rails_4_1_0/config/application.rb +31 -0
- data/test/support/rails_4_1_0/config/boot.rb +4 -0
- data/test/support/rails_4_1_0/config/database.yml +11 -0
- data/test/support/rails_4_1_0/config/environment.rb +5 -0
- data/test/support/rails_4_1_0/config/environments/development.rb +25 -0
- data/test/support/rails_4_1_0/config/environments/production.rb +67 -0
- data/test/support/rails_4_1_0/config/environments/test.rb +36 -0
- data/test/support/rails_4_1_0/config/initializers/backtrace_silencers.rb +7 -0
- data/test/support/rails_4_1_0/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/support/rails_4_1_0/config/initializers/inflections.rb +16 -0
- data/test/support/rails_4_1_0/config/initializers/load_schema.rb +4 -0
- data/test/support/rails_4_1_0/config/initializers/mime_types.rb +5 -0
- data/test/support/rails_4_1_0/config/initializers/secret_token.rb +12 -0
- data/test/support/rails_4_1_0/config/initializers/session_store.rb +3 -0
- data/test/support/rails_4_1_0/config/initializers/wrap_parameters.rb +14 -0
- data/test/support/rails_4_1_0/config/locales/en.yml +23 -0
- data/test/support/rails_4_1_0/config/routes.rb +3 -0
- data/test/support/rails_4_1_0/config.ru +4 -0
- data/test/support/rails_4_1_0/db/schema.rb +22 -0
- data/test/support/rails_4_1_0/lib/assets/.keep +0 -0
- data/test/support/rails_4_1_0/lib/tasks/.keep +0 -0
- data/test/support/rails_4_1_0/public/404.html +58 -0
- data/test/support/rails_4_1_0/public/422.html +58 -0
- data/test/support/rails_4_1_0/public/500.html +57 -0
- data/test/support/rails_4_1_0/public/favicon.ico +0 -0
- data/test/support/rails_4_1_0/public/robots.txt +5 -0
- data/test/support/rails_4_1_0/script/bundle +3 -0
- data/test/support/rails_4_1_0/script/rails +4 -0
- data/test/support/rails_4_1_0/script/rake +4 -0
- data/test/support/rails_4_1_16/Gemfile +5 -0
- data/test/support/rails_4_1_16/Rakefile +6 -0
- data/test/support/rails_4_1_16/app/controllers/application_controller.rb +5 -0
- data/test/support/rails_4_1_16/app/controllers/concerns/.keep +0 -0
- data/test/support/rails_4_1_16/app/controllers/entities_controller.rb +70 -0
- data/test/support/rails_4_1_16/app/helpers/application_helper.rb +2 -0
- data/test/support/rails_4_1_16/app/models/.keep +0 -0
- data/test/support/rails_4_1_16/app/models/concerns/.keep +0 -0
- data/test/support/rails_4_1_16/app/models/entity.rb +2 -0
- data/test/support/rails_4_1_16/app/views/entities/_form.html.erb +21 -0
- data/test/support/rails_4_1_16/app/views/entities/edit.html.erb +6 -0
- data/test/support/rails_4_1_16/app/views/entities/index.html.erb +23 -0
- data/test/support/rails_4_1_16/app/views/entities/new.html.erb +5 -0
- data/test/support/rails_4_1_16/app/views/entities/show.html.erb +10 -0
- data/test/support/rails_4_1_16/app/views/layouts/application.html.erb +14 -0
- data/test/support/rails_4_1_16/config/application.rb +31 -0
- data/test/support/rails_4_1_16/config/boot.rb +4 -0
- data/test/support/rails_4_1_16/config/database.yml +11 -0
- data/test/support/rails_4_1_16/config/environment.rb +5 -0
- data/test/support/rails_4_1_16/config/environments/development.rb +25 -0
- data/test/support/rails_4_1_16/config/environments/production.rb +67 -0
- data/test/support/rails_4_1_16/config/environments/test.rb +36 -0
- data/test/support/rails_4_1_16/config/initializers/backtrace_silencers.rb +7 -0
- data/test/support/rails_4_1_16/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/support/rails_4_1_16/config/initializers/inflections.rb +16 -0
- data/test/support/rails_4_1_16/config/initializers/load_schema.rb +4 -0
- data/test/support/rails_4_1_16/config/initializers/mime_types.rb +5 -0
- data/test/support/rails_4_1_16/config/initializers/secret_token.rb +12 -0
- data/test/support/rails_4_1_16/config/initializers/session_store.rb +3 -0
- data/test/support/rails_4_1_16/config/initializers/wrap_parameters.rb +14 -0
- data/test/support/rails_4_1_16/config/locales/en.yml +23 -0
- data/test/support/rails_4_1_16/config/routes.rb +3 -0
- data/test/support/rails_4_1_16/config.ru +4 -0
- data/test/support/rails_4_1_16/db/schema.rb +22 -0
- data/test/support/rails_4_1_16/lib/assets/.keep +0 -0
- data/test/support/rails_4_1_16/lib/tasks/.keep +0 -0
- data/test/support/rails_4_1_16/public/404.html +58 -0
- data/test/support/rails_4_1_16/public/422.html +58 -0
- data/test/support/rails_4_1_16/public/500.html +57 -0
- data/test/support/rails_4_1_16/public/favicon.ico +0 -0
- data/test/support/rails_4_1_16/public/robots.txt +5 -0
- data/test/support/rails_4_1_16/script/bundle +3 -0
- data/test/support/rails_4_1_16/script/rails +4 -0
- data/test/support/rails_4_1_16/script/rake +4 -0
- data/test/support/rails_4_2_0/Gemfile +5 -0
- data/test/support/rails_4_2_0/Rakefile +6 -0
- data/test/support/rails_4_2_0/app/controllers/application_controller.rb +5 -0
- data/test/support/rails_4_2_0/app/controllers/concerns/.keep +0 -0
- data/test/support/rails_4_2_0/app/controllers/entities_controller.rb +70 -0
- data/test/support/rails_4_2_0/app/helpers/application_helper.rb +2 -0
- data/test/support/rails_4_2_0/app/models/.keep +0 -0
- data/test/support/rails_4_2_0/app/models/concerns/.keep +0 -0
- data/test/support/rails_4_2_0/app/models/entity.rb +2 -0
- data/test/support/rails_4_2_0/app/views/entities/_form.html.erb +21 -0
- data/test/support/rails_4_2_0/app/views/entities/edit.html.erb +6 -0
- data/test/support/rails_4_2_0/app/views/entities/index.html.erb +23 -0
- data/test/support/rails_4_2_0/app/views/entities/new.html.erb +5 -0
- data/test/support/rails_4_2_0/app/views/entities/show.html.erb +10 -0
- data/test/support/rails_4_2_0/app/views/layouts/application.html.erb +14 -0
- data/test/support/rails_4_2_0/config/application.rb +31 -0
- data/test/support/rails_4_2_0/config/boot.rb +4 -0
- data/test/support/rails_4_2_0/config/database.yml +11 -0
- data/test/support/rails_4_2_0/config/environment.rb +5 -0
- data/test/support/rails_4_2_0/config/environments/development.rb +25 -0
- data/test/support/rails_4_2_0/config/environments/production.rb +67 -0
- data/test/support/rails_4_2_0/config/environments/test.rb +36 -0
- data/test/support/rails_4_2_0/config/initializers/backtrace_silencers.rb +7 -0
- data/test/support/rails_4_2_0/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/support/rails_4_2_0/config/initializers/inflections.rb +16 -0
- data/test/support/rails_4_2_0/config/initializers/load_schema.rb +4 -0
- data/test/support/rails_4_2_0/config/initializers/mime_types.rb +5 -0
- data/test/support/rails_4_2_0/config/initializers/secret_token.rb +12 -0
- data/test/support/rails_4_2_0/config/initializers/session_store.rb +3 -0
- data/test/support/rails_4_2_0/config/initializers/wrap_parameters.rb +14 -0
- data/test/support/rails_4_2_0/config/locales/en.yml +23 -0
- data/test/support/rails_4_2_0/config/routes.rb +3 -0
- data/test/support/rails_4_2_0/config.ru +4 -0
- data/test/support/rails_4_2_0/db/schema.rb +22 -0
- data/test/support/rails_4_2_0/lib/assets/.keep +0 -0
- data/test/support/rails_4_2_0/lib/tasks/.keep +0 -0
- data/test/support/rails_4_2_0/public/404.html +58 -0
- data/test/support/rails_4_2_0/public/422.html +58 -0
- data/test/support/rails_4_2_0/public/500.html +57 -0
- data/test/support/rails_4_2_0/public/favicon.ico +0 -0
- data/test/support/rails_4_2_0/public/robots.txt +5 -0
- data/test/support/rails_4_2_0/script/bundle +3 -0
- data/test/support/rails_4_2_0/script/rails +4 -0
- data/test/support/rails_4_2_0/script/rake +4 -0
- data/test/support/rails_4_2_8/Gemfile +5 -0
- data/test/support/rails_4_2_8/Rakefile +6 -0
- data/test/support/rails_4_2_8/app/controllers/application_controller.rb +5 -0
- data/test/support/rails_4_2_8/app/controllers/concerns/.keep +0 -0
- data/test/support/rails_4_2_8/app/controllers/entities_controller.rb +70 -0
- data/test/support/rails_4_2_8/app/helpers/application_helper.rb +2 -0
- data/test/support/rails_4_2_8/app/models/.keep +0 -0
- data/test/support/rails_4_2_8/app/models/concerns/.keep +0 -0
- data/test/support/rails_4_2_8/app/models/entity.rb +2 -0
- data/test/support/rails_4_2_8/app/views/entities/_form.html.erb +21 -0
- data/test/support/rails_4_2_8/app/views/entities/edit.html.erb +6 -0
- data/test/support/rails_4_2_8/app/views/entities/index.html.erb +23 -0
- data/test/support/rails_4_2_8/app/views/entities/new.html.erb +5 -0
- data/test/support/rails_4_2_8/app/views/entities/show.html.erb +10 -0
- data/test/support/rails_4_2_8/app/views/layouts/application.html.erb +14 -0
- data/test/support/rails_4_2_8/config/application.rb +34 -0
- data/test/support/rails_4_2_8/config/boot.rb +4 -0
- data/test/support/rails_4_2_8/config/database.yml +11 -0
- data/test/support/rails_4_2_8/config/environment.rb +5 -0
- data/test/support/rails_4_2_8/config/environments/development.rb +25 -0
- data/test/support/rails_4_2_8/config/environments/production.rb +73 -0
- data/test/support/rails_4_2_8/config/environments/test.rb +36 -0
- data/test/support/rails_4_2_8/config/initializers/backtrace_silencers.rb +7 -0
- data/test/support/rails_4_2_8/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/support/rails_4_2_8/config/initializers/inflections.rb +16 -0
- data/test/support/rails_4_2_8/config/initializers/load_schema.rb +4 -0
- data/test/support/rails_4_2_8/config/initializers/mime_types.rb +5 -0
- data/test/support/rails_4_2_8/config/initializers/secret_token.rb +12 -0
- data/test/support/rails_4_2_8/config/initializers/session_store.rb +3 -0
- data/test/support/rails_4_2_8/config/initializers/wrap_parameters.rb +14 -0
- data/test/support/rails_4_2_8/config/locales/en.yml +23 -0
- data/test/support/rails_4_2_8/config/routes.rb +3 -0
- data/test/support/rails_4_2_8/config.ru +4 -0
- data/test/support/rails_4_2_8/db/schema.rb +22 -0
- data/test/support/rails_4_2_8/lib/assets/.keep +0 -0
- data/test/support/rails_4_2_8/lib/tasks/.keep +0 -0
- data/test/support/rails_4_2_8/public/404.html +58 -0
- data/test/support/rails_4_2_8/public/422.html +58 -0
- data/test/support/rails_4_2_8/public/500.html +57 -0
- data/test/support/rails_4_2_8/public/favicon.ico +0 -0
- data/test/support/rails_4_2_8/public/robots.txt +5 -0
- data/test/support/rails_4_2_8/script/bundle +3 -0
- data/test/support/rails_4_2_8/script/rails +4 -0
- data/test/support/rails_4_2_8/script/rake +4 -0
- data/test/support/rails_5_0_3/Gemfile +5 -0
- data/test/support/rails_5_0_3/Rakefile +6 -0
- data/test/support/rails_5_0_3/app/controllers/application_controller.rb +5 -0
- data/test/support/rails_5_0_3/app/controllers/concerns/.keep +0 -0
- data/test/support/rails_5_0_3/app/controllers/entities_controller.rb +70 -0
- data/test/support/rails_5_0_3/app/helpers/application_helper.rb +2 -0
- data/test/support/rails_5_0_3/app/models/.keep +0 -0
- data/test/support/rails_5_0_3/app/models/concerns/.keep +0 -0
- data/test/support/rails_5_0_3/app/models/entity.rb +2 -0
- data/test/support/rails_5_0_3/app/views/entities/_form.html.erb +21 -0
- data/test/support/rails_5_0_3/app/views/entities/edit.html.erb +6 -0
- data/test/support/rails_5_0_3/app/views/entities/index.html.erb +23 -0
- data/test/support/rails_5_0_3/app/views/entities/new.html.erb +5 -0
- data/test/support/rails_5_0_3/app/views/entities/show.html.erb +10 -0
- data/test/support/rails_5_0_3/app/views/layouts/application.html.erb +14 -0
- data/test/support/rails_5_0_3/config/application.rb +30 -0
- data/test/support/rails_5_0_3/config/boot.rb +4 -0
- data/test/support/rails_5_0_3/config/database.yml +11 -0
- data/test/support/rails_5_0_3/config/environment.rb +5 -0
- data/test/support/rails_5_0_3/config/environments/development.rb +25 -0
- data/test/support/rails_5_0_3/config/environments/production.rb +73 -0
- data/test/support/rails_5_0_3/config/environments/test.rb +36 -0
- data/test/support/rails_5_0_3/config/initializers/backtrace_silencers.rb +7 -0
- data/test/support/rails_5_0_3/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/support/rails_5_0_3/config/initializers/inflections.rb +16 -0
- data/test/support/rails_5_0_3/config/initializers/load_schema.rb +4 -0
- data/test/support/rails_5_0_3/config/initializers/mime_types.rb +5 -0
- data/test/support/rails_5_0_3/config/initializers/secret_token.rb +12 -0
- data/test/support/rails_5_0_3/config/initializers/session_store.rb +3 -0
- data/test/support/rails_5_0_3/config/initializers/wrap_parameters.rb +14 -0
- data/test/support/rails_5_0_3/config/locales/en.yml +23 -0
- data/test/support/rails_5_0_3/config/routes.rb +3 -0
- data/test/support/rails_5_0_3/config.ru +4 -0
- data/test/support/rails_5_0_3/db/schema.rb +22 -0
- data/test/support/rails_5_0_3/lib/assets/.keep +0 -0
- data/test/support/rails_5_0_3/lib/tasks/.keep +0 -0
- data/test/support/rails_5_0_3/public/404.html +58 -0
- data/test/support/rails_5_0_3/public/422.html +58 -0
- data/test/support/rails_5_0_3/public/500.html +57 -0
- data/test/support/rails_5_0_3/public/favicon.ico +0 -0
- data/test/support/rails_5_0_3/public/robots.txt +5 -0
- data/test/support/rails_5_0_3/script/bundle +3 -0
- data/test/support/rails_5_0_3/script/rails +4 -0
- data/test/support/rails_5_0_3/script/rake +4 -0
- data/test/support/rails_5_1_1/Gemfile +6 -0
- data/test/support/rails_5_1_1/Rakefile +6 -0
- data/test/support/rails_5_1_1/app/controllers/application_controller.rb +5 -0
- data/test/support/rails_5_1_1/app/controllers/concerns/.keep +0 -0
- data/test/support/rails_5_1_1/app/controllers/entities_controller.rb +70 -0
- data/test/support/rails_5_1_1/app/helpers/application_helper.rb +2 -0
- data/test/support/rails_5_1_1/app/jobs/create_entity_job.rb +6 -0
- data/test/support/rails_5_1_1/app/models/.keep +0 -0
- data/test/support/rails_5_1_1/app/models/concerns/.keep +0 -0
- data/test/support/rails_5_1_1/app/models/entity.rb +2 -0
- data/test/support/rails_5_1_1/app/views/entities/_form.html.erb +21 -0
- data/test/support/rails_5_1_1/app/views/entities/edit.html.erb +6 -0
- data/test/support/rails_5_1_1/app/views/entities/index.html.erb +23 -0
- data/test/support/rails_5_1_1/app/views/entities/new.html.erb +5 -0
- data/test/support/rails_5_1_1/app/views/entities/show.html.erb +10 -0
- data/test/support/rails_5_1_1/app/views/layouts/application.html.erb +14 -0
- data/test/support/rails_5_1_1/config/application.rb +30 -0
- data/test/support/rails_5_1_1/config/boot.rb +4 -0
- data/test/support/rails_5_1_1/config/database.yml +11 -0
- data/test/support/rails_5_1_1/config/environment.rb +5 -0
- data/test/support/rails_5_1_1/config/environments/development.rb +25 -0
- data/test/support/rails_5_1_1/config/environments/production.rb +73 -0
- data/test/support/rails_5_1_1/config/environments/test.rb +36 -0
- data/test/support/rails_5_1_1/config/initializers/backtrace_silencers.rb +7 -0
- data/test/support/rails_5_1_1/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/support/rails_5_1_1/config/initializers/inflections.rb +16 -0
- data/test/support/rails_5_1_1/config/initializers/load_schema.rb +4 -0
- data/test/support/rails_5_1_1/config/initializers/mime_types.rb +5 -0
- data/test/support/rails_5_1_1/config/initializers/secret_token.rb +12 -0
- data/test/support/rails_5_1_1/config/initializers/session_store.rb +3 -0
- data/test/support/rails_5_1_1/config/initializers/wrap_parameters.rb +14 -0
- data/test/support/rails_5_1_1/config/locales/en.yml +23 -0
- data/test/support/rails_5_1_1/config/routes.rb +3 -0
- data/test/support/rails_5_1_1/config.ru +4 -0
- data/test/support/rails_5_1_1/db/schema.rb +22 -0
- data/test/support/rails_5_1_1/lib/assets/.keep +0 -0
- data/test/support/rails_5_1_1/lib/tasks/.keep +0 -0
- data/test/support/rails_5_1_1/public/404.html +58 -0
- data/test/support/rails_5_1_1/public/422.html +58 -0
- data/test/support/rails_5_1_1/public/500.html +57 -0
- data/test/support/rails_5_1_1/public/favicon.ico +0 -0
- data/test/support/rails_5_1_1/public/robots.txt +5 -0
- data/test/support/rails_5_1_1/script/bundle +3 -0
- data/test/support/rails_5_1_1/script/rails +4 -0
- data/test/support/rails_5_1_1/script/rake +4 -0
- data/test/test_helper.rb +149 -11
- data/test/worker_test.rb +1 -1
- metadata +974 -143
data/test/test_helper.rb
CHANGED
@@ -1,18 +1,16 @@
|
|
1
|
-
require '
|
2
|
-
require 'mocha'
|
3
|
-
require '
|
4
|
-
require 'webmock/test_unit'
|
1
|
+
require 'minitest/autorun'
|
2
|
+
require 'mocha/setup'
|
3
|
+
require 'webmock/minitest'
|
5
4
|
require 'rack/test'
|
5
|
+
require 'pathname'
|
6
|
+
require 'bbq/spawn'
|
7
|
+
require 'sidekiq/testing'
|
6
8
|
|
7
9
|
$LOAD_PATH << File.expand_path('../../lib', __FILE__)
|
8
10
|
|
9
11
|
require 'chillout'
|
10
12
|
|
11
|
-
class ChilloutTestCase < Test
|
12
|
-
def refute(value, message=nil)
|
13
|
-
assert !value, message || "Expected #{value.inspect} to be false."
|
14
|
-
end
|
15
|
-
|
13
|
+
class ChilloutTestCase < Minitest::Test
|
16
14
|
def assert_includes(collection, object, message=nil)
|
17
15
|
assert collection.include?(object), message || "#{collection.inspect} expected to include #{object.inspect}."
|
18
16
|
end
|
@@ -34,7 +32,7 @@ class ChilloutTestCase < Test::Unit::TestCase
|
|
34
32
|
|
35
33
|
def api_url(resource_name)
|
36
34
|
raise "API KEY not set" unless @_api_key
|
37
|
-
"https
|
35
|
+
"https://api.chillout.io/#{resource_name}"
|
38
36
|
end
|
39
37
|
|
40
38
|
def null_logger
|
@@ -45,7 +43,147 @@ class ChilloutTestCase < Test::Unit::TestCase
|
|
45
43
|
_, status = Process.wait2(pid)
|
46
44
|
assert_equal 0, status.exitstatus
|
47
45
|
end
|
46
|
+
end
|
47
|
+
|
48
|
+
class AcceptanceTestCase < Minitest::Test
|
49
|
+
|
50
|
+
def setup
|
51
|
+
WebMock.disable!
|
52
|
+
end
|
53
|
+
|
54
|
+
def teardown
|
55
|
+
WebMock.enable!
|
56
|
+
end
|
57
|
+
|
58
|
+
end
|
59
|
+
|
60
|
+
require 'net/http'
|
61
|
+
|
62
|
+
class TestUser
|
63
|
+
|
64
|
+
def create_entity(name)
|
65
|
+
Net::HTTP.start('127.0.0.1', 3000) do |http|
|
66
|
+
http.post('/entities', "entity[name]=#{name}")
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
end
|
71
|
+
|
72
|
+
class TestApp
|
73
|
+
|
74
|
+
def boot
|
75
|
+
sample_app_name = ENV['SAMPLE_APP'] || 'rails_4_0_0'
|
76
|
+
sample_app_root = Pathname.new(File.expand_path('../support', __FILE__)).join(sample_app_name)
|
77
|
+
command = [Gem.ruby, sample_app_root.join('script/rails').to_s, 'server'].join(' ')
|
78
|
+
@executor = Bbq::Spawn::Executor.new(command) do |process|
|
79
|
+
process.cwd = sample_app_root.to_s
|
80
|
+
process.environment['BUNDLE_GEMFILE'] = sample_app_root.join('Gemfile').to_s
|
81
|
+
process.environment['RAILS_ENV'] = 'production'
|
82
|
+
end
|
83
|
+
@executor = Bbq::Spawn::CoordinatedExecutor.new(@executor, :url => 'http://127.0.0.1:3000/', timeout: 15)
|
84
|
+
@executor.start
|
85
|
+
@executor.join
|
86
|
+
end
|
87
|
+
|
88
|
+
def shutdown
|
89
|
+
@executor.stop
|
90
|
+
end
|
91
|
+
|
92
|
+
end
|
93
|
+
|
94
|
+
class TestSidekiqServer
|
95
|
+
def boot(chillout_port:)
|
96
|
+
sample_app_name = ENV['SAMPLE_APP'] || 'rails_4_0_0'
|
97
|
+
sample_app_root = Pathname.new(File.expand_path('../support', __FILE__)).join(sample_app_name)
|
98
|
+
command = [
|
99
|
+
Gem.ruby,
|
100
|
+
sample_app_root.join('script/bundle').to_s,
|
101
|
+
'exec sidekiq'
|
102
|
+
].join(' ')
|
103
|
+
@executor = Bbq::Spawn::Executor.new(command) do |process|
|
104
|
+
process.cwd = sample_app_root.to_s
|
105
|
+
process.environment['BUNDLE_GEMFILE'] = sample_app_root.join('Gemfile').to_s
|
106
|
+
process.environment['RAILS_ENV'] = 'production'
|
107
|
+
process.environment['CHILLOUT_PORT'] = chillout_port.to_s
|
108
|
+
end
|
109
|
+
@executor = Bbq::Spawn::CoordinatedExecutor.new(
|
110
|
+
@executor,
|
111
|
+
banner: "Starting processing, hit Ctrl-C to stop",
|
112
|
+
timeout: 15
|
113
|
+
)
|
114
|
+
@executor.start
|
115
|
+
@executor.join
|
116
|
+
end
|
117
|
+
|
118
|
+
def shutdown
|
119
|
+
@executor.stop
|
120
|
+
end
|
121
|
+
|
122
|
+
def push_job
|
123
|
+
Sidekiq::Testing.disable! do
|
124
|
+
Sidekiq::Client.push(
|
125
|
+
'class' => 'CreateEntityJob',
|
126
|
+
'queue' => 'default',
|
127
|
+
'args' => []
|
128
|
+
)
|
129
|
+
end
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
class TestEndpoint
|
134
|
+
|
135
|
+
attr_reader :metrics, :startups
|
136
|
+
|
137
|
+
def initialize(port: 8080)
|
138
|
+
@metrics = Queue.new
|
139
|
+
@startups = Queue.new
|
140
|
+
@port = port
|
141
|
+
end
|
142
|
+
|
143
|
+
def listen
|
144
|
+
Thread.new do
|
145
|
+
Rack::Server.start(
|
146
|
+
:app => self,
|
147
|
+
:Host => 'localhost',
|
148
|
+
:Port => @port
|
149
|
+
)
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
153
|
+
def call(env)
|
154
|
+
payload = MultiJson.load(env['rack.input'].read) rescue {}
|
155
|
+
|
156
|
+
case env['PATH_INFO']
|
157
|
+
when /clients/
|
158
|
+
startups << payload
|
159
|
+
when /metrics/
|
160
|
+
metrics << payload
|
161
|
+
end
|
162
|
+
|
163
|
+
[200, {'Content-Type' => 'text/plain'}, ['OK']]
|
164
|
+
end
|
165
|
+
|
166
|
+
def has_received_information_about_startup
|
167
|
+
10.times do
|
168
|
+
begin
|
169
|
+
return startups.pop(true)
|
170
|
+
rescue ThreadError
|
171
|
+
sleep(1)
|
172
|
+
end
|
173
|
+
end
|
174
|
+
false
|
175
|
+
end
|
176
|
+
|
177
|
+
def has_one_creation_for_entity_resource
|
178
|
+
10.times do
|
179
|
+
begin
|
180
|
+
return metrics.pop(true)
|
181
|
+
rescue ThreadError
|
182
|
+
sleep(1)
|
183
|
+
end
|
184
|
+
end
|
185
|
+
false
|
186
|
+
end
|
48
187
|
|
49
188
|
end
|
50
189
|
|
51
|
-
class ChilloutTestException < Exception; end
|
data/test/worker_test.rb
CHANGED
@@ -6,7 +6,7 @@ module Chillout
|
|
6
6
|
@dispatcher = stub
|
7
7
|
@queue = stub
|
8
8
|
@container = stub
|
9
|
-
@logger = stub(:
|
9
|
+
@logger = stub(info: "", error:"", debug: "")
|
10
10
|
@container_class = stub(:new => @container)
|
11
11
|
@worker = Worker.new(@dispatcher, @queue, @logger, @container_class)
|
12
12
|
end
|