Add script to toggle E2E test backend between sandboxed and non-sandboxed modes (#2588)
Summary
Closes #2588
- [n] y/n | Does it introduce breaking changes?
- [n] y/n | Is it dependent on a specific version of
cargo-contractorpallet-revive?
Description
Implements bash script switch-e2e-backend.sh that allows developers to easily switch between sandboxed and non-sandboxed E2E test backends for contracts.
Features
- Accepts
--manifest-pathargument pointing to contract's Cargo.toml - Automatically detects current mode and switches to opposite
- Converts test attributes between
#[ink_e2e::test]and#[ink_sandbox::test(backend(runtime_only(...)))] - Manages sandbox feature flag in Cargo.toml dependencies
- Handles tests with additional parameters (environment, replace_test_attr)
Usage
# Switch to sandboxed mode
./switch-e2e-backend.sh --manifest-path ./integration-tests/my_contract/Cargo.toml
# Switch back to non-sandboxed mode
./switch-e2e-backend.sh --manifest-path ./integration-tests/my_contract/Cargo.toml
Checklist before requesting a review
- [x] I have added an entry to
CHANGELOG.md - [x] I have commented on my code, particularly in hard-to-understand areas
- [x] I have added tests that prove my fix is effective or that my feature works
- [x] Any dependent changes have been merged and published in downstream modules
Hey @cmichi. Please check, it's ready for review.
He @grandima, amazing that you contribute to ink!. I'm really sorry we didn't reply to the PR yet.
Right now I'm doing a lot of refactoring in terms of the e2e framework. Once I have a better view on the state of things I will review this PR.
Do you need this urgently?
Let me know if you want to work on another issue which I can review :)
Hey @Daanvdplas. Not urgently! And yes, I'd like to work on another issue if you have one.
Best would be to check the most recent issues and ping in the ink! telegram which is best to work on. Then we also motivate others to work on issues because everyone should feel motivated to do so :)
Deal?