Sha256: ffcc176e9322e5b638d8f808e1c22f79022def31a273fe887d6ac267c0f5674b

Contents?: true

Size: 971 Bytes

Versions: 11

Compression:

Stored size: 971 Bytes

Contents

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

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

  it "Should contact the reader" do
    conn = DATABASE.client.new(
      host: '127.0.0.1',
      username: "reader",
      password: "password",
      port: "13005",
      )

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

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

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

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
lhm-shopify-4.5.0 spec/integration/proxysql_spec.rb
lhm-shopify-4.4.2 spec/integration/proxysql_spec.rb
lhm-shopify-4.4.1 spec/integration/proxysql_spec.rb
lhm-shopify-4.4.0 spec/integration/proxysql_spec.rb
lhm-shopify-4.3.0 spec/integration/proxysql_spec.rb
lhm-shopify-4.2.3 spec/integration/proxysql_spec.rb
lhm-shopify-4.2.2 spec/integration/proxysql_spec.rb
lhm-shopify-4.2.1 spec/integration/proxysql_spec.rb
lhm-shopify-4.2.0 spec/integration/proxysql_spec.rb
lhm-shopify-4.1.1 spec/integration/proxysql_spec.rb
lhm-shopify-4.1.0 spec/integration/proxysql_spec.rb