Skip to content

Commit 6710b90

Browse files
Merge pull request #779 from microsoft/psl-macaekn
fix: reverted unittest case changes
2 parents eb5d8f1 + ec0f915 commit 6710b90

38 files changed

Lines changed: 32 additions & 19827 deletions

.github/workflows/test.yml

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ on:
44
push:
55
branches:
66
- main
7-
- demo-v4
8-
- dev-v4
7+
- dev
8+
- demo
9+
- hotfix
910
paths:
1011
- 'src/backend/**/*.py'
1112
- 'src/tests/**/*.py'
@@ -23,8 +24,9 @@ on:
2324
- synchronize
2425
branches:
2526
- main
26-
- demo-v4
27-
- dev-v4
27+
- dev
28+
- demo
29+
- hotfix
2830
paths:
2931
- 'src/backend/**/*.py'
3032
- 'src/tests/**/*.py'
@@ -64,23 +66,26 @@ jobs:
6466
echo "skip_tests=false" >> $GITHUB_ENV
6567
fi
6668
67-
- name: Run backend tests with coverage
69+
- name: Run tests with coverage
6870
if: env.skip_tests == 'false'
6971
run: |
70-
python -m pytest src/tests/backend/test_app.py --cov=backend.app --cov-report= --cov-config=.coveragerc -q > /dev/null 2>&1
71-
python -m pytest src/tests/backend --cov=backend --cov-append --cov-report=xml --cov-report= --cov-config=.coveragerc --ignore=src/tests/backend/test_app.py 2>&1 | tee /tmp/pytest_output.txt
72-
python -m coverage report --rcfile=.coveragerc
73-
tail -1 /tmp/pytest_output.txt
74-
75-
# Check coverage threshold
76-
if [ -f coverage.xml ]; then
77-
COVERAGE=$(python -c "import xml.etree.ElementTree as ET; tree = ET.parse('coverage.xml'); root = tree.getroot(); print(float(root.attrib['line-rate']) * 100)")
78-
echo "Coverage: $COVERAGE%"
79-
if (( $(echo "$COVERAGE < 80" | bc -l) )); then
80-
echo "Coverage is below 80%, failing the job."
81-
exit 1
82-
fi
83-
fi
72+
pytest --cov=. --cov-report=term-missing --cov-report=xml \
73+
--ignore=tests/e2e-test/tests \
74+
--ignore=src/backend/tests/test_app.py \
75+
--ignore=src/tests/agents/test_foundry_integration.py \
76+
--ignore=src/tests/mcp_server/test_factory.py \
77+
--ignore=src/tests/mcp_server/test_hr_service.py \
78+
--ignore=src/backend/tests/test_config.py \
79+
--ignore=src/tests/agents/test_human_approval_manager.py \
80+
--ignore=src/backend/tests/test_team_specific_methods.py \
81+
--ignore=src/backend/tests/models/test_messages.py \
82+
--ignore=src/backend/tests/test_otlp_tracing.py \
83+
--ignore=src/backend/tests/auth/test_auth_utils.py
84+
85+
# - name: Run tests with coverage
86+
# if: env.skip_tests == 'false'
87+
# run: |
88+
# pytest --cov=. --cov-report=term-missing --cov-report=xml --ignore=tests/e2e-test/tests
8489

8590
- name: Skip coverage report if no tests
8691
if: env.skip_tests == 'true'

pytest.ini

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,2 @@
11
[pytest]
22
addopts = -p pytest_asyncio
3-
pythonpath = src
4-
testpaths = src/tests
5-
python_files = test_*.py *_test.py
6-
python_functions = test_*
7-
python_classes = Test*

src/backend/app.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@
55

66

77
from azure.monitor.opentelemetry import configure_azure_monitor
8-
from backend.common.config.app_config import config
9-
from backend.common.models.messages_af import UserLanguage
8+
from common.config.app_config import config
9+
from common.models.messages_af import UserLanguage
1010

1111
# FastAPI imports
1212
from fastapi import FastAPI, Request
1313
from fastapi.middleware.cors import CORSMiddleware
1414

1515
# Local imports
16-
from backend.middleware.health_check import HealthCheckMiddleware
17-
from backend.v4.api.router import app_v4
16+
from middleware.health_check import HealthCheckMiddleware
17+
from v4.api.router import app_v4
1818

1919
# Azure monitoring
2020

2121

22-
from backend.v4.config.agent_registry import agent_registry
22+
from v4.config.agent_registry import agent_registry
2323

2424

2525
@asynccontextmanager

src/backend/v4/config/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# from agent_framework_azure_ai import AzureOpenAIChatClient
1818
from agent_framework import ChatOptions
1919

20-
from backend.v4.models.messages import MPlan, WebsocketMessageType
20+
from v4.models.messages import MPlan, WebsocketMessageType
2121

2222
logger = logging.getLogger(__name__)
2323

src/backend/v4/models/messages.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from pydantic import BaseModel
99

1010
from common.models.messages_af import AgentMessageType
11-
from backend.v4.models.models import MPlan, PlanStatus
11+
from v4.models.models import MPlan, PlanStatus
1212

1313

1414
# ---------------------------------------------------------------------------

src/backend/v4/orchestration/helper/plan_to_mplan_converter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import re
33
from typing import Iterable, List, Optional
44

5-
from backend.v4.models.models import MPlan, MStep
5+
from v4.models.models import MPlan, MStep
66

77
logger = logging.getLogger(__name__)
88

src/tests/backend/auth/conftest.py

Lines changed: 0 additions & 63 deletions
This file was deleted.

0 commit comments

Comments
 (0)