diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index ae4ef1723..0215ec35f 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -12,7 +12,7 @@ steps: - wait - - label: ':ruby: Ruby 1.9.3 unit tests' + - label: ':ruby: Ruby 1.9 unit tests' plugins: docker-compose#v3.1.0: run: ruby-unit-tests @@ -58,8 +58,7 @@ steps: RUBY_TEST_VERSION: "2.7" RAILS_VERSION: "6" - - - label: ':ruby: Delayed job tests' + - label: ':construction: Delayed job tests' plugins: docker-compose#v3.1.0: run: ruby-maze-runner @@ -67,10 +66,8 @@ steps: command: ["features/delayed_job.feature", "--tags", "not @wip"] env: RUBY_TEST_VERSION: "2.5" - concurrency: 8 - concurrency_group: 'rails-tests' - - label: ':ruby: Sidekiq 5 tests' + - label: ':sidekiq: Sidekiq 5 tests' plugins: docker-compose#v3.1.0: run: ruby-maze-runner @@ -80,15 +77,15 @@ steps: RUBY_TEST_VERSION: "2.5" SIDEKIQ_VERSION: "~> 5" - - block: "Trigger full test suite" + - wait - label: ':ruby: JRuby unit tests' plugins: docker-compose#v3.1.0: run: jruby-unit-tests use-aliases: true - concurrency: 8 - concurrency_group: 'rails-tests' + concurrency: 4 + concurrency_group: 'ruby/unit-tests' - label: ':ruby: Ruby 2.0 unit tests' plugins: @@ -97,8 +94,8 @@ steps: use-aliases: true env: RUBY_TEST_VERSION: "2.0" - concurrency: 8 - concurrency_group: 'rails-tests' + concurrency: 4 + concurrency_group: 'ruby/unit-tests' - label: ':ruby: Ruby 2.1 unit tests' plugins: @@ -107,8 +104,8 @@ steps: use-aliases: true env: RUBY_TEST_VERSION: "2.1" - concurrency: 8 - concurrency_group: 'rails-tests' + concurrency: 4 + concurrency_group: 'ruby/unit-tests' - label: ':ruby: Ruby 2.2 unit tests' plugins: @@ -118,8 +115,8 @@ steps: env: RUBY_TEST_VERSION: "2.2" GEMSETS: "test sidekiq" - concurrency: 8 - concurrency_group: 'rails-tests' + concurrency: 4 + concurrency_group: 'ruby/unit-tests' - label: ':ruby: Ruby 2.3 unit tests' plugins: @@ -129,8 +126,8 @@ steps: env: RUBY_TEST_VERSION: "2.3" GEMSETS: "test sidekiq" - concurrency: 8 - concurrency_group: 'rails-tests' + concurrency: 4 + concurrency_group: 'ruby/unit-tests' - label: ':ruby: Ruby 2.4 unit tests' plugins: @@ -140,8 +137,8 @@ steps: env: RUBY_TEST_VERSION: "2.4" GEMSETS: "test sidekiq" - concurrency: 8 - concurrency_group: 'rails-tests' + concurrency: 4 + concurrency_group: 'ruby/unit-tests' - label: ':ruby: Ruby 2.5 unit tests' plugins: @@ -151,8 +148,8 @@ steps: env: RUBY_TEST_VERSION: "2.5" GEMSETS: "test sidekiq" - concurrency: 8 - concurrency_group: 'rails-tests' + concurrency: 4 + concurrency_group: 'ruby/unit-tests' - label: ':ruby: Ruby 2.6 unit tests' plugins: @@ -162,10 +159,10 @@ steps: env: RUBY_TEST_VERSION: "2.6" GEMSETS: "test sidekiq" - concurrency: 8 - concurrency_group: 'rails-tests' + concurrency: 4 + concurrency_group: 'ruby/unit-tests' - - label: ':ruby: Ruby 1.9.3 plain tests' + - label: ':ruby: Ruby 1.9 plain tests' plugins: docker-compose#v3.1.0: run: ruby-maze-runner @@ -174,7 +171,7 @@ steps: env: RUBY_TEST_VERSION: "1.9.3" concurrency: 8 - concurrency_group: 'rails-tests' + concurrency_group: 'ruby/slow-maze-runner-tests' - label: ':ruby: Ruby 2.0 plain tests' plugins: @@ -185,7 +182,7 @@ steps: env: RUBY_TEST_VERSION: "2.0" concurrency: 8 - concurrency_group: 'rails-tests' + concurrency_group: 'ruby/slow-maze-runner-tests' - label: ':ruby: Ruby 2.1 plain tests' plugins: @@ -196,7 +193,7 @@ steps: env: RUBY_TEST_VERSION: "2.1" concurrency: 8 - concurrency_group: 'rails-tests' + concurrency_group: 'ruby/slow-maze-runner-tests' - label: ':ruby: Ruby 2.2 plain tests' plugins: @@ -207,7 +204,7 @@ steps: env: RUBY_TEST_VERSION: "2.2" concurrency: 8 - concurrency_group: 'rails-tests' + concurrency_group: 'ruby/slow-maze-runner-tests' - label: ':ruby: Ruby 2.3 plain tests' plugins: @@ -218,7 +215,7 @@ steps: env: RUBY_TEST_VERSION: "2.3" concurrency: 8 - concurrency_group: 'rails-tests' + concurrency_group: 'ruby/slow-maze-runner-tests' - label: ':ruby: Ruby 2.4 plain tests' plugins: @@ -229,7 +226,7 @@ steps: env: RUBY_TEST_VERSION: "2.4" concurrency: 8 - concurrency_group: 'rails-tests' + concurrency_group: 'ruby/slow-maze-runner-tests' - label: ':ruby: Ruby 2.5 plain tests' plugins: @@ -240,7 +237,7 @@ steps: env: RUBY_TEST_VERSION: "2.5" concurrency: 8 - concurrency_group: 'rails-tests' + concurrency_group: 'ruby/slow-maze-runner-tests' - label: ':ruby: Ruby 2.6 plain tests' plugins: @@ -251,9 +248,9 @@ steps: env: RUBY_TEST_VERSION: "2.6" concurrency: 8 - concurrency_group: 'rails-tests' + concurrency_group: 'ruby/slow-maze-runner-tests' - - label: ':ruby: Sidekiq 2 tests' + - label: ':sidekiq: Sidekiq 2 tests' plugins: docker-compose#v3.1.0: run: ruby-maze-runner @@ -262,10 +259,10 @@ steps: env: RUBY_TEST_VERSION: "2.5" SIDEKIQ_VERSION: "~> 2" - concurrency: 8 - concurrency_group: 'rails-tests' + concurrency: 4 + concurrency_group: 'ruby/integrations-maze-runner-tests' - - label: ':ruby: Sidekiq 3 tests' + - label: ':sidekiq: Sidekiq 3 tests' plugins: docker-compose#v3.1.0: run: ruby-maze-runner @@ -274,10 +271,10 @@ steps: env: RUBY_TEST_VERSION: "2.5" SIDEKIQ_VERSION: "~> 3" - concurrency: 8 - concurrency_group: 'rails-tests' + concurrency: 4 + concurrency_group: 'ruby/integrations-maze-runner-tests' - - label: ':ruby: Sidekiq 4 tests' + - label: ':sidekiq: Sidekiq 4 tests' plugins: docker-compose#v3.1.0: run: ruby-maze-runner @@ -286,8 +283,8 @@ steps: env: RUBY_TEST_VERSION: "2.5" SIDEKIQ_VERSION: "~> 4" - concurrency: 8 - concurrency_group: 'rails-tests' + concurrency: 4 + concurrency_group: 'ruby/integrations-maze-runner-tests' - label: ':rails: Rails 3 Ruby 2.0 tests' plugins: @@ -299,7 +296,7 @@ steps: RUBY_TEST_VERSION: "2.0" RAILS_VERSION: "3" concurrency: 8 - concurrency_group: 'rails-tests' + concurrency_group: 'ruby/slow-maze-runner-tests' - label: ':rails: Rails 3 Ruby 2.1 tests' plugins: @@ -311,7 +308,7 @@ steps: RUBY_TEST_VERSION: "2.1" RAILS_VERSION: "3" concurrency: 8 - concurrency_group: 'rails-tests' + concurrency_group: 'ruby/slow-maze-runner-tests' - label: ':rails: Rails 3 Ruby 2.2 tests' plugins: @@ -323,7 +320,7 @@ steps: RUBY_TEST_VERSION: "2.2" RAILS_VERSION: "3" concurrency: 8 - concurrency_group: 'rails-tests' + concurrency_group: 'ruby/slow-maze-runner-tests' - label: ':rails: Rails 3 Ruby 2.3 tests' plugins: @@ -335,7 +332,7 @@ steps: RUBY_TEST_VERSION: "2.3" RAILS_VERSION: "3" concurrency: 8 - concurrency_group: 'rails-tests' + concurrency_group: 'ruby/slow-maze-runner-tests' - label: ':rails: Rails 3 Ruby 2.4 tests' plugins: @@ -347,7 +344,7 @@ steps: RUBY_TEST_VERSION: "2.4" RAILS_VERSION: "3" concurrency: 8 - concurrency_group: 'rails-tests' + concurrency_group: 'ruby/slow-maze-runner-tests' - label: ':rails: Rails 3 Ruby 2.5 tests' plugins: @@ -359,7 +356,7 @@ steps: RUBY_TEST_VERSION: "2.5" RAILS_VERSION: "3" concurrency: 8 - concurrency_group: 'rails-tests' + concurrency_group: 'ruby/slow-maze-runner-tests' - label: ':rails: Rails 4 Ruby 2.2 tests' plugins: @@ -371,7 +368,7 @@ steps: RUBY_TEST_VERSION: "2.2" RAILS_VERSION: "4" concurrency: 8 - concurrency_group: 'rails-tests' + concurrency_group: 'ruby/slow-maze-runner-tests' - label: ':rails: Rails 4 Ruby 2.3 tests' plugins: @@ -383,7 +380,7 @@ steps: RUBY_TEST_VERSION: "2.3" RAILS_VERSION: "4" concurrency: 8 - concurrency_group: 'rails-tests' + concurrency_group: 'ruby/slow-maze-runner-tests' - label: ':rails: Rails 5 Ruby 2.2 tests' plugins: @@ -395,7 +392,7 @@ steps: RUBY_TEST_VERSION: "2.2" RAILS_VERSION: "5" concurrency: 8 - concurrency_group: 'rails-tests' + concurrency_group: 'ruby/slow-maze-runner-tests' - label: ':rails: Rails 5 Ruby 2.3 tests' plugins: @@ -407,7 +404,7 @@ steps: RUBY_TEST_VERSION: "2.3" RAILS_VERSION: "5" concurrency: 8 - concurrency_group: 'rails-tests' + concurrency_group: 'ruby/slow-maze-runner-tests' - label: ':rails: Rails 5 Ruby 2.4 tests' plugins: @@ -419,7 +416,7 @@ steps: RUBY_TEST_VERSION: "2.4" RAILS_VERSION: "5" concurrency: 8 - concurrency_group: 'rails-tests' + concurrency_group: 'ruby/slow-maze-runner-tests' - label: ':rails: Rails 5 Ruby 2.5 tests' plugins: @@ -431,7 +428,7 @@ steps: RUBY_TEST_VERSION: "2.5" RAILS_VERSION: "5" concurrency: 8 - concurrency_group: 'rails-tests' + concurrency_group: 'ruby/slow-maze-runner-tests' - label: ':rails: Rails 5 Ruby 2.6 tests' plugins: @@ -443,7 +440,7 @@ steps: RUBY_TEST_VERSION: "2.6" RAILS_VERSION: "5" concurrency: 8 - concurrency_group: 'rails-tests' + concurrency_group: 'ruby/slow-maze-runner-tests' - label: ':rails: Rails 6 Ruby 2.5 tests' plugins: @@ -455,7 +452,7 @@ steps: RUBY_TEST_VERSION: "2.5" RAILS_VERSION: "6" concurrency: 8 - concurrency_group: 'rails-tests' + concurrency_group: 'ruby/slow-maze-runner-tests' - label: ':rails: Rails 6 Ruby 2.6 tests' plugins: @@ -467,4 +464,459 @@ steps: RUBY_TEST_VERSION: "2.6" RAILS_VERSION: "6" concurrency: 8 - concurrency_group: 'rails-tests' \ No newline at end of file + concurrency_group: 'ruby/slow-maze-runner-tests' + + - label: ':clipboard: Rake Ruby 1.9 tests' + plugins: + docker-compose#v3.1.0: + run: ruby-maze-runner + use-aliases: true + command: ['features/rake.feature', '--tags', 'not @wip'] + env: + RUBY_TEST_VERSION: '1.9.3' + concurrency: 4 + concurrency_group: 'ruby/integrations-maze-runner-tests' + + - label: ':clipboard: Rake Ruby 2.0 tests' + plugins: + docker-compose#v3.1.0: + run: ruby-maze-runner + use-aliases: true + command: ['features/rake.feature', '--tags', 'not @wip'] + env: + RUBY_TEST_VERSION: '2.0' + concurrency: 4 + concurrency_group: 'ruby/integrations-maze-runner-tests' + + - label: ':clipboard: Rake Ruby 2.1 tests' + plugins: + docker-compose#v3.1.0: + run: ruby-maze-runner + use-aliases: true + command: ['features/rake.feature', '--tags', 'not @wip'] + env: + RUBY_TEST_VERSION: '2.1' + concurrency: 4 + concurrency_group: 'ruby/integrations-maze-runner-tests' + + - label: ':clipboard: Rake Ruby 2.2 tests' + plugins: + docker-compose#v3.1.0: + run: ruby-maze-runner + use-aliases: true + command: ['features/rake.feature', '--tags', 'not @wip'] + env: + RUBY_TEST_VERSION: '2.2' + concurrency: 4 + concurrency_group: 'ruby/integrations-maze-runner-tests' + + - label: ':clipboard: Rake Ruby 2.3 tests' + plugins: + docker-compose#v3.1.0: + run: ruby-maze-runner + use-aliases: true + command: ['features/rake.feature', '--tags', 'not @wip'] + env: + RUBY_TEST_VERSION: '2.3' + concurrency: 4 + concurrency_group: 'ruby/integrations-maze-runner-tests' + + - label: ':clipboard: Rake Ruby 2.4 tests' + plugins: + docker-compose#v3.1.0: + run: ruby-maze-runner + use-aliases: true + command: ['features/rake.feature', '--tags', 'not @wip'] + env: + RUBY_TEST_VERSION: '2.4' + concurrency: 4 + concurrency_group: 'ruby/integrations-maze-runner-tests' + + - label: ':clipboard: Rake Ruby 2.5 tests' + plugins: + docker-compose#v3.1.0: + run: ruby-maze-runner + use-aliases: true + command: ['features/rake.feature', '--tags', 'not @wip'] + env: + RUBY_TEST_VERSION: '2.5' + concurrency: 4 + concurrency_group: 'ruby/integrations-maze-runner-tests' + + - label: ':clipboard: Rake Ruby 2.6 tests' + plugins: + docker-compose#v3.1.0: + run: ruby-maze-runner + use-aliases: true + command: ['features/rake.feature', '--tags', 'not @wip'] + env: + RUBY_TEST_VERSION: '2.6' + concurrency: 4 + concurrency_group: 'ruby/integrations-maze-runner-tests' + + - label: ':clipboard: Rake Ruby 2.7 tests' + plugins: + docker-compose#v3.1.0: + run: ruby-maze-runner + use-aliases: true + command: ['features/rake.feature', '--tags', 'not @wip'] + env: + RUBY_TEST_VERSION: '2.7' + concurrency: 4 + concurrency_group: 'ruby/integrations-maze-runner-tests' + + - label: ':postbox: Mailman Ruby 2.0 tests' + plugins: + docker-compose#v3.1.0: + run: ruby-maze-runner + use-aliases: true + command: ['features/mailman.feature', '--tags', 'not @wip'] + env: + RUBY_TEST_VERSION: '2.0' + concurrency: 4 + concurrency_group: 'ruby/integrations-maze-runner-tests' + + - label: ':postbox: Mailman Ruby 2.1 tests' + plugins: + docker-compose#v3.1.0: + run: ruby-maze-runner + use-aliases: true + command: ['features/mailman.feature', '--tags', 'not @wip'] + env: + RUBY_TEST_VERSION: '2.1' + concurrency: 4 + concurrency_group: 'ruby/integrations-maze-runner-tests' + + - label: ':postbox: Mailman Ruby 2.2 tests' + plugins: + docker-compose#v3.1.0: + run: ruby-maze-runner + use-aliases: true + command: ['features/mailman.feature', '--tags', 'not @wip'] + env: + RUBY_TEST_VERSION: '2.2' + concurrency: 4 + concurrency_group: 'ruby/integrations-maze-runner-tests' + + - label: ':postbox: Mailman Ruby 2.3 tests' + plugins: + docker-compose#v3.1.0: + run: ruby-maze-runner + use-aliases: true + command: ['features/mailman.feature', '--tags', 'not @wip'] + env: + RUBY_TEST_VERSION: '2.3' + concurrency: 4 + concurrency_group: 'ruby/integrations-maze-runner-tests' + + - label: ':postbox: Mailman Ruby 2.4 tests' + plugins: + docker-compose#v3.1.0: + run: ruby-maze-runner + use-aliases: true + command: ['features/mailman.feature', '--tags', 'not @wip'] + env: + RUBY_TEST_VERSION: '2.4' + concurrency: 4 + concurrency_group: 'ruby/integrations-maze-runner-tests' + + - label: ':postbox: Mailman Ruby 2.5 tests' + plugins: + docker-compose#v3.1.0: + run: ruby-maze-runner + use-aliases: true + command: ['features/mailman.feature', '--tags', 'not @wip'] + env: + RUBY_TEST_VERSION: '2.5' + concurrency: 4 + concurrency_group: 'ruby/integrations-maze-runner-tests' + + - label: ':postbox: Mailman Ruby 2.6 tests' + plugins: + docker-compose#v3.1.0: + run: ruby-maze-runner + use-aliases: true + command: ['features/mailman.feature', '--tags', 'not @wip'] + env: + RUBY_TEST_VERSION: '2.6' + concurrency: 4 + concurrency_group: 'ruby/integrations-maze-runner-tests' + + - label: ':postbox: Mailman Ruby 2.7 tests' + plugins: + docker-compose#v3.1.0: + run: ruby-maze-runner + use-aliases: true + command: ['features/mailman.feature', '--tags', 'not @wip'] + env: + RUBY_TEST_VERSION: '2.7' + concurrency: 4 + concurrency_group: 'ruby/integrations-maze-runner-tests' + + - label: ':key: Que Ruby 2.0 tests' + plugins: + docker-compose#v3.1.0: + run: ruby-maze-runner + use-aliases: true + command: ['features/que.feature', '--tags', 'not @wip'] + env: + RUBY_TEST_VERSION: '2.0' + concurrency: 4 + concurrency_group: 'ruby/integrations-maze-runner-tests' + + - label: ':key: Que Ruby 2.1 tests' + plugins: + docker-compose#v3.1.0: + run: ruby-maze-runner + use-aliases: true + command: ['features/que.feature', '--tags', 'not @wip'] + env: + RUBY_TEST_VERSION: '2.1' + concurrency: 4 + concurrency_group: 'ruby/integrations-maze-runner-tests' + + - label: ':key: Que Ruby 2.2 tests' + plugins: + docker-compose#v3.1.0: + run: ruby-maze-runner + use-aliases: true + command: ['features/que.feature', '--tags', 'not @wip'] + env: + RUBY_TEST_VERSION: '2.2' + concurrency: 4 + concurrency_group: 'ruby/integrations-maze-runner-tests' + + - label: ':key: Que Ruby 2.3 tests' + plugins: + docker-compose#v3.1.0: + run: ruby-maze-runner + use-aliases: true + command: ['features/que.feature', '--tags', 'not @wip'] + env: + RUBY_TEST_VERSION: '2.3' + concurrency: 4 + concurrency_group: 'ruby/integrations-maze-runner-tests' + + - label: ':key: Que Ruby 2.4 tests' + plugins: + docker-compose#v3.1.0: + run: ruby-maze-runner + use-aliases: true + command: ['features/que.feature', '--tags', 'not @wip'] + env: + RUBY_TEST_VERSION: '2.4' + concurrency: 4 + concurrency_group: 'ruby/integrations-maze-runner-tests' + + - label: ':key: Que Ruby 2.5 tests' + plugins: + docker-compose#v3.1.0: + run: ruby-maze-runner + use-aliases: true + command: ['features/que.feature', '--tags', 'not @wip'] + env: + RUBY_TEST_VERSION: '2.5' + concurrency: 4 + concurrency_group: 'ruby/integrations-maze-runner-tests' + + - label: ':key: Que Ruby 2.6 tests' + plugins: + docker-compose#v3.1.0: + run: ruby-maze-runner + use-aliases: true + command: ['features/que.feature', '--tags', 'not @wip'] + env: + RUBY_TEST_VERSION: '2.6' + concurrency: 4 + concurrency_group: 'ruby/integrations-maze-runner-tests' + + - label: ':key: Que Ruby 2.7 tests' + plugins: + docker-compose#v3.1.0: + run: ruby-maze-runner + use-aliases: true + command: ['features/que.feature', '--tags', 'not @wip'] + env: + RUBY_TEST_VERSION: '2.7' + concurrency: 4 + concurrency_group: 'ruby/integrations-maze-runner-tests' + + - label: ':bed: Rack 1 Ruby 1.9 tests' + plugins: + docker-compose#v3.1.0: + run: ruby-maze-runner + use-aliases: true + command: ['features/rack.feature', '--tags', 'not @wip'] + env: + RUBY_TEST_VERSION: '1.9.3' + RACK_VERSION: '1' + concurrency: 4 + concurrency_group: 'ruby/integrations-maze-runner-tests' + + - label: ':bed: Rack 1 Ruby 2.0 tests' + plugins: + docker-compose#v3.1.0: + run: ruby-maze-runner + use-aliases: true + command: ['features/rack.feature', '--tags', 'not @wip'] + env: + RUBY_TEST_VERSION: '2.0' + RACK_VERSION: '1' + concurrency: 4 + concurrency_group: 'ruby/integrations-maze-runner-tests' + + - label: ':bed: Rack 1 Ruby 2.1 tests' + plugins: + docker-compose#v3.1.0: + run: ruby-maze-runner + use-aliases: true + command: ['features/rack.feature', '--tags', 'not @wip'] + env: + RUBY_TEST_VERSION: '2.1' + RACK_VERSION: '1' + concurrency: 4 + concurrency_group: 'ruby/integrations-maze-runner-tests' + + - label: ':bed: Rack 1 Ruby 2.2 tests' + plugins: + docker-compose#v3.1.0: + run: ruby-maze-runner + use-aliases: true + command: ['features/rack.feature', '--tags', 'not @wip'] + env: + RUBY_TEST_VERSION: '2.2' + RACK_VERSION: '1' + concurrency: 4 + concurrency_group: 'ruby/integrations-maze-runner-tests' + + - label: ':bed: Rack 1 Ruby 2.3 tests' + plugins: + docker-compose#v3.1.0: + run: ruby-maze-runner + use-aliases: true + command: ['features/rack.feature', '--tags', 'not @wip'] + env: + RUBY_TEST_VERSION: '2.3' + RACK_VERSION: '1' + concurrency: 4 + concurrency_group: 'ruby/integrations-maze-runner-tests' + + - label: ':bed: Rack 1 Ruby 2.4 tests' + plugins: + docker-compose#v3.1.0: + run: ruby-maze-runner + use-aliases: true + command: ['features/rack.feature', '--tags', 'not @wip'] + env: + RUBY_TEST_VERSION: '2.4' + RACK_VERSION: '1' + concurrency: 4 + concurrency_group: 'ruby/integrations-maze-runner-tests' + + - label: ':bed: Rack 1 Ruby 2.5 tests' + plugins: + docker-compose#v3.1.0: + run: ruby-maze-runner + use-aliases: true + command: ['features/rack.feature', '--tags', 'not @wip'] + env: + RUBY_TEST_VERSION: '2.5' + RACK_VERSION: '1' + concurrency: 4 + concurrency_group: 'ruby/integrations-maze-runner-tests' + + - label: ':bed: Rack 1 Ruby 2.6 tests' + plugins: + docker-compose#v3.1.0: + run: ruby-maze-runner + use-aliases: true + command: ['features/rack.feature', '--tags', 'not @wip'] + env: + RUBY_TEST_VERSION: '2.6' + RACK_VERSION: '1' + concurrency: 4 + concurrency_group: 'ruby/integrations-maze-runner-tests' + + - label: ':bed: Rack 1 Ruby 2.7 tests' + plugins: + docker-compose#v3.1.0: + run: ruby-maze-runner + use-aliases: true + command: ['features/rack.feature', '--tags', 'not @wip'] + env: + RUBY_TEST_VERSION: '2.7' + RACK_VERSION: '1' + concurrency: 4 + concurrency_group: 'ruby/integrations-maze-runner-tests' + + - label: ':bed: Rack 2 Ruby 2.2 tests' + plugins: + docker-compose#v3.1.0: + run: ruby-maze-runner + use-aliases: true + command: ['features/rack.feature', '--tags', 'not @wip'] + env: + RUBY_TEST_VERSION: '2.2' + RACK_VERSION: '2' + concurrency: 4 + concurrency_group: 'ruby/integrations-maze-runner-tests' + + - label: ':bed: Rack 2 Ruby 2.3 tests' + plugins: + docker-compose#v3.1.0: + run: ruby-maze-runner + use-aliases: true + command: ['features/rack.feature', '--tags', 'not @wip'] + env: + RUBY_TEST_VERSION: '2.3' + RACK_VERSION: '2' + concurrency: 4 + concurrency_group: 'ruby/integrations-maze-runner-tests' + + - label: ':bed: Rack 2 Ruby 2.4 tests' + plugins: + docker-compose#v3.1.0: + run: ruby-maze-runner + use-aliases: true + command: ['features/rack.feature', '--tags', 'not @wip'] + env: + RUBY_TEST_VERSION: '2.4' + RACK_VERSION: '2' + concurrency: 4 + concurrency_group: 'ruby/integrations-maze-runner-tests' + + - label: ':bed: Rack 2 Ruby 2.5 tests' + plugins: + docker-compose#v3.1.0: + run: ruby-maze-runner + use-aliases: true + command: ['features/rack.feature', '--tags', 'not @wip'] + env: + RUBY_TEST_VERSION: '2.5' + RACK_VERSION: '2' + concurrency: 4 + concurrency_group: 'ruby/integrations-maze-runner-tests' + + - label: ':bed: Rack 2 Ruby 2.6 tests' + plugins: + docker-compose#v3.1.0: + run: ruby-maze-runner + use-aliases: true + command: ['features/rack.feature', '--tags', 'not @wip'] + env: + RUBY_TEST_VERSION: '2.6' + RACK_VERSION: '2' + concurrency: 4 + concurrency_group: 'ruby/integrations-maze-runner-tests' + + - label: ':bed: Rack 2 Ruby 2.7 tests' + plugins: + docker-compose#v3.1.0: + run: ruby-maze-runner + use-aliases: true + command: ['features/rack.feature', '--tags', 'not @wip'] + env: + RUBY_TEST_VERSION: '2.7' + RACK_VERSION: '2' + concurrency: 4 + concurrency_group: 'ruby/integrations-maze-runner-tests' diff --git a/docker-compose.yml b/docker-compose.yml index 4b10d2364..4abcce1b5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,6 +9,7 @@ services: NETWORK_NAME: "${BUILDKITE_JOB_ID:-ruby-maze-runner}-${RUBY_TEST_VERSION:-local}" BUILDKITE_JOB_ID: RAILS_VERSION: + RACK_VERSION: SIDEKIQ_VERSION: RUBY_TEST_VERSION: VERBOSE: @@ -43,4 +44,4 @@ services: networks: default: - name: ${BUILDKITE_JOB_ID:-ruby-maze-runner}-${RUBY_TEST_VERSION:-local} \ No newline at end of file + name: ${BUILDKITE_JOB_ID:-ruby-maze-runner}-${RUBY_TEST_VERSION:-local} diff --git a/features/delayed_job.feature b/features/delayed_job.feature index 531512b79..4cc2933e8 100644 --- a/features/delayed_job.feature +++ b/features/delayed_job.feature @@ -9,6 +9,7 @@ Scenario: An unhandled RuntimeError sends a report with arguments And the event "context" equals "TestModel.fail_with_args" And the event "severityReason.type" equals "unhandledExceptionMiddleware" And the event "severityReason.attributes.framework" equals "DelayedJob" + And the event "app.type" equals "delayed_job" And the exception "errorClass" equals "RuntimeError" And the event "metaData.job.class" equals "Delayed::Backend::ActiveRecord::Job" And the event "metaData.job.id" is not null @@ -27,6 +28,7 @@ Scenario: A handled exception sends a report And the event "severity" equals "warning" And the event "context" equals "TestModel.notify_with_args" And the event "severityReason.type" equals "handledException" + And the event "app.type" equals "delayed_job" And the exception "errorClass" equals "RuntimeError" And the event "metaData.job.class" equals "Delayed::Backend::ActiveRecord::Job" And the event "metaData.job.id" is not null diff --git a/features/fixtures/docker-compose.yml b/features/fixtures/docker-compose.yml index 0357d5fb5..b895a27a0 100644 --- a/features/fixtures/docker-compose.yml +++ b/features/fixtures/docker-compose.yml @@ -4,6 +4,11 @@ services: redis: image: redis + postgres: + image: postgres + environment: + - POSTGRES_PASSWORD=test_password + mongo: image: mongo @@ -78,7 +83,8 @@ services: args: - RUBY_TEST_VERSION environment: - - endpoint + - BUGSNAG_API_KEY + - BUGSNAG_ENDPOINT restart: "no" rack2: @@ -87,7 +93,8 @@ services: args: - RUBY_TEST_VERSION environment: - - endpoint + - BUGSNAG_API_KEY + - BUGSNAG_ENDPOINT restart: "no" rails3: @@ -236,17 +243,6 @@ services: aliases: - rails6 - resque: - build: - context: resque - args: - - RUBY_TEST_VERSION - depends_on: - - redis - environment: - - endpoint - restart: "no" - sidekiq: build: context: sidekiq @@ -280,23 +276,41 @@ services: - CALLBACK_INITIATOR restart: "no" - sinatra1: + mailman: build: - context: sinatra1 + context: mailman args: - - RUBY_TEST_VERSION + - RUBY_VERSION + - APP_PATH environment: - - endpoint + - BUGSNAG_API_KEY + - BUGSNAG_ENDPOINT + - TARGET_EMAIL + ports: + - "6245:6245" restart: "no" - sinatra2: + rake: build: - context: sinatra2 + context: rake args: - - RUBY_TEST_VERSION + - RUBY_VERSION environment: - - endpoint - restart: "no" + - BUGSNAG_API_KEY + - BUGSNAG_ENDPOINT + restart: 'no' + + que: + build: + context: que + args: + - RUBY_VERSION + depends_on: + - postgres + environment: + - BUGSNAG_API_KEY + - BUGSNAG_ENDPOINT + restart: 'no' networks: default: diff --git a/features/fixtures/mailman/.dockerignore b/features/fixtures/mailman/.dockerignore new file mode 100644 index 000000000..91decfeec --- /dev/null +++ b/features/fixtures/mailman/.dockerignore @@ -0,0 +1,4 @@ +# Ignore the lock file so that we always use an up to date version. This won't +# exist unless the fixtures are run manually anyway. +Gemfile.lock +payloads/ diff --git a/features/fixtures/mailman/Dockerfile b/features/fixtures/mailman/Dockerfile new file mode 100644 index 000000000..20f61c18f --- /dev/null +++ b/features/fixtures/mailman/Dockerfile @@ -0,0 +1,16 @@ +ARG RUBY_VERSION +FROM ruby:$RUBY_VERSION + +WORKDIR /bugsnag +COPY temp-bugsnag-lib ./ + +ARG APP_PATH + +WORKDIR $APP_PATH + +COPY app/Gemfile . +RUN bundle install + +COPY app/ . + +CMD ["./run.sh"] diff --git a/features/fixtures/mailman/app/Gemfile b/features/fixtures/mailman/app/Gemfile new file mode 100644 index 000000000..b202fc4a8 --- /dev/null +++ b/features/fixtures/mailman/app/Gemfile @@ -0,0 +1,10 @@ +source 'https://rubygems.org' + +gem 'bugsnag', path: '/bugsnag' +gem 'mailman' +gem 'hitimes', '~> 1.2.6' +gem 'i18n', '~> 0.9.5' +gem 'rb-inotify', '0.9.8' +gem 'maildir', '~> 2.1.0' +gem 'activesupport', '~> 3.2' +gem 'rack', '~> 1.6.11' diff --git a/features/fixtures/mailman/app/app.rb b/features/fixtures/mailman/app/app.rb new file mode 100644 index 000000000..d06d7865b --- /dev/null +++ b/features/fixtures/mailman/app/app.rb @@ -0,0 +1,25 @@ +require 'mailman' +require 'bugsnag' + +Bugsnag.configure do |conf| + puts "Configuring `api_key` to #{ENV['BUGSNAG_API_KEY']}" + conf.api_key = ENV['BUGSNAG_API_KEY'] + puts "Configuring `endpoint` to #{ENV['BUGSNAG_ENDPOINT']}" + conf.endpoint = ENV['BUGSNAG_ENDPOINT'] +end + +Mailman.config.ignore_stdin = false + +Mailman::Application.run do + subject "Unhandled" do + raise RuntimeError.new("Unhandled exception") + end + + subject "Handled" do + begin + raise RuntimeError.new("Handled exception") + rescue => exception + Bugsnag.notify(exception) + end + end +end diff --git a/features/fixtures/mailman/app/emails/handled_error.eml b/features/fixtures/mailman/app/emails/handled_error.eml new file mode 100644 index 000000000..b8ea3bef2 --- /dev/null +++ b/features/fixtures/mailman/app/emails/handled_error.eml @@ -0,0 +1,19 @@ +MIME-Version: 1.0 +Date: Mon, 4 Feb 2019 17:54:01 +0000 +Message-ID: +Subject: Handled +From: Test +To: "Test@maze-runner.mail" +Content-Type: multipart/alternative; boundary="0000000000008ead860581152db1" + +--0000000000008ead860581152db1 +Content-Type: text/plain; charset="UTF-8" + +test + +--0000000000008ead860581152db1 +Content-Type: text/html; charset="UTF-8" + +
test
+ +--0000000000008ead860581152db1-- diff --git a/features/fixtures/mailman/app/emails/unhandled_error.eml b/features/fixtures/mailman/app/emails/unhandled_error.eml new file mode 100644 index 000000000..3de7e9b5f --- /dev/null +++ b/features/fixtures/mailman/app/emails/unhandled_error.eml @@ -0,0 +1,19 @@ +MIME-Version: 1.0 +Date: Mon, 4 Feb 2019 17:54:01 +0000 +Message-ID: +Subject: Unhandled +From: Test +To: "Test@maze-runner.mail" +Content-Type: multipart/alternative; boundary="0000000000008ead860581152db1" + +--0000000000008ead860581152db1 +Content-Type: text/plain; charset="UTF-8" + +test + +--0000000000008ead860581152db1 +Content-Type: text/html; charset="UTF-8" + +
test
+ +--0000000000008ead860581152db1-- diff --git a/features/fixtures/mailman/app/run.sh b/features/fixtures/mailman/app/run.sh new file mode 100755 index 000000000..79fea0c4a --- /dev/null +++ b/features/fixtures/mailman/app/run.sh @@ -0,0 +1,2 @@ +#!/bin/bash +cat $TARGET_EMAIL | bundle exec ruby app.rb diff --git a/features/fixtures/plain/.dockerignore b/features/fixtures/plain/.dockerignore index 102fe48a7..e1bc279f2 100644 --- a/features/fixtures/plain/.dockerignore +++ b/features/fixtures/plain/.dockerignore @@ -1,2 +1,4 @@ +# Ignore the lock file so that we always use an up to date version. This won't +# exist unless the fixtures are run manually anyway. Gemfile.lock -reportExamples \ No newline at end of file +reportExamples diff --git a/features/fixtures/que/.dockerignore b/features/fixtures/que/.dockerignore new file mode 100644 index 000000000..87a58ba13 --- /dev/null +++ b/features/fixtures/que/.dockerignore @@ -0,0 +1,3 @@ +# Ignore the lock file so that we always use an up to date version. This won't +# exist unless the fixtures are run manually anyway. +app/Gemfile.lock diff --git a/features/fixtures/sinatra2/Dockerfile b/features/fixtures/que/Dockerfile similarity index 54% rename from features/fixtures/sinatra2/Dockerfile rename to features/fixtures/que/Dockerfile index 70aabb9e4..fb2347ff1 100644 --- a/features/fixtures/sinatra2/Dockerfile +++ b/features/fixtures/que/Dockerfile @@ -1,5 +1,5 @@ -ARG RUBY_TEST_VERSION -FROM ruby:$RUBY_TEST_VERSION +ARG RUBY_VERSION +FROM ruby:$RUBY_VERSION WORKDIR /bugsnag COPY temp-bugsnag-lib ./ @@ -8,6 +8,4 @@ WORKDIR /usr/src/app COPY app/Gemfile /usr/src/app/ RUN bundle install -COPY . /usr/src/app - -CMD ["ruby", "app.rb"] +COPY app/ /usr/src/app diff --git a/features/fixtures/que/app/Gemfile b/features/fixtures/que/app/Gemfile new file mode 100644 index 000000000..1fc888479 --- /dev/null +++ b/features/fixtures/que/app/Gemfile @@ -0,0 +1,9 @@ +source "https://rubygems.org" + +gem "bugsnag", path: "/bugsnag" + +gem "que", "~> 0.14.3" + +gem "pg", RUBY_VERSION < "2.2.0" ? "0.21.0" : "> 0.21.0" + +gem "activerecord", RUBY_VERSION < "2.2.0" ? "4.2.11" : "> 4.2.11" diff --git a/features/fixtures/que/app/app.rb b/features/fixtures/que/app/app.rb new file mode 100644 index 000000000..da050c877 --- /dev/null +++ b/features/fixtures/que/app/app.rb @@ -0,0 +1,57 @@ +require 'pg' +require 'que' +require 'bugsnag' +require 'active_record' + +Bugsnag.configure do |config| + puts "Configuring `api_key` to #{ENV['BUGSNAG_API_KEY']}" + config.api_key = ENV['BUGSNAG_API_KEY'] + puts "Configuring `endpoint` to #{ENV['BUGSNAG_ENDPOINT']}" + config.endpoint = ENV['BUGSNAG_ENDPOINT'] +end + +ActiveRecord::Base.establish_connection( + adapter: 'postgresql', + database: 'postgres', + username: 'postgres', + password: 'test_password', + host: 'postgres' +) + +Que.connection = ActiveRecord +Que.migrate!(version: 3) + +# Workaround a bug in que/pg +# see https://github.com/que-rb/que/issues/247 +Que::Adapters::Base::CAST_PROCS[1184] = lambda do |value| + case value + when Time then value + when String then Time.parse(value) + else raise "Unexpected time class: #{value.class} (#{value.inspect})" + end +end + +class UnhandledJob < Que::Job + def run + raise RuntimeError.new("Unhandled error") + end + + def handle_error(error) + destroy + end +end + +class HandledJob < Que::Job + def run + raise RuntimeError.new("Handled error") + rescue => exception + Bugsnag.notify(exception) + end +end + +case ARGV[0] +when "unhandled" + UnhandledJob.enqueue +when "handled" + HandledJob.enqueue +end diff --git a/features/fixtures/rack1/.dockerignore b/features/fixtures/rack1/.dockerignore index b844b143d..87a58ba13 100644 --- a/features/fixtures/rack1/.dockerignore +++ b/features/fixtures/rack1/.dockerignore @@ -1 +1,3 @@ -Gemfile.lock +# Ignore the lock file so that we always use an up to date version. This won't +# exist unless the fixtures are run manually anyway. +app/Gemfile.lock diff --git a/features/fixtures/rack1/Dockerfile b/features/fixtures/rack1/Dockerfile index 35657a0f4..a485c56c1 100644 --- a/features/fixtures/rack1/Dockerfile +++ b/features/fixtures/rack1/Dockerfile @@ -10,4 +10,4 @@ RUN bundle install COPY app/ /usr/src/app -CMD ["ruby", "app.rb"] +CMD ["bundle", "exec", "ruby", "app.rb"] diff --git a/features/fixtures/rack1/app.rb b/features/fixtures/rack1/app.rb deleted file mode 100644 index c3d6253a0..000000000 --- a/features/fixtures/rack1/app.rb +++ /dev/null @@ -1,8 +0,0 @@ -require 'bundler' -Bundler.require - -app = Proc.new do |env| - ['200', {'Content-Type' => 'text/html'}, ['A barebones rack app.']] -end - -Rack::Handler::WEBrick.run app, {Port: 3000, BindAddress: '0.0.0.0'} diff --git a/features/fixtures/rack1/Gemfile b/features/fixtures/rack1/app/Gemfile similarity index 100% rename from features/fixtures/rack1/Gemfile rename to features/fixtures/rack1/app/Gemfile diff --git a/features/fixtures/rack1/app/app.rb b/features/fixtures/rack1/app/app.rb new file mode 100644 index 000000000..f6821c4b1 --- /dev/null +++ b/features/fixtures/rack1/app/app.rb @@ -0,0 +1,31 @@ +require 'bugsnag' +require 'rack' + +Bugsnag.configure do |config| + puts "Configuring `api_key` to #{ENV['BUGSNAG_API_KEY']}" + config.api_key = ENV['BUGSNAG_API_KEY'] + puts "Configuring `endpoint` to #{ENV['BUGSNAG_ENDPOINT']}" + config.endpoint = ENV['BUGSNAG_ENDPOINT'] +end + +class BugsnagTests + def call(env) + req = Rack::Request.new(env) + + case req.env['REQUEST_PATH'] + when '/unhandled' + raise 'Unhandled error' + when '/handled' + begin + raise 'Handled error' + rescue StandardError => e + Bugsnag.notify(e) + end + end + + res = Rack::Response.new + res.finish + end +end + +Rack::Server.start(app: Bugsnag::Rack.new(BugsnagTests.new), Host: '0.0.0.0', Port: 3000) diff --git a/features/fixtures/rack2/.dockerignore b/features/fixtures/rack2/.dockerignore index b844b143d..87a58ba13 100644 --- a/features/fixtures/rack2/.dockerignore +++ b/features/fixtures/rack2/.dockerignore @@ -1 +1,3 @@ -Gemfile.lock +# Ignore the lock file so that we always use an up to date version. This won't +# exist unless the fixtures are run manually anyway. +app/Gemfile.lock diff --git a/features/fixtures/rack2/Dockerfile b/features/fixtures/rack2/Dockerfile index 35657a0f4..a485c56c1 100644 --- a/features/fixtures/rack2/Dockerfile +++ b/features/fixtures/rack2/Dockerfile @@ -10,4 +10,4 @@ RUN bundle install COPY app/ /usr/src/app -CMD ["ruby", "app.rb"] +CMD ["bundle", "exec", "ruby", "app.rb"] diff --git a/features/fixtures/rack2/app.rb b/features/fixtures/rack2/app.rb deleted file mode 100644 index c3d6253a0..000000000 --- a/features/fixtures/rack2/app.rb +++ /dev/null @@ -1,8 +0,0 @@ -require 'bundler' -Bundler.require - -app = Proc.new do |env| - ['200', {'Content-Type' => 'text/html'}, ['A barebones rack app.']] -end - -Rack::Handler::WEBrick.run app, {Port: 3000, BindAddress: '0.0.0.0'} diff --git a/features/fixtures/rack2/Gemfile b/features/fixtures/rack2/app/Gemfile similarity index 100% rename from features/fixtures/rack2/Gemfile rename to features/fixtures/rack2/app/Gemfile diff --git a/features/fixtures/rack2/app/app.rb b/features/fixtures/rack2/app/app.rb new file mode 100644 index 000000000..f6821c4b1 --- /dev/null +++ b/features/fixtures/rack2/app/app.rb @@ -0,0 +1,31 @@ +require 'bugsnag' +require 'rack' + +Bugsnag.configure do |config| + puts "Configuring `api_key` to #{ENV['BUGSNAG_API_KEY']}" + config.api_key = ENV['BUGSNAG_API_KEY'] + puts "Configuring `endpoint` to #{ENV['BUGSNAG_ENDPOINT']}" + config.endpoint = ENV['BUGSNAG_ENDPOINT'] +end + +class BugsnagTests + def call(env) + req = Rack::Request.new(env) + + case req.env['REQUEST_PATH'] + when '/unhandled' + raise 'Unhandled error' + when '/handled' + begin + raise 'Handled error' + rescue StandardError => e + Bugsnag.notify(e) + end + end + + res = Rack::Response.new + res.finish + end +end + +Rack::Server.start(app: Bugsnag::Rack.new(BugsnagTests.new), Host: '0.0.0.0', Port: 3000) diff --git a/features/fixtures/rails3/.dockerignore b/features/fixtures/rails3/.dockerignore index a8aa41c4a..87a58ba13 100644 --- a/features/fixtures/rails3/.dockerignore +++ b/features/fixtures/rails3/.dockerignore @@ -1 +1,3 @@ +# Ignore the lock file so that we always use an up to date version. This won't +# exist unless the fixtures are run manually anyway. app/Gemfile.lock diff --git a/features/fixtures/rails3/app/app/controllers/app_type_controller.rb b/features/fixtures/rails3/app/app/controllers/app_type_controller.rb index 8d71a9095..91ccbea21 100644 --- a/features/fixtures/rails3/app/app/controllers/app_type_controller.rb +++ b/features/fixtures/rails3/app/app/controllers/app_type_controller.rb @@ -1,10 +1,17 @@ class AppTypeController < ActionController::Base protect_from_forgery - def index + def handled + raise "Handled error" + rescue StandardError => e + Bugsnag.notify(e) render json: {} end + def unhandled + raise "Unhandled error" + end + def initializer Bugsnag.notify("handled string") render json: {} diff --git a/features/fixtures/rails4/.dockerignore b/features/fixtures/rails4/.dockerignore index a8aa41c4a..87a58ba13 100644 --- a/features/fixtures/rails4/.dockerignore +++ b/features/fixtures/rails4/.dockerignore @@ -1 +1,3 @@ +# Ignore the lock file so that we always use an up to date version. This won't +# exist unless the fixtures are run manually anyway. app/Gemfile.lock diff --git a/features/fixtures/rails4/app/app/controllers/app_type_controller.rb b/features/fixtures/rails4/app/app/controllers/app_type_controller.rb index 8d71a9095..91ccbea21 100644 --- a/features/fixtures/rails4/app/app/controllers/app_type_controller.rb +++ b/features/fixtures/rails4/app/app/controllers/app_type_controller.rb @@ -1,10 +1,17 @@ class AppTypeController < ActionController::Base protect_from_forgery - def index + def handled + raise "Handled error" + rescue StandardError => e + Bugsnag.notify(e) render json: {} end + def unhandled + raise "Unhandled error" + end + def initializer Bugsnag.notify("handled string") render json: {} diff --git a/features/fixtures/rails5/.dockerignore b/features/fixtures/rails5/.dockerignore index a8aa41c4a..87a58ba13 100644 --- a/features/fixtures/rails5/.dockerignore +++ b/features/fixtures/rails5/.dockerignore @@ -1 +1,3 @@ +# Ignore the lock file so that we always use an up to date version. This won't +# exist unless the fixtures are run manually anyway. app/Gemfile.lock diff --git a/features/fixtures/rails5/app/app/controllers/app_type_controller.rb b/features/fixtures/rails5/app/app/controllers/app_type_controller.rb index 84f428f40..91ccbea21 100644 --- a/features/fixtures/rails5/app/app/controllers/app_type_controller.rb +++ b/features/fixtures/rails5/app/app/controllers/app_type_controller.rb @@ -1,6 +1,17 @@ class AppTypeController < ActionController::Base protect_from_forgery + def handled + raise "Handled error" + rescue StandardError => e + Bugsnag.notify(e) + render json: {} + end + + def unhandled + raise "Unhandled error" + end + def initializer Bugsnag.notify("handled string") render json: {} diff --git a/features/fixtures/rails5/app/config/routes.rb b/features/fixtures/rails5/app/config/routes.rb index fc7cbfff7..d5e6396d0 100644 --- a/features/fixtures/rails5/app/config/routes.rb +++ b/features/fixtures/rails5/app/config/routes.rb @@ -14,6 +14,8 @@ get 'api_key/environment', to: 'api_key#environment' get 'api_key/changing', to: 'api_key#changing' + get 'app_type/handled', to: 'app_type#handled' + get 'app_type/unhandled', to: 'app_type#unhandled' get 'app_type/initializer', to: 'app_type#initializer' get 'app_type/after', to: 'app_type#after' diff --git a/features/fixtures/rails6/.dockerignore b/features/fixtures/rails6/.dockerignore index a8aa41c4a..87a58ba13 100644 --- a/features/fixtures/rails6/.dockerignore +++ b/features/fixtures/rails6/.dockerignore @@ -1 +1,3 @@ +# Ignore the lock file so that we always use an up to date version. This won't +# exist unless the fixtures are run manually anyway. app/Gemfile.lock diff --git a/features/fixtures/rails6/app/.ruby-version b/features/fixtures/rails6/app/.ruby-version deleted file mode 100644 index 4fd0fe3cd..000000000 --- a/features/fixtures/rails6/app/.ruby-version +++ /dev/null @@ -1 +0,0 @@ -2.5.1 \ No newline at end of file diff --git a/features/fixtures/rails6/app/app/controllers/app_type_controller.rb b/features/fixtures/rails6/app/app/controllers/app_type_controller.rb index 84f428f40..91ccbea21 100644 --- a/features/fixtures/rails6/app/app/controllers/app_type_controller.rb +++ b/features/fixtures/rails6/app/app/controllers/app_type_controller.rb @@ -1,6 +1,17 @@ class AppTypeController < ActionController::Base protect_from_forgery + def handled + raise "Handled error" + rescue StandardError => e + Bugsnag.notify(e) + render json: {} + end + + def unhandled + raise "Unhandled error" + end + def initializer Bugsnag.notify("handled string") render json: {} diff --git a/features/fixtures/rails6/app/config/routes.rb b/features/fixtures/rails6/app/config/routes.rb index fc7cbfff7..d5e6396d0 100644 --- a/features/fixtures/rails6/app/config/routes.rb +++ b/features/fixtures/rails6/app/config/routes.rb @@ -14,6 +14,8 @@ get 'api_key/environment', to: 'api_key#environment' get 'api_key/changing', to: 'api_key#changing' + get 'app_type/handled', to: 'app_type#handled' + get 'app_type/unhandled', to: 'app_type#unhandled' get 'app_type/initializer', to: 'app_type#initializer' get 'app_type/after', to: 'app_type#after' diff --git a/features/fixtures/rake/.dockerignore b/features/fixtures/rake/.dockerignore new file mode 100644 index 000000000..87a58ba13 --- /dev/null +++ b/features/fixtures/rake/.dockerignore @@ -0,0 +1,3 @@ +# Ignore the lock file so that we always use an up to date version. This won't +# exist unless the fixtures are run manually anyway. +app/Gemfile.lock diff --git a/features/fixtures/sinatra1/Dockerfile b/features/fixtures/rake/Dockerfile similarity index 52% rename from features/fixtures/sinatra1/Dockerfile rename to features/fixtures/rake/Dockerfile index 70aabb9e4..9c1abffd4 100644 --- a/features/fixtures/sinatra1/Dockerfile +++ b/features/fixtures/rake/Dockerfile @@ -1,5 +1,8 @@ -ARG RUBY_TEST_VERSION -FROM ruby:$RUBY_TEST_VERSION +ARG RUBY_VERSION +FROM ruby:$RUBY_VERSION + +ARG RUBY_VERSION +FROM ruby:$RUBY_VERSION WORKDIR /bugsnag COPY temp-bugsnag-lib ./ @@ -8,6 +11,4 @@ WORKDIR /usr/src/app COPY app/Gemfile /usr/src/app/ RUN bundle install -COPY . /usr/src/app - -CMD ["ruby", "app.rb"] +COPY app/ /usr/src/app diff --git a/features/fixtures/sinatra2/Gemfile b/features/fixtures/rake/app/Gemfile similarity index 51% rename from features/fixtures/sinatra2/Gemfile rename to features/fixtures/rake/app/Gemfile index e20c0d612..e6181fac0 100644 --- a/features/fixtures/sinatra2/Gemfile +++ b/features/fixtures/rake/app/Gemfile @@ -1,4 +1,5 @@ source 'https://rubygems.org' gem 'bugsnag', path: '/bugsnag' -gem 'sinatra', '~> 2' + +gem 'rake', RUBY_VERSION <= '2.0.0' ? '12.2.1' : '>12.2.1' diff --git a/features/fixtures/rake/app/Rakefile.rb b/features/fixtures/rake/app/Rakefile.rb new file mode 100644 index 000000000..3d2560e00 --- /dev/null +++ b/features/fixtures/rake/app/Rakefile.rb @@ -0,0 +1,20 @@ +require 'bugsnag/integrations/rake' + +Bugsnag.configure do |config| + puts "Configuring `api_key` to #{ENV['BUGSNAG_API_KEY']}" + config.api_key = ENV['BUGSNAG_API_KEY'] + puts "Configuring `endpoint` to #{ENV['BUGSNAG_ENDPOINT']}" + config.endpoint = ENV['BUGSNAG_ENDPOINT'] +end + +task :unhandled do + raise 'Unhandled error' +end + +task :handled do + begin + raise 'Handled error' + rescue StandardError => e + Bugsnag.notify(e) + end +end diff --git a/features/fixtures/resque/.dockerignore b/features/fixtures/resque/.dockerignore deleted file mode 100644 index b844b143d..000000000 --- a/features/fixtures/resque/.dockerignore +++ /dev/null @@ -1 +0,0 @@ -Gemfile.lock diff --git a/features/fixtures/resque/Dockerfile b/features/fixtures/resque/Dockerfile deleted file mode 100644 index c88043af0..000000000 --- a/features/fixtures/resque/Dockerfile +++ /dev/null @@ -1,14 +0,0 @@ -ARG RUBY_TEST_VERSION -FROM ruby:$RUBY_TEST_VERSION - -WORKDIR /bugsnag -COPY temp-bugsnag-lib ./ - -WORKDIR /usr/src/app -COPY app/Gemfile /usr/src/app/ -RUN bundle install - -COPY . /usr/src/app -ENV QUEUE=* - -CMD ["bundle", "exec", "rake", "resque:work"] diff --git a/features/fixtures/resque/Gemfile b/features/fixtures/resque/Gemfile deleted file mode 100644 index 73f483882..000000000 --- a/features/fixtures/resque/Gemfile +++ /dev/null @@ -1,6 +0,0 @@ -source 'https://rubygems.org' - -gem 'bugsnag', path: '/bugsnag' -gem 'resque' -gem 'rake' -gem 'redis' diff --git a/features/fixtures/resque/Rakefile b/features/fixtures/resque/Rakefile deleted file mode 100644 index 89bb8d5e9..000000000 --- a/features/fixtures/resque/Rakefile +++ /dev/null @@ -1,4 +0,0 @@ -load 'app.rb' -require 'resque/tasks' - -Resque.redis = Redis.new(:url => 'redis://redis:6379') diff --git a/features/fixtures/resque/app.rb b/features/fixtures/resque/app.rb deleted file mode 100644 index d5aa82807..000000000 --- a/features/fixtures/resque/app.rb +++ /dev/null @@ -1,12 +0,0 @@ -require 'bundler' -Bundler.require - -class BugsnagWorker - @queue = :compute - - def self.perform(operation, a, b) - puts "Work started for #{operation} on #{a} and #{b}" - sleep 5 - puts "#{a} #{operation} #{b} = #{a.send(operation, b)}" - end -end diff --git a/features/fixtures/sidekiq/.dockerignore b/features/fixtures/sidekiq/.dockerignore index e81ff2a7b..67e50ef67 100644 --- a/features/fixtures/sidekiq/.dockerignore +++ b/features/fixtures/sidekiq/.dockerignore @@ -1,2 +1,4 @@ +# Ignore the lock file as we dynamically pick a Sidekiq version based on the +# environment, in order to run the same tests against multiple Sidekiq versions Gemfile.lock -payloads/ \ No newline at end of file +payloads/ diff --git a/features/fixtures/sidekiq/app/Gemfile b/features/fixtures/sidekiq/app/Gemfile index a43077622..6b241dfd9 100644 --- a/features/fixtures/sidekiq/app/Gemfile +++ b/features/fixtures/sidekiq/app/Gemfile @@ -1,7 +1,8 @@ source 'https://rubygems.org' gem 'bugsnag', path: '/bugsnag' -gem 'sidekiq', ENV['SIDEKIQ_VERSION'] -gem 'timers', '~> 4.1.1' +gem 'hitimes', '~> 1.2.6' +gem 'rake', '~> 12.3.0' gem 'redis', '~> 3.3.5' -gem 'rake', '~> 12.3.0' \ No newline at end of file +gem 'sidekiq', ENV['SIDEKIQ_VERSION'] +gem 'timers', '~> 4.1.2' diff --git a/features/fixtures/sinatra1/.dockerignore b/features/fixtures/sinatra1/.dockerignore deleted file mode 100644 index b844b143d..000000000 --- a/features/fixtures/sinatra1/.dockerignore +++ /dev/null @@ -1 +0,0 @@ -Gemfile.lock diff --git a/features/fixtures/sinatra1/Gemfile b/features/fixtures/sinatra1/Gemfile deleted file mode 100644 index 2c6acdfbe..000000000 --- a/features/fixtures/sinatra1/Gemfile +++ /dev/null @@ -1,4 +0,0 @@ -source 'https://rubygems.org' - -gem 'bugsnag', path: '/bugsnag' -gem 'sinatra', '~> 1' diff --git a/features/fixtures/sinatra1/app.rb b/features/fixtures/sinatra1/app.rb deleted file mode 100644 index 30c87b5cf..000000000 --- a/features/fixtures/sinatra1/app.rb +++ /dev/null @@ -1,9 +0,0 @@ -require 'bundler' -Bundler.require - -set bind: '0.0.0.0' -set port: 3000 - -get '/' do - 'Hello world!' -end diff --git a/features/fixtures/sinatra2/.dockerignore b/features/fixtures/sinatra2/.dockerignore deleted file mode 100644 index b844b143d..000000000 --- a/features/fixtures/sinatra2/.dockerignore +++ /dev/null @@ -1 +0,0 @@ -Gemfile.lock diff --git a/features/fixtures/sinatra2/app.rb b/features/fixtures/sinatra2/app.rb deleted file mode 100644 index 30c87b5cf..000000000 --- a/features/fixtures/sinatra2/app.rb +++ /dev/null @@ -1,9 +0,0 @@ -require 'bundler' -Bundler.require - -set bind: '0.0.0.0' -set port: 3000 - -get '/' do - 'Hello world!' -end diff --git a/features/mailman.feature b/features/mailman.feature new file mode 100644 index 000000000..60814d2f7 --- /dev/null +++ b/features/mailman.feature @@ -0,0 +1,26 @@ +Feature: Bugsnag raises errors in Mailman + +Scenario: An unhandled RuntimeError sends a report + Given I set environment variable "TARGET_EMAIL" to "emails/unhandled_error.eml" + And I set environment variable "APP_PATH" to "/usr/src" + And I start the service "mailman" + And I wait to receive a request + Then the request is valid for the error reporting API version "4.0" for the "Ruby Bugsnag Notifier" + And the event "unhandled" is true + And the event "severity" equals "error" + And the event "severityReason.type" equals "unhandledExceptionMiddleware" + And the event "severityReason.attributes.framework" equals "Mailman" + And the event "app.type" equals "mailman" + And the exception "errorClass" equals "RuntimeError" + +Scenario: A handled RuntimeError sends a report + Given I set environment variable "TARGET_EMAIL" to "emails/handled_error.eml" + And I set environment variable "APP_PATH" to "/usr/src" + And I start the service "mailman" + And I wait to receive a request + Then the request is valid for the error reporting API version "4.0" for the "Ruby Bugsnag Notifier" + And the event "unhandled" is false + And the event "severity" equals "warning" + And the event "severityReason.type" equals "handledException" + And the event "app.type" equals "mailman" + And the exception "errorClass" equals "RuntimeError" diff --git a/features/que.feature b/features/que.feature new file mode 100644 index 000000000..73914113d --- /dev/null +++ b/features/que.feature @@ -0,0 +1,24 @@ +Feature: Errors are delivered to Bugsnag from Que + +Scenario: Que will deliver unhandled errors + Given I run the service "que" with the command "bundle exec ruby app.rb unhandled" + And I run the service "que" with the command "bundle exec que ./app.rb" + And I wait to receive a request + Then the request is valid for the error reporting API version "4.0" for the "Ruby Bugsnag Notifier" + And the event "unhandled" is true + And the event "severity" equals "error" + And the event "severityReason.type" equals "unhandledExceptionMiddleware" + And the event "severityReason.attributes.framework" equals "Que" + And the event "app.type" equals "que" + And the exception "errorClass" equals "RuntimeError" + +Scenario: Que will deliver handled errors + Given I run the service "que" with the command "bundle exec ruby app.rb handled" + And I run the service "que" with the command "bundle exec que ./app.rb" + And I wait to receive a request + Then the request is valid for the error reporting API version "4.0" for the "Ruby Bugsnag Notifier" + And the event "unhandled" is false + And the event "severity" equals "warning" + And the event "severityReason.type" equals "handledException" + And the event "app.type" equals "que" + And the exception "errorClass" equals "RuntimeError" diff --git a/features/rack.feature b/features/rack.feature new file mode 100644 index 000000000..1998712d9 --- /dev/null +++ b/features/rack.feature @@ -0,0 +1,24 @@ +Feature: Bugsnag raises errors in Rack + +Scenario: An unhandled RuntimeError sends a report + Given I start the rack service + When I navigate to the route "/unhandled" on the rack app + And I wait to receive a request + Then the request is valid for the error reporting API version "4.0" for the "Ruby Bugsnag Notifier" + And the event "unhandled" is true + And the event "severity" equals "error" + And the event "severityReason.type" equals "unhandledExceptionMiddleware" + And the event "severityReason.attributes.framework" equals "Rack" + And the event "app.type" equals "rack" + And the exception "errorClass" equals "RuntimeError" + +Scenario: A handled RuntimeError sends a report + Given I start the rack service + When I navigate to the route "/handled" on the rack app + And I wait to receive a request + Then the request is valid for the error reporting API version "4.0" for the "Ruby Bugsnag Notifier" + And the event "unhandled" is false + And the event "severity" equals "warning" + And the event "severityReason.type" equals "handledException" + And the event "app.type" equals "rack" + And the exception "errorClass" equals "RuntimeError" diff --git a/features/rails_features/app_type.feature b/features/rails_features/app_type.feature index 75f868c8e..5a14b33fe 100644 --- a/features/rails_features/app_type.feature +++ b/features/rails_features/app_type.feature @@ -22,3 +22,21 @@ Scenario: Changing app_type after initializer works And the exception "message" starts with "handled string" And the event "metaData.request.url" ends with "/app_type/after?type=maze_after_initializer" And the event "app.type" equals "maze_after_initializer" + +@rails3 @rails4 @rails5 @rails6 +Scenario: Should default to "rails" for handled errors + Given I start the rails service + When I navigate to the route "/app_type/handled" on the rails app + And I wait to receive a request + Then the request is valid for the error reporting API version "4.0" for the "Ruby Bugsnag Notifier" + And the event "metaData.request.url" ends with "/app_type/handled" + And the event "app.type" equals "rails" + +@rails3 @rails4 @rails5 @rails6 +Scenario: Should default to "rails" for unhandled errors + Given I start the rails service + When I navigate to the route "/app_type/unhandled" on the rails app + And I wait to receive a request + Then the request is valid for the error reporting API version "4.0" for the "Ruby Bugsnag Notifier" + And the event "metaData.request.url" ends with "/app_type/unhandled" + And the event "app.type" equals "rails" diff --git a/features/rake.feature b/features/rake.feature new file mode 100644 index 000000000..5e3fbf421 --- /dev/null +++ b/features/rake.feature @@ -0,0 +1,22 @@ +Feature: Bugsnag raises errors in Rake + +Scenario: An unhandled RuntimeError sends a report + Given I run the service "rake" with the command "bundle exec rake unhandled" + And I wait to receive a request + Then the request is valid for the error reporting API version "4.0" for the "Ruby Bugsnag Notifier" + And the event "unhandled" is true + And the event "severity" equals "error" + And the event "severityReason.type" equals "unhandledExceptionMiddleware" + And the event "severityReason.attributes.framework" equals "Rake" + And the event "app.type" equals "rake" + And the exception "errorClass" equals "RuntimeError" + +Scenario: A handled RuntimeError sends a report + Given I run the service "rake" with the command "bundle exec rake handled" + And I wait to receive a request + Then the request is valid for the error reporting API version "4.0" for the "Ruby Bugsnag Notifier" + And the event "unhandled" is false + And the event "severity" equals "warning" + And the event "severityReason.type" equals "handledException" + And the event "app.type" equals "rake" + And the exception "errorClass" equals "RuntimeError" diff --git a/features/sidekiq.feature b/features/sidekiq.feature index a7842fa0c..020abbce5 100644 --- a/features/sidekiq.feature +++ b/features/sidekiq.feature @@ -9,6 +9,7 @@ Scenario: An unhandled RuntimeError sends a report And the event "context" equals "UnhandledError@default" And the event "severityReason.type" equals "unhandledExceptionMiddleware" And the event "severityReason.attributes.framework" equals "Sidekiq" + And the event "app.type" equals "sidekiq" And the exception "errorClass" equals "RuntimeError" And the "file" of stack frame 0 equals "/app/app.rb" And the "lineNumber" of stack frame 0 equals 33 @@ -24,7 +25,8 @@ Scenario: A handled RuntimeError can be notified And the event "context" equals "HandledError@default" And the event "severity" equals "warning" And the event "severityReason.type" equals "handledException" + And the event "app.type" equals "sidekiq" And the exception "errorClass" equals "RuntimeError" And the payload field "events.0.metaData.sidekiq" matches the appropriate Sidekiq handled payload And the event "metaData.sidekiq.msg.created_at" is a parsable timestamp in seconds - And the event "metaData.sidekiq.msg.enqueued_at" is a parsable timestamp in seconds \ No newline at end of file + And the event "metaData.sidekiq.msg.enqueued_at" is a parsable timestamp in seconds diff --git a/features/steps/ruby_notifier_steps.rb b/features/steps/ruby_notifier_steps.rb index eef51b025..23c330899 100644 --- a/features/steps/ruby_notifier_steps.rb +++ b/features/steps/ruby_notifier_steps.rb @@ -52,6 +52,21 @@ } end +Given("I start the rack service") do + rack_version = ENV["RACK_VERSION"] + steps %Q{ + When I start the service "rack#{rack_version}" + And I wait for the host "rack#{rack_version}" to open port "3000" + } +end + +When("I navigate to the route {string} on the rack app") do |route| + rack_version = ENV["RACK_VERSION"] + steps %Q{ + When I open the URL "http://rack#{rack_version}:3000#{route}" + } +end + Then("the payload field {string} matches the appropriate Sidekiq handled payload") do |field| if ENV["SIDEKIQ_VERSION"] == "~> 2" created_at_present = "false"