Skip to content

JonasueDaze/test-cov-python

Repository files navigation

Code Coverage in Python

A repository for testing Test Coverage / Code Coverage frameworks, tools and libraries in Python which uses Flask / SQLAlchemy stack and Selenium as testing tool.

Tested tools

Setup instructions

The following tools are required:

To setup and execute the project's tests, execute these steps:

  1. Spin up the project's services

    docker compose up -d
  2. Create a local copy of .env.local

    cp .env.local .env
  3. After PostgreSQL is healthy, execute database migration

    dbmate migrate
  4. Install project's dependencies

    pip install -r requirements.txt
  5. Execute the tests

    pytest --cov=. test

SonarQube

For running SonarQube analysis in this project you need to additionally install Just for running predefined tasks. After that you can do the following steps:

  1. Follow the SonarQube tutorial to execute a local instance (preferably with Docker)

  2. Accessing localhost:9000, add a new project (manual) with projectKey = test-cov-python

  3. Update the SONAR_TOKEN variable inside .env with the value shown in the previous step's project setup

  4. Download and add Sonar Scanner binary to $PATH (<INSTALL_DIRECTORY> is the same as the one in the tutorial)

    export PATH=$PATH:<INSTALL_DIRECTORY>/bin
  5. Execute the scan

    just scan

About

A repository for testing Test Coverage / Code Coverage frameworks, tools and libraries in Python

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors