software-mansion / software-mansion/cairo-coverage

Enable Users to see Code Coverage on expaned code

Open
#49 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement scarb starknet foundry
Dominant language
Rust
Stars
22
Forks
4
Avg merge
8h 12m
Merged PRs (30d)
4

Description

We should allow users to run coverage on expanded code, especially to see coverage for macros that might contain conditional statements and thus can be not fully covered. We can approach this in three ways, ranked from the easiest to the most complicated:

Proposed Solutions:
  1. Ask users to run scarb expand on their own and input it to Cairo coverage

    • Changes Required: Only in Scarb
    • Description: Users will manually run scarb expand and then input the expanded code into Cairo coverage tool.
  2. Add --expand flag to Forge

    • Changes Required: In Scarb and Forge
    • Description: Forge will run scarb expand behind the scenes and then pass the output to Cairo-coverage. This process will be automated for the user.
  3. Change mappings in the compiler to also point to expanded lines

    • Changes Required: Needs more investigation
    • Description: Needs more investigation

Additional Requirements:

  • Inline Macro Expansion: Currently, Scarb does not expand inline macros. We need to implement this capability (Reference: Language Server Implementation).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the three proposed approaches across Scarb, Forge, and Cairo coverage. Read the referenced cairo-lang-language-server/src/ide/macros/expand.rs implementation, then investigate how Scarb handles inline macro expansion. Done means selecting and implementing a concrete approach that lets coverage report expanded code, including conditional macro branches.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers, testing-qa
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.