Skip to content

Commit c6870ed

Browse files
authored
Merge pull request #206 from UiPath/chore/update-workflow
ci: add staging support and update integration test workflow
2 parents 8cff3ef + 7290f68 commit c6870ed

File tree

8 files changed

+43
-88
lines changed

8 files changed

+43
-88
lines changed

.github/workflows/integration_tests.yml

Lines changed: 20 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -19,63 +19,56 @@ jobs:
1919
steps:
2020
- name: Checkout code
2121
uses: actions/checkout@v4
22-
22+
2323
- name: Discover testcases
2424
id: discover
2525
run: |
2626
# Find all testcase folders (excluding common folders like README, etc.)
2727
testcase_dirs=$(find testcases -maxdepth 1 -type d -name "*-*" | sed 's|testcases/||' | sort)
28-
28+
2929
echo "Found testcase directories:"
3030
echo "$testcase_dirs"
31-
31+
3232
# Convert to JSON array for matrix
3333
testcases_json=$(echo "$testcase_dirs" | jq -R -s -c 'split("\n")[:-1]')
3434
echo "testcases=$testcases_json" >> $GITHUB_OUTPUT
3535
3636
integration-tests:
3737
needs: [discover-testcases]
3838
runs-on: ubuntu-latest
39+
container:
40+
image: ghcr.io/astral-sh/uv:python3.12-bookworm
41+
env:
42+
UIPATH_JOB_KEY: "3a03d5cb-fa21-4021-894d-a8e2eda0afe0"
3943
strategy:
4044
fail-fast: false
4145
matrix:
4246
testcase: ${{ fromJson(needs.discover-testcases.outputs.testcases) }}
43-
environment: [alpha, cloud]
47+
environment: [alpha, staging] # temporary disable [cloud]
4448
use_azure_chat: [true, false]
45-
49+
4650
name: "${{ matrix.testcase }} / ${{ matrix.environment }} / ${{ matrix.use_azure_chat && 'UiPathAzureChatOpenAI' || 'UiPathChat' }}"
47-
51+
4852
steps:
4953
- name: Checkout code
5054
uses: actions/checkout@v4
5155

52-
- name: Set up Docker Buildx
53-
uses: docker/setup-buildx-action@v3
54-
55-
- name: Build Docker image
56-
run: |
57-
echo "Building Docker image for ${{ matrix.testcase }} at $(date)"
58-
docker build -f testcases/Dockerfile \
59-
-t uipath-langchain-testbase:latest \
60-
.
61-
echo "Docker image built at $(date)"
56+
- name: Install Dependencies
57+
run: uv sync
6258

6359
- name: Run testcase
6460
env:
65-
CLIENT_ID: ${{ matrix.environment == 'alpha' && secrets.ALPHA_TEST_CLIENT_ID || secrets.CLOUD_TEST_CLIENT_ID }}
66-
CLIENT_SECRET: ${{ matrix.environment == 'alpha' && secrets.ALPHA_TEST_CLIENT_SECRET || secrets.CLOUD_TEST_CLIENT_SECRET }}
67-
BASE_URL: ${{ matrix.environment == 'alpha' && secrets.ALPHA_BASE_URL || secrets.CLOUD_BASE_URL }}
61+
CLIENT_ID: ${{ matrix.environment == 'alpha' && secrets.ALPHA_TEST_CLIENT_ID || matrix.environment == 'staging' && secrets.STAGING_TEST_CLIENT_ID || matrix.environment == 'cloud' && secrets.CLOUD_TEST_CLIENT_ID }}
62+
CLIENT_SECRET: ${{ matrix.environment == 'alpha' && secrets.ALPHA_TEST_CLIENT_SECRET || matrix.environment == 'staging' && secrets.STAGING_TEST_CLIENT_SECRET || matrix.environment == 'cloud' && secrets.CLOUD_TEST_CLIENT_SECRET }}
63+
BASE_URL: ${{ matrix.environment == 'alpha' && secrets.ALPHA_BASE_URL || matrix.environment == 'staging' && secrets.STAGING_BASE_URL || matrix.environment == 'cloud' && secrets.CLOUD_BASE_URL }}
6864
USE_AZURE_CHAT: ${{ matrix.use_azure_chat }}
65+
working-directory: testcases/${{ matrix.testcase }}
6966
run: |
7067
echo "Running testcase: ${{ matrix.testcase }}"
7168
echo "Environment: ${{ matrix.environment }}"
7269
echo "LLM: ${{ matrix.use_azure_chat && 'UiPathAzureChatOpenAI' || 'UiPathChat' }}"
7370
echo "USE_AZURE_CHAT: ${{ matrix.use_azure_chat }}"
74-
75-
docker run --rm \
76-
-e CLIENT_ID="$CLIENT_ID" \
77-
-e CLIENT_SECRET="$CLIENT_SECRET" \
78-
-e BASE_URL="$BASE_URL" \
79-
-e USE_AZURE_CHAT="$USE_AZURE_CHAT" \
80-
uipath-langchain-testbase:latest \
81-
bash /app/testcases/${{ matrix.testcase }}/run.sh
71+
72+
# Execute the testcase run script directly
73+
bash run.sh
74+
bash ../common/validate_output.sh

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ cython_debug/
165165
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
166166
# and can be added to the global gitignore or merged into this file. For a more nuclear
167167
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
168-
#.idea/
168+
.idea/
169169

170170
# Ruff stuff:
171171
.ruff_cache/
@@ -178,4 +178,4 @@ cython_debug/
178178
**/.uipath
179179
**/**.nupkg
180180
**/__uipath/
181-
**/.langgraph_api
181+
**/.langgraph_api

testcases/Dockerfile

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

testcases/common/print_output.sh renamed to testcases/common/validate_output.sh

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/bin/bash
22

33
# Common utility to print UiPath output file
4-
# Usage: source /app/testcases/common/print_output.sh
4+
# Usage: source /app/testcases/common/validate_output.sh
55

6-
print_uipath_output() {
6+
debug_print_uipath_output() {
77
echo "Printing output file..."
88
if [ -f "__uipath/output.json" ]; then
99
echo "=== OUTPUT FILE CONTENT ==="
@@ -21,3 +21,15 @@ print_uipath_output() {
2121
fi
2222
fi
2323
}
24+
25+
validate_output() {
26+
echo "Printing output file for validation..."
27+
debug_print_uipath_output
28+
29+
echo "Validating output..."
30+
python src/assert.py || { echo "Validation failed!"; exit 1; }
31+
32+
echo "Testcase completed successfully."
33+
}
34+
35+
validate_output
Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,14 @@
1-
#!/bin/bash
2-
cd /app/testcases/company-research-agent
3-
41
echo "Syncing dependencies..."
52
uv sync
63

74
echo "Authenticating with UiPath..."
8-
uv run uipath auth --client-id="$CLIENT_ID" --client-secret="$CLIENT_SECRET" --base-url="$BASE_URL"
5+
uv run uipath auth --client-id="$CLIENT_ID" --client-secret="$CLIENT_SECRET" --base-url="$BASE_URL"
96

10-
echo "Running uipath init..."
7+
echo "Initializing the project..."
118
uv run uipath init
129

1310
echo "Packing agent..."
1411
uv run uipath pack
1512

16-
echo "Input from input.json file"
17-
uv run uipath run agent --file input.json
18-
19-
source /app/testcases/common/print_output.sh
20-
print_uipath_output
21-
22-
echo "Validating output..."
23-
python src/assert.py || { echo "Validation failed!"; exit 1; }
24-
25-
echo "Testcase completed successfully."
13+
echo "Running agent..."
14+
uv run uipath run agent --file input.json

testcases/init-flow/run.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
#!/bin/bash
2-
cd /app/testcases/init-flow
3-
41
echo "Syncing dependencies..."
52
uv sync
63

testcases/simple-local-mcp/run.sh

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,16 @@
1-
#!/bin/bash
2-
cd /app/testcases/simple-local-mcp
3-
41
echo "Syncing dependencies..."
52
uv sync
63

74
echo "Authenticating with UiPath..."
85
uv run uipath auth --client-id="$CLIENT_ID" --client-secret="$CLIENT_SECRET" --base-url="$BASE_URL"
96

10-
echo "Running uipath init..."
7+
echo "Initializing the project..."
118
uv run uipath init
129

1310
echo "Packing agent..."
1411
uv run uipath pack
1512

13+
echo "Running agent..."
1614
echo "Input from input.json file"
1715
uv run uipath run agent --file input.json
1816

19-
source /app/testcases/common/print_output.sh
20-
print_uipath_output
21-
22-
echo "Validating output..."
23-
python src/assert.py || { echo "Validation failed!"; exit 1; }
24-
25-
echo "Testcase completed successfully."
Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,18 @@
1-
#!/bin/bash
2-
cd /app/testcases/ticket-classification
3-
41
echo "Syncing dependencies..."
52
uv sync
63

74
echo "Authenticating with UiPath..."
85
uv run uipath auth --client-id="$CLIENT_ID" --client-secret="$CLIENT_SECRET" --base-url="$BASE_URL"
96

10-
echo "Running uipath init..."
7+
echo "Initializing the project..."
118
uv run uipath init
129

1310
echo "Packing agent..."
1411
uv run uipath pack
1512

16-
# run and them resume the agent to simulate user interaction
1713
echo "Input from input.json file"
1814
uv run uipath run agent --file input.json
1915

2016
echo "Resuming agent run by default with {'Answer': true}..."
2117
uv run uipath run agent '{"Answer": true}' --resume;
2218

23-
source /app/testcases/common/print_output.sh
24-
print_uipath_output
25-
26-
echo "Validating output..."
27-
python src/assert.py || { echo "Validation failed!"; exit 1; }
28-
29-
echo "Testcase completed successfully."

0 commit comments

Comments
 (0)