| 20 | include Helper::Omittable |
| 21 | |
| 22 | def setup |
| 23 | @server = nil |
| 24 | omit("Arrow Flight SQL is required") unless defined?(ArrowFlightSQL) |
| 25 | omit("Unstable on Windows") if Gem.win_platform? |
| 26 | omit("Unstable on x86_64 macOS") if /x86_64-darwin/.match?(RUBY_PLATFORM) |
| 27 | @server = Helper::FlightSQLServer.new |
| 28 | host = "127.0.0.1" |
| 29 | location = ArrowFlight::Location.new("grpc://#{host}:0") |
| 30 | options = ArrowFlight::ServerOptions.new(location) |
| 31 | @server.listen(options) |
| 32 | @location = ArrowFlight::Location.new("grpc://#{host}:#{@server.port}") |
| 33 | @client = ArrowFlight::Client.new(@location) |
| 34 | @sql_client = ArrowFlightSQL::Client.new(@client) |
| 35 | end |
| 36 | |
| 37 | def teardown |
| 38 | return if @server.nil? |