Skip to main content

Nile plugin adding coverage reports for Cairo Smart Contracts.

Project description

nile-coverage

PyPI PyPI - Downloads

Nile plugin adding coverage reports for Cairo Smart Contracts.

Getting started

:warning: WARNING

This package requires cairo-lang >= 0.10.1. If you are using older versions, check this section before continuing.

Install the plugin inside the virtual environment of your Nile project:

(env): pip install nile-coverage

Nile automatically detects installed plugins using python entry points feature. You should see the coverage command listed running nile, and you can run the report with:

(env): nile coverage

For a full list of options run:

(env): nile coverage --help

Recipes

1. Run coverage in a subset of the tests suite.

Mark tests with pytest marks and use the --mark argument to run a subset of tests:

(env): nile coverage -m unit

2. Integrate with codecov.io.

Generate a cobertura format coverage xml file named "coverage.xml" using the --xml flag:

(env): nile coverage --xml

Troubleshooting

1. Getting zero coverage after tests have been run successfully.

This project requires Starknet >= 0.10.1. If you are using Starknet 0.10.0, check this guide.

2. Report doesn't catch execution when multiple threads are used with pytest-xdist.

To solve this, pass the --single-thread option to the coverage command:

(env): nile coverage -s

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nile-coverage-0.1.0b17.tar.gz (12.3 kB view hashes)

Uploaded Source

Built Distribution

nile_coverage-0.1.0b17-py3-none-any.whl (9.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page