Skip to content

test: add unit tests and coverage configuration #28

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

Merged
merged 1 commit into from
Dec 14, 2024

Conversation

ebawen
Copy link
Contributor

@ebawen ebawen commented Dec 14, 2024

Description

Added unit tests and coverage configuration to improve code quality and maintainability.

Changes made

  • Added unit tests for parse_url and clone_repo functions
  • Configured pytest with coverage reporting
  • Added coverage configuration file (.coveragerc)
  • Updated README with testing instructions
  • Added necessary test dependencies

Test Coverage

The tests cover:

  • URL parsing validation
  • Repository cloning with and without commit hash
  • Basic error handling

How to test

# Install dependencies
pip install -r requirements.txt

# Run tests with coverage
cd src
pytest --cov

# Generate HTML coverage report
pytest --cov --cov-report=html

Dependencies added

  • pytest
  • pytest-asyncio
  • pytest-cov

Documentation

Updated README.md with a new section explaining how to run tests and generate coverage reports.

Copy link
Member

@cyclotruc cyclotruc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested the tests

@cyclotruc cyclotruc merged commit 823f01b into coderamp-labs:main Dec 14, 2024
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.

3 participants