Skip to content
pgdogdevPublic

About

Regression testing

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

7 Commits

Folders and files

Repository files navigation

PgDog regression testing

Pretty straightforward library to run regression tests against two PostgreSQL servers and make sure both return the same responses.

Since we're a network proxy that also re-implements the protocol, these tests will assert equality of responses all the way to the binary protocol level, byte-for-byte.

How to use

Add the crate to your dependencies:

[dependencies]
pgdog-regress = { git = "https://github.com/pgdogdev/regress.git" }

Write your tests:

use pgdog_regress::prelude::*;

let server_a = ConnectionArgs {
    addr: "127.0.0.1:5432",
    user: "pgdog",
    password: "pgdog",
    database: "pgdog",
};
let server_b = ConnectionArgs {
    addr: "127.0.0.1:6432".into(),
    ..server_a
};

RegressTest::new(&["SELECT 1"])
    .run_simple(server_a, server_b)
    .await
    .unwrap();

The tests will panic if the two servers respond with different anything.

Known errors

To exclude known bad queries from execution, mark queries in the test suite:

RegressTest::new(&["SELECT 1", "SELECT version()"])
    .known_bad_queries(&["SELECT version()"])
    .run_simple(server_a, server_b)
    .await
    .unwrap();

About

Regression testing

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages