Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Test contracts using Scarb or Foundry #157

Open
JorikSchellekens opened this issue Oct 18, 2023 · 9 comments
Open

Feature: Test contracts using Scarb or Foundry #157

JorikSchellekens opened this issue Oct 18, 2023 · 9 comments
Assignees
Labels
good first issue Good for newcomers ODHack Issues are part of the HackODFest and the contributors will be rewarded during the hackathon period

Comments

@JorikSchellekens
Copy link
Contributor

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!


@rjnrohit rjnrohit added good first issue Good for newcomers ODHack Issues are part of the HackODFest and the contributors will be rewarded during the hackathon period labels Feb 14, 2024
@faytey
Copy link

faytey commented Feb 15, 2024

can i take this?

@rjnrohit
Copy link
Contributor

Yeah sure @faytey

@rjnrohit
Copy link
Contributor

Lemme know if you need anything regarding this issue

@faytey
Copy link

faytey commented Feb 22, 2024

Thanks @rjnrohit currently on it

@faytey
Copy link

faytey commented Feb 22, 2024

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

@rjnrohit
Copy link
Contributor

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

@faytey
Copy link

faytey commented Feb 22, 2024

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
Copy link

faytey commented Feb 22, 2024

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
Copy link

faytey commented May 2, 2024

hello @rjnrohit still awaiting feedback on this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers ODHack Issues are part of the HackODFest and the contributors will be rewarded during the hackathon period
Projects
None yet
Development

No branches or pull requests

3 participants