Skip to content

Commit d5ed5d0

Browse files
committed
fix(tests): final commit
1 parent 8676aca commit d5ed5d0

1 file changed

Lines changed: 379 additions & 0 deletions

File tree

Lines changed: 379 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,379 @@
1+
name: Integration testing
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
integration-tests:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
pull-requests: write
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Docker Buildx
21+
uses: docker/setup-buildx-action@v3
22+
23+
- name: Build common Docker image
24+
run: |
25+
Write-Host "Building common Docker image at $(Get-Date)"
26+
docker build -f testcases/Dockerfile `
27+
-t uipath-langchain-testbase:latest `
28+
.
29+
Write-Host "Common Docker image built at $(Get-Date)"
30+
shell: pwsh
31+
32+
- name: Run testcases
33+
run: |
34+
$jobs = @(
35+
"company-research-agent:true:alpha",
36+
"company-research-agent:false:alpha",
37+
"simple-local-mcp:true:alpha",
38+
"simple-local-mcp:false:alpha",
39+
"ticket-classification:true:alpha",
40+
"ticket-classification:false:alpha",
41+
"multi-agent-supervisor-researcher-coder:true:alpha",
42+
"multi-agent-supervisor-researcher-coder:false:alpha",
43+
"company-research-agent:true:cloud",
44+
"company-research-agent:false:cloud",
45+
"simple-local-mcp:true:cloud",
46+
"simple-local-mcp:false:cloud",
47+
"ticket-classification:true:cloud",
48+
"ticket-classification:false:cloud",
49+
"multi-agent-supervisor-researcher-coder:true:cloud",
50+
"multi-agent-supervisor-researcher-coder:false:cloud"
51+
)
52+
53+
Write-Host "=== STARTING TESTCASE EXECUTION ==="
54+
Write-Host "Total testcases to run: $($jobs.Count)"
55+
Write-Host "Alpha environment with UiPathAzureChatOpenAI: $(($jobs | Where-Object { $_ -like '*:true:alpha' }).Count)"
56+
Write-Host "Alpha environment with UiPathChat: $(($jobs | Where-Object { $_ -like '*:false:alpha' }).Count)"
57+
Write-Host "Cloud environment with UiPathAzureChatOpenAI: $(($jobs | Where-Object { $_ -like '*:true:cloud' }).Count)"
58+
Write-Host "Cloud environment with UiPathChat: $(($jobs | Where-Object { $_ -like '*:false:cloud' }).Count)"
59+
Write-Host "======================================="
60+
61+
$backgroundJobs = @()
62+
63+
foreach ($job in $jobs) {
64+
$parts = $job -split ":"
65+
$testcase = $parts[0]
66+
$use_azure_chat = $parts[1]
67+
$environment = $parts[2]
68+
$llm = if ($use_azure_chat -eq "true") { "UiPathAzureChatOpenAI" } else { "UiPathChat" }
69+
$log_file = "run_${testcase}_${llm}_${environment}.log"
70+
71+
# Set environment-specific credentials
72+
if ($environment -eq "alpha") {
73+
$CLIENT_ID_VAR = '${{ secrets.ALPHA_TEST_CLIENT_ID }}'
74+
$CLIENT_SECRET_VAR = '${{ secrets.ALPHA_TEST_CLIENT_SECRET }}'
75+
$BASE_URL_VAR = '${{ secrets.ALPHA_BASE_URL }}'
76+
} else {
77+
$CLIENT_ID_VAR = '${{ secrets.CLOUD_TEST_CLIENT_ID }}'
78+
$CLIENT_SECRET_VAR = '${{ secrets.CLOUD_TEST_CLIENT_SECRET }}'
79+
$BASE_URL_VAR = '${{ secrets.CLOUD_BASE_URL }}'
80+
}
81+
82+
$scriptBlock = {
83+
param($testcase, $llm, $environment, $log_file, $use_azure_chat, $CLIENT_ID_VAR, $CLIENT_SECRET_VAR, $BASE_URL_VAR)
84+
85+
Write-Host "[$(Get-Date)] STARTING: $testcase ($llm) [$environment]"
86+
87+
# Create log file with header
88+
@"
89+
========================================
90+
TESTCASE: $testcase
91+
LLM: $llm
92+
ENVIRONMENT: $environment
93+
USE_AZURE_CHAT: $use_azure_chat
94+
STARTED_AT: $(Get-Date)
95+
========================================
96+
97+
"@ | Out-File -FilePath $log_file -Encoding utf8
98+
99+
# Run the testcase and append to log file
100+
$dockerArgs = @(
101+
"run", "--rm",
102+
"-e", "CLIENT_ID=$CLIENT_ID_VAR",
103+
"-e", "CLIENT_SECRET=$CLIENT_SECRET_VAR",
104+
"-e", "BASE_URL=$BASE_URL_VAR",
105+
"-e", "USE_AZURE_CHAT=$use_azure_chat",
106+
"uipath-langchain-testbase:latest",
107+
"bash", "/app/testcases/$testcase/run.sh"
108+
)
109+
110+
$process = Start-Process -FilePath "docker" -ArgumentList $dockerArgs -Wait -PassThru -RedirectStandardOutput "temp_$log_file" -RedirectStandardError "temp_err_$log_file" -NoNewWindow
111+
112+
# Append output to log file
113+
if (Test-Path "temp_$log_file") {
114+
Get-Content "temp_$log_file" | Add-Content -Path $log_file
115+
Remove-Item "temp_$log_file"
116+
}
117+
if (Test-Path "temp_err_$log_file") {
118+
Get-Content "temp_err_$log_file" | Add-Content -Path $log_file
119+
Remove-Item "temp_err_$log_file"
120+
}
121+
122+
$exit_code = $process.ExitCode
123+
124+
# Add completion status to log file
125+
if ($exit_code -eq 0) {
126+
Write-Host "[$(Get-Date)] SUCCESS: $testcase ($llm) [$environment]"
127+
@"
128+
129+
=========================================
130+
COMPLETED_AT: $(Get-Date)
131+
STATUS: SUCCESS
132+
=========================================
133+
"@ | Add-Content -Path $log_file
134+
} else {
135+
Write-Host "[$(Get-Date)] FAILED: $testcase ($llm) [$environment]"
136+
@"
137+
138+
========================================
139+
COMPLETED_AT: $(Get-Date)
140+
STATUS: FAILED
141+
EXIT_CODE: $exit_code
142+
========================================
143+
"@ | Add-Content -Path $log_file
144+
}
145+
}
146+
147+
$backgroundJobs += Start-Job -ScriptBlock $scriptBlock -ArgumentList $testcase, $llm, $environment, $log_file, $use_azure_chat, $CLIENT_ID_VAR, $CLIENT_SECRET_VAR, $BASE_URL_VAR
148+
}
149+
150+
# Wait for all jobs to complete
151+
$backgroundJobs | Wait-Job | Receive-Job
152+
$backgroundJobs | Remove-Job
153+
154+
Write-Host "All testcases execution completed."
155+
shell: pwsh
156+
157+
- name: Display company-research-agent (UiPathAzureChatOpenAI) Alpha logs
158+
run: |
159+
$log_file = "run_company-research-agent_UiPathAzureChatOpenAI_alpha.log"
160+
Write-Host "================================================"
161+
Write-Host "COMPANY-RESEARCH-AGENT (UiPathAzureChatOpenAI) ALPHA LOG"
162+
Write-Host "Log file: $log_file"
163+
Write-Host "================================================"
164+
if (Test-Path $log_file) {
165+
Get-Content $log_file
166+
} else {
167+
Write-Host "ERROR: Log file not found!"
168+
}
169+
shell: pwsh
170+
171+
- name: Display company-research-agent (UiPathChat) Alpha logs
172+
run: |
173+
$log_file = "run_company-research-agent_UiPathChat_alpha.log"
174+
Write-Host "================================================"
175+
Write-Host "COMPANY-RESEARCH-AGENT (UiPathChat) ALPHA LOG"
176+
Write-Host "Log file: $log_file"
177+
Write-Host "================================================"
178+
if (Test-Path $log_file) {
179+
Get-Content $log_file
180+
} else {
181+
Write-Host "ERROR: Log file not found!"
182+
}
183+
shell: pwsh
184+
185+
- name: Display company-research-agent (UiPathAzureChatOpenAI) Cloud logs
186+
run: |
187+
$log_file = "run_company-research-agent_UiPathAzureChatOpenAI_cloud.log"
188+
Write-Host "================================================"
189+
Write-Host "COMPANY-RESEARCH-AGENT (UiPathAzureChatOpenAI) CLOUD LOG"
190+
Write-Host "Log file: $log_file"
191+
Write-Host "================================================"
192+
if (Test-Path $log_file) {
193+
Get-Content $log_file
194+
} else {
195+
Write-Host "ERROR: Log file not found!"
196+
}
197+
shell: pwsh
198+
199+
- name: Display company-research-agent (UiPathChat) Cloud logs
200+
run: |
201+
$log_file = "run_company-research-agent_UiPathChat_cloud.log"
202+
Write-Host "================================================"
203+
Write-Host "COMPANY-RESEARCH-AGENT (UiPathChat) CLOUD LOG"
204+
Write-Host "Log file: $log_file"
205+
Write-Host "================================================"
206+
if (Test-Path $log_file) {
207+
Get-Content $log_file
208+
} else {
209+
Write-Host "ERROR: Log file not found!"
210+
}
211+
shell: pwsh
212+
213+
- name: Display simple-local-mcp (UiPathAzureChatOpenAI) Alpha logs
214+
run: |
215+
$log_file = "run_simple-local-mcp_UiPathAzureChatOpenAI_alpha.log"
216+
Write-Host "================================================"
217+
Write-Host "SIMPLE-LOCAL-MCP (UiPathAzureChatOpenAI) ALPHA LOG"
218+
Write-Host "Log file: $log_file"
219+
Write-Host "================================================"
220+
if (Test-Path $log_file) {
221+
Get-Content $log_file
222+
} else {
223+
Write-Host "ERROR: Log file not found!"
224+
}
225+
shell: pwsh
226+
227+
- name: Display simple-local-mcp (UiPathChat) Alpha logs
228+
run: |
229+
$log_file = "run_simple-local-mcp_UiPathChat_alpha.log"
230+
Write-Host "================================================"
231+
Write-Host "SIMPLE-LOCAL-MCP (UiPathChat) ALPHA LOG"
232+
Write-Host "Log file: $log_file"
233+
Write-Host "================================================"
234+
if (Test-Path $log_file) {
235+
Get-Content $log_file
236+
} else {
237+
Write-Host "ERROR: Log file not found!"
238+
}
239+
shell: pwsh
240+
241+
- name: Display simple-local-mcp (UiPathAzureChatOpenAI) Cloud logs
242+
run: |
243+
$log_file = "run_simple-local-mcp_UiPathAzureChatOpenAI_cloud.log"
244+
Write-Host "================================================"
245+
Write-Host "SIMPLE-LOCAL-MCP (UiPathAzureChatOpenAI) CLOUD LOG"
246+
Write-Host "Log file: $log_file"
247+
Write-Host "================================================"
248+
if (Test-Path $log_file) {
249+
Get-Content $log_file
250+
} else {
251+
Write-Host "ERROR: Log file not found!"
252+
}
253+
shell: pwsh
254+
255+
- name: Display simple-local-mcp (UiPathChat) Cloud logs
256+
run: |
257+
$log_file = "run_simple-local-mcp_UiPathChat_cloud.log"
258+
Write-Host "================================================"
259+
Write-Host "SIMPLE-LOCAL-MCP (UiPathChat) CLOUD LOG"
260+
Write-Host "Log file: $log_file"
261+
Write-Host "================================================"
262+
if (Test-Path $log_file) {
263+
Get-Content $log_file
264+
} else {
265+
Write-Host "ERROR: Log file not found!"
266+
}
267+
shell: pwsh
268+
269+
- name: Display ticket-classification (UiPathAzureChatOpenAI) Alpha logs
270+
run: |
271+
$log_file = "run_ticket-classification_UiPathAzureChatOpenAI_alpha.log"
272+
Write-Host "================================================"
273+
Write-Host "TICKET-CLASSIFICATION (UiPathAzureChatOpenAI) ALPHA LOG"
274+
Write-Host "Log file: $log_file"
275+
Write-Host "================================================"
276+
if (Test-Path $log_file) {
277+
Get-Content $log_file
278+
} else {
279+
Write-Host "ERROR: Log file not found!"
280+
}
281+
shell: pwsh
282+
283+
- name: Display ticket-classification (UiPathChat) Alpha logs
284+
run: |
285+
$log_file = "run_ticket-classification_UiPathChat_alpha.log"
286+
Write-Host "================================================"
287+
Write-Host "TICKET-CLASSIFICATION (UiPathChat) ALPHA LOG"
288+
Write-Host "Log file: $log_file"
289+
Write-Host "================================================"
290+
if (Test-Path $log_file) {
291+
Get-Content $log_file
292+
} else {
293+
Write-Host "ERROR: Log file not found!"
294+
}
295+
shell: pwsh
296+
297+
- name: Display ticket-classification (UiPathAzureChatOpenAI) Cloud logs
298+
run: |
299+
$log_file = "run_ticket-classification_UiPathAzureChatOpenAI_cloud.log"
300+
Write-Host "================================================"
301+
Write-Host "TICKET-CLASSIFICATION (UiPathAzureChatOpenAI) CLOUD LOG"
302+
Write-Host "Log file: $log_file"
303+
Write-Host "================================================"
304+
if (Test-Path $log_file) {
305+
Get-Content $log_file
306+
} else {
307+
Write-Host "ERROR: Log file not found!"
308+
}
309+
shell: pwsh
310+
311+
- name: Display ticket-classification (UiPathChat) Cloud logs
312+
run: |
313+
$log_file = "run_ticket-classification_UiPathChat_cloud.log"
314+
Write-Host "================================================"
315+
Write-Host "TICKET-CLASSIFICATION (UiPathChat) CLOUD LOG"
316+
Write-Host "Log file: $log_file"
317+
Write-Host "================================================"
318+
if (Test-Path $log_file) {
319+
Get-Content $log_file
320+
} else {
321+
Write-Host "ERROR: Log file not found!"
322+
}
323+
shell: pwsh
324+
325+
- name: Display multi-agent-supervisor-researcher-coder (UiPathAzureChatOpenAI) Alpha logs
326+
run: |
327+
$log_file = "run_multi-agent-supervisor-researcher-coder_UiPathAzureChatOpenAI_alpha.log"
328+
Write-Host "================================================"
329+
Write-Host "MULTI-AGENT-SUPERVISOR-RESEARCHER-CODER (UiPathAzureChatOpenAI) ALPHA LOG"
330+
Write-Host "Log file: $log_file"
331+
Write-Host "================================================"
332+
if (Test-Path $log_file) {
333+
Get-Content $log_file
334+
} else {
335+
Write-Host "ERROR: Log file not found!"
336+
}
337+
shell: pwsh
338+
339+
- name: Display multi-agent-supervisor-researcher-coder (UiPathChat) Alpha logs
340+
run: |
341+
$log_file = "run_multi-agent-supervisor-researcher-coder_UiPathChat_alpha.log"
342+
Write-Host "================================================"
343+
Write-Host "MULTI-AGENT-SUPERVISOR-RESEARCHER-CODER (UiPathChat) ALPHA LOG"
344+
Write-Host "Log file: $log_file"
345+
Write-Host "================================================"
346+
if (Test-Path $log_file) {
347+
Get-Content $log_file
348+
} else {
349+
Write-Host "ERROR: Log file not found!"
350+
}
351+
shell: pwsh
352+
353+
- name: Display multi-agent-supervisor-researcher-coder (UiPathAzureChatOpenAI) Cloud logs
354+
run: |
355+
$log_file = "run_multi-agent-supervisor-researcher-coder_UiPathAzureChatOpenAI_cloud.log"
356+
Write-Host "================================================"
357+
Write-Host "MULTI-AGENT-SUPERVISOR-RESEARCHER-CODER (UiPathAzureChatOpenAI) CLOUD LOG"
358+
Write-Host "Log file: $log_file"
359+
Write-Host "================================================"
360+
if (Test-Path $log_file) {
361+
Get-Content $log_file
362+
} else {
363+
Write-Host "ERROR: Log file not found!"
364+
}
365+
shell: pwsh
366+
367+
- name: Display multi-agent-supervisor-researcher-coder (UiPathChat) Cloud logs
368+
run: |
369+
$log_file = "run_multi-agent-supervisor-researcher-coder_UiPathChat_cloud.log"
370+
Write-Host "================================================"
371+
Write-Host "MULTI-AGENT-SUPERVISOR-RESEARCHER-CODER (UiPathChat) CLOUD LOG"
372+
Write-Host "Log file: $log_file"
373+
Write-Host "================================================"
374+
if (Test-Path $log_file) {
375+
Get-Content $log_file
376+
} else {
377+
Write-Host "ERROR: Log file not found!"
378+
}
379+
shell: pwsh

0 commit comments

Comments
 (0)