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

ci: separate jobs for unit and integration tests #102

Merged
merged 21 commits into from
Sep 26, 2024
Merged
30 changes: 29 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "${{ env.PYTHON_VERSION }}"

- name: Install Hatch
run: pip install hatch==${{ env.HATCH_VERSION }}

Expand Down Expand Up @@ -75,7 +79,7 @@ jobs:
run: pip install hatch==${{ env.HATCH_VERSION }}

- name: Run
run: hatch run test:cov
run: hatch run test:unit

- name: Coveralls
# We upload only coverage for ubuntu as handling both os
Expand All @@ -91,3 +95,27 @@ jobs:
run: |
hatch run pip install git+https://github.com/deepset-ai/haystack.git
hatch run test:unit

integration-tests:
name: Integration / ${{ matrix.os }}
needs: linting
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "${{ env.PYTHON_VERSION }}"

- name: Install Hatch
run: pip install hatch==${{ env.HATCH_VERSION }}

- name: Run
run: hatch run test:integration
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def __init__(
request_sender: Optional[Callable[[Dict[str, Any]], Dict[str, Any]]] = None,
llm_provider: LLMProvider = LLMProvider.OPENAI,
operations_filter: Optional[Callable[[Dict[str, Any]], bool]] = None,
): # noqa: PLR0913 # pylint: disable=too-many-positional-arguments
): # noqa: PLR0913
shadeMe marked this conversation as resolved.
Show resolved Hide resolved
"""
Initialize a ClientConfiguration instance.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def __init__(
spec: Optional[Union[str, Path]] = None,
credentials: Optional[Secret] = None,
allowed_operations: Optional[List[str]] = None,
): # pylint: disable=too-many-positional-arguments
):
"""
Initialize the OpenAPITool component.

Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ dependencies = [
[tool.hatch.envs.test]
extra-dependencies = [
# RAG evaluation harness (SAS evaluator)
"sentence-transformers>=2.2.0",
"sentence-transformers>=3.0.0",
# OpenAPI dependencies
"jsonref",
# OpenAPI tests
Expand All @@ -63,7 +63,7 @@ extra-dependencies = [

[tool.hatch.envs.test.scripts]
unit = 'pytest --cov-report xml:coverage.xml --cov="haystack_experimental" -m "not integration" {args:test}'
integration = 'pytest --reruns 3 --reruns-delay 60 -x --maxfail=5 -m "integration" {args:test}'
integration = 'pytest --reruns 3 --reruns-delay 60 -x --maxfail=5 -m "integration and not unstable" {args:test}'
typing = "mypy --install-types --non-interactive {args:haystack_experimental}"
lint = [
"ruff check {args:haystack_experimental}",
Expand Down
Loading