starknet-remix-plugin icon indicating copy to clipboard operation
starknet-remix-plugin copied to clipboard

Feature: Test contracts using Scarb or Foundry

Open JorikSchellekens opened this issue 2 years ago • 9 comments

Feature Request Summary

It would be amazing to be able to test the cairo contracts directly in the IDE. Currently, testing is only feasible via two strategies:

  1. Download all the files locally and write the tests in your favourite tool
  2. Deloy the files to testnet and play with it manually / write scripts to interact with these testnet instances

Detailed Description

Both Scarb and Foundry have testing integrations with slightly different styles. We should support at least Foundry's implementation of this in the IDE itself.


UI Integration

Sketch or Mockup: [Link to an image or diagram if possible]

A whole panel should be dedicated to testing, similar to how it's done in VS Code. The output of tests should probably be piped to the terminal provided.


Backend Implementation

For now, I assume we'll need to run all the testing on the backend, this requires more api's which simply pipe the response of the remote execution to the browser. In the long term the wasm'd version of foundry should support this out of the box.


Desired Behavior


Examples from Other Projects


Additional Information


Note: Thanks for taking the time to fill out this feature request. Our team will review it and provide feedback or ask further questions if needed. Your input helps us make our browser-based IDE better for everyone!


JorikSchellekens avatar Oct 18 '23 12:10 JorikSchellekens

can i take this?

faytey avatar Feb 15 '24 09:02 faytey

Yeah sure @faytey

rjnrohit avatar Feb 20 '24 07:02 rjnrohit

Lemme know if you need anything regarding this issue

rjnrohit avatar Feb 20 '24 07:02 rjnrohit

Thanks @rjnrohit currently on it

faytey avatar Feb 22 '24 13:02 faytey

please i'm having issues running the setup, in the API folder on bash it fails to clone the compilers, I'm using the readme to setup. Please what do you recommend

faytey avatar Feb 22 '24 13:02 faytey

did you run the git submodule update command? would you paste the error that you are getting?

rjnrohit avatar Feb 22 '24 13:02 rjnrohit

yes i did run the git submodule update

git submodule update --init;
cargo build;
Submodule 'api/cairo' (https://github.com/starkware-libs/cairo.git) registered for path 'cairo'
Submodule 'api/cairo_compilers/v2.5.0' (https://github.com/starkware-libs/cairo) registered for path 'cairo_compilers/v2.5.0'
Submodule 'api/cairo_compilers/v2.5.1' (https://github.com/starkware-libs/cairo) registered for path 'cairo_compilers/v2.5.1'
Submodule 'api/cairo_compilers/v2.5.2' (https://github.com/starkware-libs/cairo) registered for path 'cairo_compilers/v2.5.2'
Submodule 'api/cairo_compilers/v2.5.3' (https://github.com/starkware-libs/cairo) registered for path 'cairo_compilers/v2.5.3'
Submodule 'api/cairo_compilers/v2.5.4' (https://github.com/starkware-libs/cairo) registered for path 'cairo_compilers/v2.5.4'
Cloning into '/Users/faytey7/Desktop/starknet-remix-plugin/api/cairo'...
Cloning into '/Users/faytey7/Desktop/starknet-remix-plugin/api/cairo_compilers/v2.5.0'...
error: RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: CANCEL (err 8)
error: 4745 bytes of body are still expected
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: fetc

faytey avatar Feb 22 '24 13:02 faytey

git submodule update --init;
cargo build;
Submodule 'api/cairo' (https://github.com/starkware-libs/cairo.git) registered for path 'cairo'
Submodule 'api/cairo_compilers/v2.5.0' (https://github.com/starkware-libs/cairo) registered for path 'cairo_compilers/v2.5.0'
Submodule 'api/cairo_compilers/v2.5.1' (https://github.com/starkware-libs/cairo) registered for path 'cairo_compilers/v2.5.1'
Submodule 'api/cairo_compilers/v2.5.2' (https://github.com/starkware-libs/cairo) registered for path 'cairo_compilers/v2.5.2'
Submodule 'api/cairo_compilers/v2.5.3' (https://github.com/starkware-libs/cairo) registered for path 'cairo_compilers/v2.5.3'
Submodule 'api/cairo_compilers/v2.5.4' (https://github.com/starkware-libs/cairo) registered for path 'cairo_compilers/v2.5.4'
Cloning into '/Users/faytey7/Desktop/starknet-remix-plugin/api/cairo'...
Cloning into '/Users/faytey7/Desktop/starknet-remix-plugin/api/cairo_compilers/v2.5.0'...
error: RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: CANCEL (err 8)
error: 4745 bytes of body are still expected
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: fetch-pack: invalid index-pack output
fatal: clone of 'https://github.com/starkware-libs/cairo' into submodule path '/Users/faytey7/Desktop/starknet-remix-plugin/api/cairo_compilers/v2.5.0' failed
Failed to clone 'api/cairo_compilers/v2.5.0'. Retry scheduled
Cloning into '/Users/faytey7/Desktop/starknet-remix-plugin/api/cairo_compilers/v2.5.1'...
error: RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: CANCEL (err 8)
error: 931 bytes of body are still expected
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: fetch-pack: invalid index-pack output
fatal: clone of 'https://github.com/starkware-libs/cairo' into submodule path '/Users/faytey7/Desktop/starknet-remix-plugin/api/cairo_compilers/v2.5.1' failed
Failed to clone 'api/cairo_compilers/v2.5.1'. Retry scheduled
Cloning into '/Users/faytey7/Desktop/starknet-remix-plugin/api/cairo_compilers/v2.5.2'...
Cloning into '/Users/faytey7/Desktop/starknet-remix-plugin/api/cairo_compilers/v2.5.3'...
error: RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: CANCEL (err 8)
error: 6727 bytes of body are still expected
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: fetch-pack: invalid index-pack output
fatal: clone of 'https://github.com/starkware-libs/cairo' into submodule path '/Users/faytey7/Desktop/starknet-remix-plugin/api/cairo_compilers/v2.5.3' failed
Failed to clone 'api/cairo_compilers/v2.5.3'. Retry scheduled
Cloning into '/Users/faytey7/Desktop/starknet-remix-plugin/api/cairo_compilers/v2.5.4'...
Cloning into '/Users/faytey7/Desktop/starknet-remix-plugin/api/cairo_compilers/v2.5.0'...
error: RPC failed; curl 92 HTTP/2 stream 0 was not closed cleanly: CANCEL (err 8)
error: 4930 bytes of body are still expected
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: fetch-pack: invalid index-pack output
fatal: clone of 'https://github.com/starkware-libs/cairo' into submodule path '/Users/faytey7/Desktop/starknet-remix-plugin/api/cairo_compilers/v2.5.0' failed
Failed to clone 'api/cairo_compilers/v2.5.0' a second time, aborting
    Finished dev [unoptimized + debuginfo] target(s) in 0.28s
faytey7@Faytey7-MacBook-Air api % 

faytey avatar Feb 22 '24 13:02 faytey

hello @rjnrohit still awaiting feedback on this

faytey avatar May 02 '24 15:05 faytey