Successfully migrated the minotari-cli project from a single package structure to a Cargo workspace with two packages:
minotari: Main CLI wallet applicationintegration-tests: Cucumber BDD integration tests
Created a new workspace root with the following structure:
minotari-cli/
├── Cargo.toml # Workspace root
├── minotari/ # Main package
│ ├── Cargo.toml
│ ├── src/ # Application source code
│ ├── config/ # Configuration files
│ ├── migrations/ # Database migrations
│ ├── resources/ # Default resources
│ └── openapi/ # OpenAPI tests
└── integration-tests/ # Integration tests package
├── Cargo.toml
├── features/ # Gherkin feature files
├── steps/ # Cucumber step definitions
├── src/ # Base node process support
└── tests/
└── cucumber.rs # Test runner
[workspace]
resolver = "2"
members = [
"minotari",
"integration-tests",
]
[workspace.package]
version = "0.1.0"
edition = "2024"
authors = ["The Tari Development Community"]
license = "BSD-3-Clause"- Updated to use workspace-inherited metadata:
version.workspace = trueedition.workspace = trueauthors.workspace = truelicense.workspace = true
- Removed cucumber-related dev-dependencies (moved to integration-tests)
- Retained all production dependencies
New package with:
- Cucumber BDD framework dependencies
- Base node integration dependencies (minotari_node, tari_comms, etc.)
minotarias a path dependency- Test harness configuration:
harness = false
| From | To |
|---|---|
src/ |
minotari/src/ |
config/ |
minotari/config/ |
migrations/ |
minotari/migrations/ |
resources/ |
minotari/resources/ |
tests/openapi/ |
minotari/openapi/ |
tests/cucumber/ |
integration-tests/ |
tests/integration_tests.rs |
integration-tests/tests/cucumber.rs |
- Updated root
README.md:- Added "Project Structure" section
- Updated test running instructions
- Fixed test documentation links
- All integration test documentation moved to
integration-tests/
# Run integration tests
cargo test -p integration-tests
# Build main package
cargo build -p minotari
# Build entire workspace
cargo buildcd integration-tests
cargo test- Main application and tests are clearly separated
- Each package has its own dependency tree
- Tests don't pollute main package dependencies
- Standard Cargo workspace pattern
- Easier to navigate and understand
- Clear module boundaries
- Independent version management possible
- Easier to add new packages in the future
- Better for CI/CD pipeline organization
- Can build/test packages independently
- Faster incremental builds for main package
- Better IDE support for workspaces
- Created symlink
integration-tests/tests/steps -> ../stepsfor test runner access
- Integration tests depend on minotari via:
minotari = { path = "../minotari" } - All internal paths in test files remain relative and unchanged
- Original test command
cargo test --test integration_testsno longer works - New command:
cargo test -p integration-tests - Documentation updated to reflect new commands
Potential additions to the workspace:
cli-tools: Additional CLI utilitiesbenchmarks: Performance benchmarking suiteexamples: Example applications using the wallet library
To verify the migration:
# Check workspace structure
cargo metadata --format-version 1 | jq '.workspace_members'
# Build all packages
cargo build --workspace
# Run all tests
cargo test --workspace
# Check for issues
cargo check --workspace