File: integration_async_helper.rb

package info (click to toggle)
ruby-sinatra 4.2.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,932 kB
  • sloc: ruby: 17,700; sh: 25; makefile: 8
file content (23 lines) | stat: -rw-r--r-- 551 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
require File.expand_path('integration_helper', __dir__)

module IntegrationAsyncHelper
  Server = IntegrationHelper::BaseServer

  def it(message, &block)
    Server.all_async.each do |server|
      next unless server.installed?
      super("with #{server.name}: #{message}") { server.run_test(self, &block) }
    end
  end

  def self.extend_object(obj)
    super

    base_port = 5100 + Process.pid % 100
    servers = %w(puma)

    servers.each_with_index do |server, index|
      Server.run(server, base_port+index, async: true)
    end
  end
end