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 support for automated testing with Github Actions #69

Merged
merged 7 commits into from
Nov 25, 2024
Merged

Conversation

bhavnicksm
Copy link
Collaborator

This pull request includes multiple changes to improve automated testing, enhance documentation, and refine code functionality. The most important changes include adding a GitHub Actions workflow for automated testing, updating the README.md with development instructions, modifying the BaseChunker class, and adding conditional skips for tests that require an OpenAI API key.

Automated Testing:

  • .github/workflows/tests.yml: Added a GitHub Actions workflow to automate testing on push events. This includes steps to check out the repository, set up Python, install dependencies, and run tests.

Documentation:

  • README.md: Added a new "Development" section with instructions on how to clone the repository, set up a virtual environment, install dependencies, and run tests.

Code Enhancements:

  • src/chonkie/chunker/base.py: Modified the BaseChunker class to rename the tokenizer parameter to tokenizer_or_token_counter for clarity and updated the initialization logic accordingly.

Testing Improvements:

  • tests/chunker/test_semantic_chunker.py, tests/embeddings/test_openai_embeddings.py: Added pytest.mark.skipif decorators to conditionally skip tests that require the OPENAI_API_KEY environment variable if it is not defined. [1] [2] [3] [4] [5]

Configuration:

  • pyproject.toml: Added pythonpath configuration for pytest and updated ruff settings to include DOC in the select list.

pratyushmittal and others added 7 commits November 25, 2024 10:43
I have added a small documentation on how to setup local env for
testing.

**Changes in pyproject.toml**
`pytest` was not picking up local changes. It was giving
`ModuleNotFoundError` error for `chonkie`. Adding `pythonpath` fixed
that.

**Automated Testing**
I have also added a github action to run the tests automatically on each
`git push`. I have used `uv` because of superfast dependency
installation.

I followed this guide for the GitHub Actions setup:
https://docs.astral.sh/uv/guides/integration/github/
Added automated testing using Github Actions
@bhavnicksm bhavnicksm merged commit 890fb1b into main Nov 25, 2024
1 check failed
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