Skip to content

Commit 8ff66e7

Browse files
committed
fix(tests): use current version for tests and add output check
1 parent 7dba4db commit 8ff66e7

29 files changed

Lines changed: 549 additions & 2766 deletions

File tree

.github/workflows/integration_tests.yml

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,9 @@ jobs:
1717
matrix:
1818
include:
1919
- build-dir: company-research-agent
20-
context: ./testcases/company-research-agent
21-
agent-input: '{"company_name":"uipath"}'
2220
- build-dir: simple-local-mcp
23-
context: ./testcases/simple-local-mcp
24-
agent-input: '{"messages": [{"type": "human", "content": "What is 2+2"}]}'
2521
- build-dir: ticket-classification
26-
context: ./testcases/ticket-classification
27-
agent-input: '{"message": "GET Assets API does not enforce proper permissions Assets.View", "ticket_id": "TICKET-2345"}'
28-
has-human-loop: "true"
2922
- build-dir: multi-agent-supervisor-researcher-coder
30-
context: ./testcases/multi-agent-supervisor-researcher-coder
31-
agent-input: '{"question": "First, please state the Pythagorean theorem. Give only the formula, using variables a, b, and c. Then apply this formula to calculate the value when a=2 and b=3."}'
3223

3324
steps:
3425
- name: Checkout code
@@ -39,11 +30,9 @@ jobs:
3930

4031
- name: Build Docker image (${{ matrix.build-dir }})
4132
run: |
42-
docker build -f Dockerfile \
33+
docker build -f testcases/${{ matrix.build-dir }}/Dockerfile \
4334
-t ${{ matrix.build-dir }}:test \
4435
--build-arg CLIENT_ID="${{ secrets.ALPHA_TEST_CLIENT_ID }}" \
4536
--build-arg CLIENT_SECRET="${{ secrets.ALPHA_TEST_CLIENT_SECRET }}" \
4637
--build-arg BASE_URL="${{ secrets.ALPHA_BASE_URL }}" \
47-
--build-arg AGENT_INPUT='${{ matrix.agent-input }}' \
48-
${{ matrix.has-human-loop == 'true' && '--build-arg SKIP_HUMAN_APPROVAL=false --build-arg USE_REGULAR_INTERRUPT=true' || '' }} \
49-
${{ matrix.context }}
38+
.

Dockerfile

Lines changed: 0 additions & 48 deletions
This file was deleted.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
FROM ghcr.io/astral-sh/uv:python3.12-bookworm
2+
3+
WORKDIR /app
4+
5+
COPY . .
6+
7+
WORKDIR /app/testcases/company-research-agent
8+
9+
RUN uv sync
10+
11+
ARG CLIENT_ID
12+
ARG CLIENT_SECRET
13+
ARG BASE_URL
14+
15+
RUN if [ -z "$CLIENT_ID" ]; then echo "CLIENT_ID build arg is required" && exit 1; fi
16+
RUN if [ -z "$CLIENT_SECRET" ]; then echo "CLIENT_SECRET build arg is required" && exit 1; fi
17+
RUN if [ -z "$BASE_URL" ]; then echo "BASE_URL build arg is required" && exit 1; fi
18+
19+
# Set environment variables for runtime
20+
ENV CLIENT_ID=$CLIENT_ID
21+
ENV CLIENT_SECRET=$CLIENT_SECRET
22+
ENV BASE_URL=$BASE_URL
23+
ENV TAVILY_API_KEY=${TAVILY_API_KEY:-""}
24+
ENV UIPATH_TENANT_ID=${UIPATH_TENANT_ID:-""}
25+
ENV UIPATH_JOB_KEY=3a03d5cb-fa21-4021-894d-a8e2eda0afe0
26+
27+
# Authenticate with UiPath during build
28+
RUN uv run uipath auth --client-id="$CLIENT_ID" --client-secret="$CLIENT_SECRET" --base-url="$BASE_URL"
29+
30+
RUN uv run uipath pack
31+
32+
RUN AGENT_INPUT=$(cat input.json) && uv run uipath run agent "$AGENT_INPUT"
33+
34+
# Run the Python assert script to validate output
35+
RUN python src/assert.py
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"company_name":"uipath"}
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
{
2-
"dependencies": ["."],
2+
"dependencies": [
3+
"."
4+
],
35
"graphs": {
4-
"agent": "./graph.py:graph"
6+
"agent": "./src/graph.py:graph"
57
},
68
"env": ".env"
7-
}
9+
}

testcases/company-research-agent/pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ dependencies = [
1010
"langchain-anthropic>=0.3.8",
1111
"tavily-python>=0.5.0",
1212
"uipath>=2.0.79",
13-
"uipath-langchain>=0.0.117",
13+
"uipath-langchain",
1414
"duckduckgo-search>=8.1.1",
1515
"langchain-community>=0.3.21",
1616
"debugpy>=1.8.15",
@@ -19,6 +19,9 @@ dependencies = [
1919
[project.optional-dependencies]
2020
dev = ["mypy>=1.11.1", "ruff>=0.6.1"]
2121

22+
[tool.uv.sources]
23+
uipath-langchain = { path = "../../", editable = true }
24+
2225
[build-system]
2326
requires = ["setuptools>=73.0.0", "wheel"]
2427
build-backend = "setuptools.build_meta"
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
import os
2+
import sys
3+
import json
4+
5+
print("Checking company research agent output...")
6+
7+
# Check NuGet package
8+
uipath_dir = ".uipath"
9+
if not os.path.exists(uipath_dir):
10+
print("NuGet package directory (.uipath) not found")
11+
sys.exit(1)
12+
13+
nupkg_files = [f for f in os.listdir(uipath_dir) if f.endswith('.nupkg')]
14+
if not nupkg_files:
15+
print("NuGet package file (.nupkg) not found in .uipath directory")
16+
sys.exit(1)
17+
18+
print(f"NuGet package found: {nupkg_files[0]}")
19+
20+
# Check agent output file
21+
output_file = "__uipath/output.json"
22+
if not os.path.isfile(output_file):
23+
print("Agent output file not found")
24+
sys.exit(1)
25+
26+
print("Agent output file found")
27+
28+
# Check status and required fields
29+
try:
30+
with open(output_file, 'r', encoding='utf-8') as f:
31+
output_data = json.load(f)
32+
33+
# Check status
34+
status = output_data.get("status")
35+
if status != "successful":
36+
print(f"Agent execution failed with status: {status}")
37+
sys.exit(1)
38+
39+
print("Agent execution status: successful")
40+
41+
# Check required fields for company research agent
42+
if "output" not in output_data:
43+
print("Missing 'output' field in agent response")
44+
sys.exit(1)
45+
46+
output_content = output_data["output"]
47+
if "response" not in output_content:
48+
print("Missing 'response' field in output")
49+
sys.exit(1)
50+
51+
response = output_content["response"]
52+
if not response or response.strip() == "":
53+
print("Response field is empty")
54+
sys.exit(1)
55+
56+
print("Required fields validation passed")
57+
print("Company research agent working correctly.")
58+
59+
except Exception as e:
60+
print(f"Error checking output: {e}")
61+
sys.exit(1)
File renamed without changes.

testcases/company-research-agent/uv.lock

Lines changed: 32 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

testcases/multi-agent-supervisor-researcher-coder/.env.example

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@ UIPATH_URL=https://alpha.uipath.com/<organization>/<tenant>
22
UIPATH_ACCESS_TOKEN=YOUR TOKEN HERE
33
UIPATH_TENANT_ID=YOUR_TENANT_ID
44
UIPATH_ORGANIZATION_ID=YOUR_ORGANIZATION_ID
5-
TAVILY_API_KEY=your_tavily_api_key
6-
UIPATH_JOB_KEY=YOUR_JOB_KEY
5+
TAVILY_API_KEY=your_tavily_api_key

0 commit comments

Comments
 (0)