Sha256: dc6fc7a7d54bebcaf55b909d252ab2d6b230d7d7563368ebf60d1b7033a23270

Contents?: true

Size: 937 Bytes

Versions: 9

Compression:

Stored size: 937 Bytes

Contents

describe "ProxySQL integration" do
  it "Should contact the writer" do
    conn = Mysql2::Client.new(
      host: '127.0.0.1',
      username: "writer",
      password: "password",
      port: "33005",
      )

    assert_equal conn.query("SELECT @@global.hostname as host").each.first["host"], "mysql-1"
  end

  it "Should contact the reader" do
    conn = Mysql2::Client.new(
      host: '127.0.0.1',
      username: "reader",
      password: "password",
      port: "33005",
      )

    assert_equal conn.query("SELECT @@global.hostname as host").each.first["host"], "mysql-2"
  end

  it "Should override default hostgroup from user if rule matches" do
    conn = Mysql2::Client.new(
      host: '127.0.0.1',
      username: "reader",
      password: "password",
      port: "33005",
      )

    assert_equal conn.query("SELECT @@global.hostname as host #{Lhm::ProxySQLHelper::ANNOTATION}").each.first["host"], "mysql-1"
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
lhm-shopify-4.0.0 spec/integration/proxysql_spec.rb
lhm-teak-3.6.4 spec/integration/proxysql_spec.rb
lhm-teak-3.6.3 spec/integration/proxysql_spec.rb
lhm-teak-3.6.2 spec/integration/proxysql_spec.rb
lhm-teak-3.6.1 spec/integration/proxysql_spec.rb
lhm-teak-3.6.0 spec/integration/proxysql_spec.rb
lhm-shopify-3.5.5 spec/integration/proxysql_spec.rb
lhm-shopify-3.5.4 spec/integration/proxysql_spec.rb
lhm-shopify-3.5.3 spec/integration/proxysql_spec.rb