Skip to content

Commit 2b81961

Browse files
committed
ci: add integration tests workflow for Azure and GCP
- Add integration_tests.yaml that runs on push to main only - Exclude integration tests from test_custom_code.yaml PR workflow - Integration tests require secrets and make real API calls This ensures integration tests run only after merge, not on every PR.
1 parent 21a7e44 commit 2b81961

2 files changed

Lines changed: 47 additions & 2 deletions

File tree

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Integration Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
integration:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
15+
16+
- name: Set up Python
17+
uses: actions/setup-python@7f4fc3e22c37d6ff65e88745f38bd3157c663f7c # v4
18+
with:
19+
python-version: '3.12'
20+
21+
- name: Install uv
22+
uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6
23+
24+
- name: Install dependencies
25+
run: |
26+
uv sync --all-extras
27+
28+
- name: Run Azure integration tests
29+
env:
30+
AZURE_API_KEY: ${{ secrets.AZURE_API_KEY }}
31+
AZURE_SERVER_URL: ${{ secrets.AZURE_SERVER_URL }}
32+
AZURE_MODEL: ${{ secrets.AZURE_MODEL }}
33+
AZURE_OCR_MODEL: ${{ secrets.AZURE_OCR_MODEL }}
34+
AZURE_API_VERSION: ${{ secrets.AZURE_API_VERSION || '2024-05-01-preview' }}
35+
run: |
36+
uv run pytest tests/test_azure_integration.py -v --tb=short
37+
38+
- name: Run GCP integration tests
39+
env:
40+
GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
41+
GCP_REGION: ${{ secrets.GCP_REGION || 'us-central1' }}
42+
GCP_MODEL: ${{ secrets.GCP_MODEL || 'mistral-small-2503' }}
43+
GCP_FIM_MODEL: ${{ secrets.GCP_FIM_MODEL || 'codestral-2' }}
44+
run: |
45+
uv run pytest tests/test_gcp_integration.py -v --tb=short

.github/workflows/test_custom_code.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ jobs:
3232
- name: Run the 'src/mistralai/extra' package unit tests
3333
run: uv run python3.12 -m unittest discover -s src/mistralai/extra/tests -t src
3434

35-
- name: Run pytest for repository tests
36-
run: uv run pytest tests/
35+
- name: Run pytest for repository tests (excluding integration)
36+
run: uv run pytest tests/ -v --ignore=tests/test_azure_integration.py --ignore=tests/test_gcp_integration.py

0 commit comments

Comments
 (0)