dfinity / ic-repl

Apache License 2.0
70 stars 10 forks source link

Feature Request: Mechanism to refer this as a library from our Rust codebase and call as part of `cargo test` #38

Closed saikatdas0790 closed 2 years ago

saikatdas0790 commented 2 years ago

Since this is written in Rust, I believe the internal modules could be decoupled to be called by this CLI and be used from a Rust codebase as an integration testing framework.

That way we can write tests in our Rust codebase and co-located with our application code but with a #[cfg(test)] so that tests get run within their own binary like how native Rust tests are supposed to run and then our application code gets only compiled to wasm canisters as intended.

@chenyan-dfinity @chenyan2002 Thoughts?

chenyan-dfinity commented 2 years ago

Sure. But if you want to run canister tests in Rust, I recommend you to try the ic-state-machine-tests, which is much faster than ic-repl. See this example: https://github.com/dfinity/cdk-rs/blob/main/e2e-tests/tests/e2e.rs