mirror of
https://github.com/invariantlabs-ai/invariant-gateway.git
synced 2026-05-22 14:59:41 +02:00
Update tests_ci.yml so that the CI run fails even when unit tests fail.
This commit is contained in:
@@ -14,29 +14,47 @@ jobs:
|
||||
name: Build & Test
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set Up Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: "3.10"
|
||||
- name: Set Up Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: "3.10"
|
||||
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install pytest
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install pytest
|
||||
|
||||
- name: Run unit tests
|
||||
run: |
|
||||
pip install -r tests/unit_tests/requirements.txt
|
||||
./run.sh unit-tests -s -vv
|
||||
continue-on-error: true
|
||||
- name: Run unit tests
|
||||
id: unit-tests
|
||||
run: |
|
||||
pip install -r tests/unit_tests/requirements.txt
|
||||
./run.sh unit-tests -s -vv
|
||||
continue-on-error: true
|
||||
|
||||
- name: Run integration tests
|
||||
env:
|
||||
OPENAI_API_KEY: ${{ secrets.INVARIANT_TESTING_OPENAI_KEY }}
|
||||
ANTHROPIC_API_KEY: ${{ secrets.INVARIANT_TESTING_ANTHROPIC_KEY}}
|
||||
GEMINI_API_KEY: ${{ secrets.INVARIANT_TESTING_GEMINI_KEY }}
|
||||
INVARIANT_API_KEY: ${{ secrets.INVARIANT_TESTING_GUARDRAILS_KEY }}
|
||||
run: ./run.sh integration-tests -s -vv
|
||||
- name: Run integration tests
|
||||
id: integration-tests
|
||||
env:
|
||||
OPENAI_API_KEY: ${{ secrets.INVARIANT_TESTING_OPENAI_KEY }}
|
||||
ANTHROPIC_API_KEY: ${{ secrets.INVARIANT_TESTING_ANTHROPIC_KEY }}
|
||||
GEMINI_API_KEY: ${{ secrets.INVARIANT_TESTING_GEMINI_KEY }}
|
||||
INVARIANT_API_KEY: ${{ secrets.INVARIANT_TESTING_GUARDRAILS_KEY }}
|
||||
run: ./run.sh integration-tests -s -vv
|
||||
continue-on-error: true
|
||||
|
||||
- name: Check test results
|
||||
run: |
|
||||
echo "Unit tests outcome: ${{ steps.unit-tests.outcome }}"
|
||||
echo "Integration tests outcome: ${{ steps.integration-tests.outcome }}"
|
||||
|
||||
if [[ "${{ steps.unit-tests.outcome }}" != "success" ]]; then
|
||||
echo "Unit tests failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ "${{ steps.integration-tests.outcome }}" != "success" ]]; then
|
||||
echo "Integration tests failed"
|
||||
exit 1
|
||||
fi
|
||||
@@ -243,7 +243,7 @@ async def test_streaming_response_with_tool_call(
|
||||
"""Test the chat completion with streaming for the weather agent."""
|
||||
weather_agent = WeatherAgent(gateway_url, push_to_explorer)
|
||||
|
||||
query = "Tell me the weather for New York"
|
||||
query = "Tell me the weather for New York in Celsius"
|
||||
city = "new york"
|
||||
|
||||
messages = [{"role": "user", "content": query}]
|
||||
@@ -307,7 +307,7 @@ async def test_response_with_tool_call_with_image(
|
||||
|
||||
with image_path.open("rb") as image_file:
|
||||
base64_image = base64.b64encode(image_file.read()).decode("utf-8")
|
||||
query = "get the weather in the city of this image"
|
||||
query = "get the weather in the city of this image in Celsius"
|
||||
city = "new york"
|
||||
messages = [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user