feat: update tests and github CI

This commit is contained in:
Eduardo Chiarotti
2024-10-08 17:34:21 -03:00
parent 5210dda28d
commit 54d0f9833b
2 changed files with 17 additions and 21 deletions

View File

@@ -9,24 +9,24 @@ env:
OPENAI_API_KEY: fake-api-key OPENAI_API_KEY: fake-api-key
jobs: jobs:
deploy: tests:
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 15 timeout-minutes: 15
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Setup Python - name: Install uv
uses: actions/setup-python@v4 uses: astral-sh/setup-uv@v3
with: with:
python-version: "3.11.9" enable-cache: true
- name: Install Requirements
run: | - name: Set up Python
set -e run: uv python install 3.11.9
pip install poetry
poetry install - name: Install the project
run: uv sync --dev
- name: Run tests - name: Run tests
run: poetry run pytest run: uv run pytest tests

View File

@@ -228,13 +228,11 @@ class TestDeployCommand(unittest.TestCase):
"builtins.open", "builtins.open",
new_callable=unittest.mock.mock_open, new_callable=unittest.mock.mock_open,
read_data=""" read_data="""
[tool.poetry] [project]
name = "test_project" name = "test_project"
version = "0.1.0" version = "0.1.0"
requires-python = ">=3.10,<=3.13"
[tool.poetry.dependencies] dependencies = ["crewai"]
python = "^3.10"
crewai = { extras = ["tools"], version = ">=0.51.0,<1.0.0" }
""", """,
) )
def test_get_project_name_python_310(self, mock_open): def test_get_project_name_python_310(self, mock_open):
@@ -248,13 +246,11 @@ class TestDeployCommand(unittest.TestCase):
"builtins.open", "builtins.open",
new_callable=unittest.mock.mock_open, new_callable=unittest.mock.mock_open,
read_data=""" read_data="""
[tool.poetry] [project]
name = "test_project" name = "test_project"
version = "0.1.0" version = "0.1.0"
requires-python = ">=3.10,<=3.13"
[tool.poetry.dependencies] dependencies = ["crewai"]
python = "^3.11"
crewai = { extras = ["tools"], version = ">=0.51.0,<1.0.0" }
""", """,
) )
def test_get_project_name_python_311_plus(self, mock_open): def test_get_project_name_python_311_plus(self, mock_open):