espin086 / GPT-Jobhunter

AI-powered job analysis and resume coaching tool using GPT. Analyzes job postings and provides personalized recommendations to job seekers for improving their resumes.
MIT License
55 stars 15 forks source link

Add Code Coverage Metrics to Makefile using pytest-cov module #110

Closed espin086 closed 8 months ago

espin086 commented 8 months ago

We need to implement code coverage metrics in our project to ensure the quality and effectiveness of our tests. To achieve this, we should integrate the pytest-cov module into our Makefile. This will allow us to generate code coverage reports both in the terminal and as an HTML file that can be saved to GitHub.

Steps to implement:

  1. Install pytest-cov module:

    • Add pytest-cov to the project's requirements.txt file or install it using pip:
      pip install pytest-cov
  2. a - make sure to update the requirements.txt with the version of pytest-cov that is working

  3. Update the Makefile:

    • Open the Makefile in the project's root directory.
    • Add a new target, e.g., coverage, to run the tests with code coverage:
      coverage:
       pytest --cov=<project_directory> --cov-report term --cov-report html

      Replace <project_directory> with the actual directory containing the project's code.

  4. Run the code coverage:

    • In the terminal, navigate to the project's root directory.
    • Execute the following command to run the tests with code coverage:
      
      make coverage

    NOTE: before submitting pull request make sure you run make check and that all test are passing, thank you!

espin086 commented 8 months ago

@0xchrisw not sure if this simple task is something you have the bandwidth to take on, let me know!

christopherwoodall commented 8 months ago

Sounds good! I have implemented the changes from above here.

EDIT: PR here.

espin086 commented 8 months ago

Thank you!