Skip to content

Latest commit

 

History

History
36 lines (25 loc) · 1.46 KB

DEVELOPING.md

File metadata and controls

36 lines (25 loc) · 1.46 KB

Developing Trow

sqlx setup

To develop, build and test Trow, an sqlx development database is required. The TL;DR is mkdir -p target && cargo sqlx database setup, more information can be found at https://github.com/launchbadge/sqlx/blob/main/sqlx-cli/README.md.

Using Docker/Podman

The easiest way to build and test Trow is by using the Containerfiles and associated scripts. If you want a local binary, the Trow executable can be copied out of the final image. The only dependency for building Trow in this way is Docker or Podman.

Using Local Tools

Trow is written in Rust.

To compile Rust locally, first install rustup if you haven't already. Set the compiler default to nightly with rustup default nightly and run rustup component add rustfmt. Then run rustup update to make sure you're running a version of Rust with rustfmt component. Now you should be able to run cargo build from the project root and the Trow binary will be written to /target/debug/trow.

To execute the binary, you can run cargo run, which will first recompile Trow if anything has changed.

Testing Trow

There are multiple ways to test Trow:

  • cargo test
    • cargo test --lib --bins to run only unit tests
    • cargo test --test '*' to run only integration tests
  • cargo test -- --ignored to run the smoke tests
  • ./run_oci_conformance_tests.sh to run the OCI conformance tests