scarb icon indicating copy to clipboard operation
scarb copied to clipboard

Introduce test targets, get rid of test compilation being fanout among Scarb & cairo-test

Open mkaput opened this issue 1 year ago • 2 comments

We have an incident ⚠ All of: Scarb, Protostar and cairo-test-runner are manually constructing the RootDatabase and compiling tests on their own. The reason for this was to quickly deliver working software. We should eventually fix that!

The plan is:

  1. Let Scarb define a built-in [[test]] target.
  2. Decide between all 3 projects what kinds of artifacts should this target produce. It should definitely include built, loadable Sierra code & some metadata files at least defining test functions paths.
  3. Migrate Protostar & cairo-test-runner to expect tests to be compiled externally by Scarb and only execute these artifacts.

mkaput avatar May 26 '23 13:05 mkaput

Q: Perhaps the cairo-runner could also make a use of this target? @4rgorok

mkaput avatar May 31 '23 10:05 mkaput

Please do not forget to support /tests dir in projects structure https://github.com/starkware-libs/cairo/issues/3777 https://github.com/foundry-rs/starknet-foundry/issues/289

maciektr avatar Jul 27 '23 12:07 maciektr

Closing, as Starknet Foundry is migrated to procedural macros now 🥳 https://github.com/foundry-rs/starknet-foundry/tree/master/crates/snforge-scarb-plugin

maciektr avatar Aug 28 '24 11:08 maciektr