ink icon indicating copy to clipboard operation
ink copied to clipboard

Add script to toggle E2E test backend between sandboxed and non-sandboxed modes (#2588)

Open grandima opened this issue 2 months ago • 4 comments

Summary

Closes #2588

  • [n] y/n | Does it introduce breaking changes?
  • [n] y/n | Is it dependent on a specific version of cargo-contract or pallet-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-path argument 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

grandima avatar Oct 29 '25 14:10 grandima

Hey @cmichi. Please check, it's ready for review.

grandima avatar Oct 29 '25 14:10 grandima

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 :)

Daanvdplas avatar Dec 02 '25 01:12 Daanvdplas

Hey @Daanvdplas. Not urgently! And yes, I'd like to work on another issue if you have one.

grandima avatar Dec 02 '25 01:12 grandima

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?

Daanvdplas avatar Dec 02 '25 01:12 Daanvdplas