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

Add code coverage for contracts #200

Merged
merged 6 commits into from
Sep 7, 2022
Merged

Add code coverage for contracts #200

merged 6 commits into from
Sep 7, 2022

Conversation

larryob
Copy link
Contributor

@larryob larryob commented Sep 7, 2022

Closes ALP-2272

@larryob larryob requested a review from dstack as a code owner September 7, 2022 03:14
@linear
Copy link

linear bot commented Sep 7, 2022

ALP-2272 Add test coverage

See forge coverage --help

@github-actions
Copy link

github-actions bot commented Sep 7, 2022

LCOV of commit 431f340 during Smart Contracts PR Workflow #500

Summary coverage rate:
  lines......: 29.5% (750 of 2543 lines)
  functions..: 32.2% (158 of 491 functions)
  branches...: 29.2% (184 of 630 branches)

Files changed coverage rate: n/a

@larryob
Copy link
Contributor Author

larryob commented Sep 7, 2022

@nodimdim This coverage is lower than the true number because we include internal libraries (like solmate's SafeTransferLib), test files, testnet contracts under src/testnet, and external contracts that we inherit from.

@github-actions
Copy link

github-actions bot commented Sep 7, 2022

LCOV of commit 91d59b2 during Smart Contracts PR Workflow #503

Summary coverage rate:
  lines......: 29.8% (765 of 2570 lines)
  functions..: 32.2% (158 of 491 functions)
  branches...: 29.2% (184 of 630 branches)

Files changed coverage rate: n/a

@nodimdim
Copy link
Contributor

nodimdim commented Sep 7, 2022

LGTM, Can we somehow ignore the contracts that we don't use?

@larryob
Copy link
Contributor Author

larryob commented Sep 7, 2022

@nodimdim Adding node_modules to libs in foundry.toml helped! There's still no way to filter out the contracts under src/testnet or the utils under src/test though.

@github-actions
Copy link

github-actions bot commented Sep 7, 2022

LCOV of commit 352c851 during Smart Contracts PR Workflow #507

Summary coverage rate:
  lines......: 77.4% (687 of 888 lines)
  functions..: 62.9% (132 of 210 functions)
  branches...: 67.9% (167 of 246 branches)

Files changed coverage rate: n/a

@larryob larryob merged commit c0ef407 into master Sep 7, 2022
@larryob larryob deleted the code-cov branch September 7, 2022 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants