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 pytest pre commit hook #210

Merged
merged 12 commits into from
Jun 20, 2023
Merged

Add pytest pre commit hook #210

merged 12 commits into from
Jun 20, 2023

Conversation

patillacode
Copy link
Collaborator

@patillacode patillacode commented Jun 19, 2023

Closes #205

  • Added a pre commit hook to run pytest on commit
  • Added requirement termcolor (used in 'print_chat.py')

@patillacode
Copy link
Collaborator Author

I am not sure if I understood exactly what we need in the issue #205 , but we are now running the tests both in the pre-commit GH action and in the pytest GH action.

I would remove running tests on each commit and just leave it in the GH actions

I'll wait for feedback

@patillacode patillacode marked this pull request as draft June 19, 2023 19:07
testing pre action

testing pre action

testing pre action

testing pre action

testing pre action

testing pre action

testing pre action

testing pre action
@patillacode
Copy link
Collaborator Author

I am no expert on GH actions.

I have invested more time than I would like to recognize trying to fix the pre-commit action in the CI.

As I mentioned before I wouldn't add the tests in as a hook, now I completely subscribe that because if we avoid running the tests as s pre-commit hook my problem with the CI goes away 😅

I'm going to remove tests being run as a hook in favor of the dedicated action already running the tests.

Let me know if this work for you.

@patillacode patillacode marked this pull request as ready for review June 19, 2023 19:53
@carlthome
Copy link
Contributor

Generally speaking it's considered bad practice to run unit tests in pre-commit.

@patillacode
Copy link
Collaborator Author

I agree @carlthome

Leaving that to the CI. Merging, thanks!

@patillacode patillacode merged commit dc834e6 into main Jun 20, 2023
@patillacode patillacode deleted the test-hook branch June 20, 2023 09:57
70ziko pushed a commit to 70ziko/gpt-engineer that referenced this pull request Oct 25, 2023
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.

Run pytest in pre-commit
2 participants