Skip to content

Commit dd3127c

Browse files
try run langchain integration tests
1 parent 7779ebe commit dd3127c

1 file changed

Lines changed: 116 additions & 0 deletions

File tree

.github/workflows/test-uipath-langchain.yml

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,120 @@ jobs:
5656
uv sync
5757
uv run pytest
5858
59+
run-uipath-langchain-integration-tests:
60+
runs-on: ubuntu-latest
61+
permissions:
62+
contents: read
63+
steps:
64+
65+
- name: Checkout uipath-python
66+
uses: actions/checkout@v4
67+
with:
68+
path: 'uipath-python'
69+
70+
- name: Setup uv
71+
uses: astral-sh/setup-uv@v5
72+
73+
- name: Build uipath-python package
74+
run: |
75+
cd uipath-python
76+
uv build
77+
78+
- name: Checkout uipath-langchain-python
79+
uses: actions/checkout@v4
80+
with:
81+
repository: 'UiPath/uipath-langchain-python'
82+
path: 'uipath-langchain-python'
83+
token: ${{ secrets.REPO_ACCESS }}
84+
85+
- name: Copy wheel to uipath-langchain
86+
run: |
87+
mkdir -p uipath-langchain-python/wheels
88+
cp uipath-python/dist/*.whl uipath-langchain-python/wheels/
89+
90+
- name: Update uipath-python version
91+
shell: bash
92+
run: |
93+
cd uipath-langchain-python
94+
WHL=$(ls wheels/*.whl | head -n1)
95+
WHL_NAME=$(basename "$WHL")
96+
echo "Using wheel: $WHL_NAME"
97+
sed -i "s|uipath.*|uipath @ file://./wheels/$WHL_NAME\",|" pyproject.toml
98+
99+
- name: Print pyproject.toml to debug
100+
run: |
101+
cd uipath-langchain-python
102+
cat pyproject.toml
103+
104+
- name: Discover testcases
105+
id: discover
106+
run: |
107+
cd uipath-langchain-python
108+
109+
# Find all testcase folders (excluding common folders like README, etc.)
110+
testcase_dirs=$(find testcases -maxdepth 1 -type d -name "*-*" | sed 's|testcases/||' | sort)
111+
112+
echo "Found testcase directories:"
113+
echo "$testcase_dirs"
114+
115+
# Convert to JSON array for matrix
116+
testcases_json=$(echo "$testcase_dirs" | jq -R -s -c 'split("\n")[:-1]')
117+
echo "testcases=$testcases_json" >> $GITHUB_ENV
118+
119+
- name: Set up Docker Buildx
120+
uses: docker/setup-buildx-action@v3
121+
122+
- name: Build Docker image
123+
run: |
124+
cd uipath-langchain-python
125+
echo "Building Docker image at $(date)"
126+
docker build -f testcases/Dockerfile \
127+
-t uipath-langchain-testbase:latest .
128+
echo "Docker image built at $(date)"
129+
130+
- name: Run integration tests
131+
env:
132+
TESTCASES: ${{ steps.discover.outputs.testcases }}
133+
ALPHA_TEST_CLIENT_ID: ${{ secrets.ALPHA_TEST_CLIENT_ID }}
134+
ALPHA_TEST_CLIENT_SECRET: ${{ secrets.ALPHA_TEST_CLIENT_SECRET }}
135+
ALPHA_BASE_URL: ${{ secrets.ALPHA_BASE_URL }}
136+
CLOUD_TEST_CLIENT_ID: ${{ secrets.CLOUD_TEST_CLIENT_ID }}
137+
CLOUD_TEST_CLIENT_SECRET: ${{ secrets.CLOUD_TEST_CLIENT_SECRET }}
138+
CLOUD_BASE_URL: ${{ secrets.CLOUD_BASE_URL }}
139+
run: |
140+
cd uipath-langchain-python
141+
142+
testcases=$(echo $testcases | jq -c '.')
143+
144+
environments=("alpha" "cloud")
145+
use_azure_chat_options=("true" "false")
146+
147+
for testcase in $(echo "$testcases" | jq -r '.[]'); do
148+
for environment in "${environments[@]}"; do
149+
for use_azure_chat in "${use_azure_chat_options[@]}"; do
150+
echo "Running testcase: $testcase"
151+
echo "Environment: $environment"
152+
echo "LLM: $( [ $use_azure_chat == "true" ] && echo "UiPathAzureChatOpenAI" || echo "UiPathChat" )"
153+
echo "USE_AZURE_CHAT: $use_azure_chat"
154+
155+
if [ "$environment" == "alpha" ]; then
156+
CLIENT_ID=$ALPHA_TEST_CLIENT_ID
157+
CLIENT_SECRET=$ALPHA_TEST_CLIENT_SECRET
158+
BASE_URL=$ALPHA_BASE_URL
159+
else
160+
CLIENT_ID=$CLOUD_TEST_CLIENT_ID
161+
CLIENT_SECRET=$CLOUD_TEST_CLIENT_SECRET
162+
BASE_URL=$CLOUD_BASE_URL
163+
fi
164+
165+
docker run --rm \
166+
-e CLIENT_ID="$CLIENT_ID" \
167+
-e CLIENT_SECRET="$CLIENT_SECRET" \
168+
-e BASE_URL="$BASE_URL" \
169+
-e USE_AZURE_CHAT="$use_azure_chat" \
170+
uipath-langchain-testbase:latest \
171+
bash "/app/testcases/$testcase/run.sh"
172+
done
173+
done
174+
done
59175

0 commit comments

Comments
 (0)