Skip to content

Development Setup

  • Rust 1.90+ (nightly recommended)
  • Git
  • Make (optional but recommended)
  1. Clone the repository

    Terminal window
    git clone https://github.com/WalshyDev/orb.git
    cd orb
  2. Build the project

    Terminal window
    make build
    # or
    cargo build
  3. Run the tests

    Terminal window
    make test
    # or
    cargo test
  4. Run orb locally

    Terminal window
    ./target/debug/orb --help
orb/
├── packages/
│ ├── orb-cli/ # CLI application
│ │ ├── src/
│ │ └── tests/
│ ├── orb-client/ # HTTP client library
│ │ └── src/
│ └── orb-mockhttp/ # Mock HTTP server
│ ├── src/
│ └── tests/
├── Cargo.toml # Workspace config
├── Makefile # Build automation
└── README.md
Terminal window
# Debug build
make build
# Release build
make release
# Run tests
make test
# Generate coverage report
make coverage
# Lint check
make lint
# Auto-fix lint issues
make fix
# Clean build artifacts
make clean
# Show binary size
make size
Terminal window
# All tests
cargo test
# Specific package
cargo test -p orb-cli
cargo test -p orb-client
cargo test -p orb-mockhttp
# Specific test
cargo test test_name
# With output
cargo test -- --nocapture
Terminal window
make coverage

Opens an HTML coverage report in your browser.

  1. Create a feature branch

    Terminal window
    git checkout -b feature/my-feature
  2. Make your changes

  3. Run tests

    Terminal window
    make test
  4. Run lints

    Terminal window
    make lint
  5. Commit your changes

    Terminal window
    git commit -m "Add my feature"
  1. Add the option to packages/orb-cli/src/cli.rs
  2. Add validation (if needed) in cli.rs
  3. Call validation from main.rs
  4. Implement the feature in appropriate module
  5. Add tests to packages/orb-cli/tests/options.rs

Use test_case for parameterized tests:

use test_case::test_case;
#[test_case("input1", "expected1"; "test name 1")]
#[test_case("input2", "expected2"; "test name 2")]
fn test_feature(input: &str, expected: &str) {
// Test implementation
}

For HTTP tests, use orb-mockhttp:

use orb_mockhttp::TestServerBuilder;
#[tokio::test]
async fn test_http_feature() {
let server = TestServerBuilder::new().build();
server.on_request("/test")
.respond_with(200, "OK");
// Test against server.url("/test")
}
  • Use rustfmt for formatting (make fix)
  • Follow existing patterns in the codebase
  • Write helpful error messages
  • Use the fatal! macro only in CLI layer
  • Document public APIs with doc comments
  1. Use test_case for variations of the same test
  2. Use orb-mockhttp for HTTP integration tests
  3. Test error cases as well as success cases
  4. Test edge cases (empty inputs, special characters, etc.)
Terminal window
# See request/response details
./target/debug/orb -v https://example.com
Terminal window
# Show stdout during tests
cargo test -- --nocapture
Terminal window
# Full debug symbols
RUST_BACKTRACE=1 ./target/debug/orb https://example.com
Terminal window
# macOS Universal Binary
make build-macos
# Linux
make build-linux
# Windows
make build-windows
# All platforms
make build-binaries