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 GitHub Actions workflow for running pytest #2382

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

sweep-nightly[bot]
Copy link
Contributor

@sweep-nightly sweep-nightly bot commented Oct 22, 2023

Description

This PR adds a GitHub Actions workflow file to the repository that enables running pytest automatically on push and pull request events. The workflow installs the necessary dependencies, including poetry for dependency management, and runs pytest to execute the tests.

Summary of Changes

  • Created a new file .github/workflows/python-tests.yml to define the GitHub Actions workflow.
  • Added a workflow trigger for push and pull request events.
  • Defined a job named "test" that runs on ubuntu-latest.
  • Added steps to checkout the repository code, set up Python 3.10, install poetry, install project dependencies using poetry, and run pytest.

Please review and merge this PR to enable automated testing with pytest in GitHub Actions.

Fixes #2258.


🎉 Latest improvements to Sweep:

  • Sweep can now passively improve your repository! Check out Rules to learn more.

💡 To get Sweep to edit this pull request, you can:

  • Comment below, and Sweep can edit the entire PR
  • Comment on a file, Sweep will only modify the commented file
  • Edit the original issue to get Sweep to recreate the PR from scratch

@sweep-nightly
Copy link
Contributor Author

sweep-nightly bot commented Oct 22, 2023

Rollback Files For Sweep

  • Rollback changes to .github/workflows/python-tests.yml

@sweep-nightly
Copy link
Contributor Author

sweep-nightly bot commented Oct 22, 2023

Apply Sweep Rules to your PR?

  • Apply: There should not be large chunks of code that are just commented out. Docstrings and explanations in code are acceptable.
  • Apply: We should use loguru for error logging. If the log is inside an exception, use loguru.exception to add tracebacks. Use f-strings for string formatting in logger calls.
  • Apply: There should be no instances of import pdb; pdb.set_trace() in production code.
  • Apply: There should be no debug log or print statements in production code.
  • Apply: All functions should have parameters and output annotated with type hints. Use list, tuple and dict instead of typing.List, typing.Tuple and typing.dict.
  • Apply: Leftover TODOs in the code should be handled.
  • Apply: All new business logic should have corresponding unit tests in the same directory. For example, sweepai/api_test.py tests sweepai/api.py. Use unittest and unittest.mock as required.
  • Apply: Any clearly inefficient or repeated code should be optimized or refactored.
  • Apply: Remove any comments before code that are obvious. For example # this prints hello world; print('hello world').

@sweep-nightly sweep-nightly bot added the sweep Assigns Sweep to an issue or pull request. label Oct 22, 2023
@vercel
Copy link

vercel bot commented Oct 22, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sweep-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 24, 2023 10:27pm

@wwzeng1
Copy link
Contributor

wwzeng1 commented Oct 22, 2023

with:
python-version: 3.1
token: ***
Version 3.1 was not found in the local cache
Error: Version 3.1 with arch x64 not found

@sweep-nightly
Copy link
Contributor Author

sweep-nightly bot commented Oct 22, 2023

🚀 Wrote Changes

Done.

@wwzeng1
Copy link
Contributor

wwzeng1 commented Oct 22, 2023

pytest not found

@sweep-nightly
Copy link
Contributor Author

sweep-nightly bot commented Oct 22, 2023

🚀 Wrote Changes

Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sweep Assigns Sweep to an issue or pull request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sweep: run pytest in github actions
1 participant