Skip to content

Commit 129335e

Browse files
committed
test1
1 parent 0d000b5 commit 129335e

File tree

5 files changed

+29
-6
lines changed

5 files changed

+29
-6
lines changed

.github/workflows/integration_tests.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ jobs:
6363
CLIENT_ID: ${{ matrix.environment == 'alpha' && secrets.ALPHA_TEST_CLIENT_ID || secrets.CLOUD_TEST_CLIENT_ID }}
6464
CLIENT_SECRET: ${{ matrix.environment == 'alpha' && secrets.ALPHA_TEST_CLIENT_SECRET || secrets.CLOUD_TEST_CLIENT_SECRET }}
6565
BASE_URL: ${{ matrix.environment == 'alpha' && secrets.ALPHA_BASE_URL || secrets.CLOUD_BASE_URL }}
66+
GITHUB_PR_NUMBER: ${{ github.event.number }}
67+
GITHUB_RUN_ID: ${{ github.run_id }}
6668
working-directory: testcases/${{ matrix.testcase }}
6769
run: |
6870
echo "Running testcase: ${{ matrix.testcase }}"

testcases/ground-to-cloud/mcp.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"servers": {
3-
"mathmcp": {
3+
"mathmcp-{PR}-{RUN_ID}": {
44
"transport": "stdio",
55
"command": "python",
66
"args": ["server.py"]

testcases/ground-to-cloud/run.sh

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,39 @@ sed -i '/^UIPATH_TENANT_ID=[[:space:]]*$/d' .env
2929
# echo "Warning: PAT_TOKEN environment variable is not set!"
3030
# fi
3131

32+
# Generate dynamic values
33+
PR_NUMBER=${GITHUB_PR_NUMBER:-"local"}
34+
RUN_ID=${GITHUB_RUN_ID:-$(date +%s)}
35+
UNIQUE_ID=$(python -c "import uuid; print(str(uuid.uuid4()))" 2>/dev/null || python3 -c "import uuid; print(str(uuid.uuid4()))")
36+
MCP_SERVER_NAME="mathmcp-${PR_NUMBER}-${RUN_ID}"
37+
38+
echo "Updating uipath.json with dynamic values..."
39+
echo "PR Number: $PR_NUMBER"
40+
echo "Run ID: $RUN_ID"
41+
echo "MCP Server Name: $MCP_SERVER_NAME"
42+
echo "Unique ID: $UNIQUE_ID"
43+
44+
# Replace placeholders in uipath.json using sed
45+
sed -i "s/{PR}/$PR_NUMBER/g" uipath.json
46+
sed -i "s/{RUN_ID}/$RUN_ID/g" uipath.json
47+
sed -i "s/{UNIQUE_ID}/$UNIQUE_ID/g" uipath.json
48+
49+
sed -i "s/{PR}/$PR_NUMBER/g" mcp.json
50+
sed -i "s/{RUN_ID}/$RUN_ID/g" mcp.json
51+
3252
echo "Packing agent..."
3353
uv run uipath pack
3454

3555
echo "Starting MCP server in background..."
36-
uv run uipath run mathmcp > mcp_server_output.log 2>&1 &
56+
uv run uipath run "$MCP_SERVER_NAME" > mcp_server_output.log 2>&1 &
3757
MCP_PID=$!
3858

3959
echo "MCP server started with PID: $MCP_PID"
4060
echo "Waiting a moment for server to initialize..."
4161
sleep 5
4262

4363
echo "Running integration test..."
44-
uv run test.py
64+
MCP_SERVER_NAME="$MCP_SERVER_NAME" uv run test.py
4565

4666
# Capture test exit code
4767
TEST_EXIT_CODE=$?

testcases/ground-to-cloud/test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@ async def call_add_tool():
2323
base_url = get_required_env_var("BASE_URL")
2424
folder_key = get_required_env_var("UIPATH_FOLDER_KEY")
2525
token = get_required_env_var("UIPATH_ACCESS_TOKEN")
26+
mcp_server_name = get_required_env_var("MCP_SERVER_NAME")
2627

2728
# Construct the MCP server URL
28-
mcp_url = f"{base_url}/agenthub_/mcp/{folder_key}/mathmcp"
29+
mcp_url = f"{base_url}/agenthub_/mcp/{folder_key}/{mcp_server_name}"
2930

3031
# Use streamable HTTP client to connect to the MCP server
3132
async with streamablehttp_client(mcp_url, headers={ 'Authorization': f'Bearer {token}' }) as (read_stream, write_stream, _):

testcases/ground-to-cloud/uipath.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"entryPoints": [
33
{
4-
"filePath": "mathmcp",
5-
"uniqueId": "24ccb4c2-6117-4976-9422-109b1270ae63",
4+
"filePath": "mathmcp-{PR}-{RUN_ID}",
5+
"uniqueId": "{UNIQUE_ID}",
66
"type": "mcpserver",
77
"input": {},
88
"output": {}

0 commit comments

Comments
 (0)