Sha256: 59719abc196236b024b835731f69f09e149815f6daac0c0ec36876e647921259

Contents?: true

Size: 921 Bytes

Versions: 2

Compression:

Stored size: 921 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("/*maintenance:lhm*/SELECT @@global.hostname as host").each.first["host"], "mysql-1"
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lhm-shopify-3.5.2 spec/integration/proxysql_spec.rb
lhm-shopify-3.5.1 spec/integration/proxysql_spec.rb