Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 28 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
run: tools/ut.sh -j

python_tests:
name: python tests (non-ollama) on ${{ matrix.os }} ${{ matrix.python-version}}
name: python tests (non-integration) on ${{ matrix.os }} ${{ matrix.python-version}}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand All @@ -88,10 +88,10 @@ jobs:
uses: astral-sh/setup-uv@v4
with:
version: "latest"
- name: Run Python Tests (excluding Ollama)
- name: Run Python Tests (excluding Integration)
run: tools/ut.sh -p
env:
PYTEST_SKIP_MARKERS: "ollama"
PYTEST_SKIP_MARKERS: "integration"

ollama_integration_tests:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this can be removed.

name: ollama integration tests (linux python 3.10)
Expand Down Expand Up @@ -125,6 +125,31 @@ jobs:
path: /tmp/ollama*.log
retention-days: 7

integration_tests:
name: integration tests (linux python 3.10)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install java
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'adopt'
- name: Install python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: "latest"
- name: Run Integration Tests
run: tools/ut.sh -p
env:
PYTEST_ONLY_MARKERS: "integration"
PYTEST_VERBOSE: "true"
CI: true

e2e_tests:
name: e2e tests on ${{ matrix.os }} ${{ matrix.python-version}}
runs-on: ${{ matrix.os }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@

import pytest

# Mark all tests in this module as integration tests
pytestmark = pytest.mark.integration

from flink_agents.api.chat_message import ChatMessage, MessageRole
from flink_agents.api.resource import Resource, ResourceType
from flink_agents.integrations.chat_models.anthropic.anthropic_chat_model import (
Expand All @@ -27,7 +30,7 @@
)
from flink_agents.plan.tools.function_tool import from_callable

test_model = os.environ.get("TEST_MODEL")
test_model = os.environ.get("TEST_MODEL", "claude-3-haiku-20240307")
api_key = os.environ.get("TEST_API_KEY")


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@

import pytest

# Mark all tests in this module as integration tests
pytestmark = pytest.mark.integration

from flink_agents.api.chat_message import ChatMessage, MessageRole
from flink_agents.api.resource import Resource, ResourceType
from flink_agents.integrations.chat_models.openai.openai_chat_model import (
Expand All @@ -27,7 +30,7 @@
)
from flink_agents.plan.tools.function_tool import from_callable

test_model = os.environ.get("TEST_MODEL")
test_model = os.environ.get("TEST_MODEL", "gpt-3.5-turbo")
api_key = os.environ.get("TEST_API_KEY")
api_base_url = os.environ.get("TEST_API_BASE_URL")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,17 @@

import pytest

# Mark all tests in this module as integration tests
pytestmark = pytest.mark.integration

from flink_agents.api.resource import Resource, ResourceType
from flink_agents.integrations.embedding_models.openai_embedding_model import (
OpenAIEmbeddingModelConnection,
OpenAIEmbeddingModelSetup,
)

test_model = os.environ.get("TEST_EMBEDDING_MODEL", "text-embedding-3-small")
api_key = os.environ.get("TEST_API_KEY")
api_key = os.environ.get("TEST_API_KEY", "fake-key")


@pytest.mark.skipif(api_key is None, reason="TEST_API_KEY is not set")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@

import pytest

# Mark all tests in this module as integration tests
pytestmark = pytest.mark.integration

try:
import chromadb # noqa: F401

Expand All @@ -35,9 +38,9 @@
ChromaVectorStore,
)

api_key = os.environ.get("TEST_API_KEY")
tenant = os.environ.get("TEST_TENANT")
database = os.environ.get("TEST_DATABASE")
api_key = os.environ.get("TEST_API_KEY", "fake-key")
tenant = os.environ.get("TEST_TENANT", "fake-tenant")
database = os.environ.get("TEST_DATABASE", "fake-database")


class MockEmbeddingModel(Resource): # noqa: D101
Expand Down
1 change: 1 addition & 0 deletions python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ strict = true
[tool.pytest.ini_options]
markers = [
"ollama: marks tests that require Ollama server (deselect with '-m \"not ollama\"')",
"integration: marks tests that require external services or integration (deselect with '-m \"not integration\"')",
]

[tool.ruff.format]
Expand Down