Closed ondrowan closed 5 years ago
The only problem I feel with directly using std::process::Command
is the amount of plumbing work one has to do to make the errors including docker images failures are logged properly should they fail.
One thing that comes to my mind, is to probably use something like https://github.com/testcontainers/testcontainers-rs
that handles the setup and teardown process but it looks like we would have to create a crate to setup dgraph
server
I've written functional tests for this library, but I have no idea how to include them into Rust's testing pipeline. The problem is that I need two separate instances of Dgraph for testing (secure and insecure; on non-standard ports, so it doesn't interfere with user's data on local instance). Docker is an obvious choice for this, but I have no idea how to write a (multi-platform) script that can also run setup and teardown of these instances. Basically I need something that runs:
docker-compose up
cargo test
docker-compose down
Is there any way to do this easily via Cargo scripts? Right now the most obvious way that comes into my mind is to run these commands via
std::process::Command
, but I don't know what pitfalls does this approach have.