Skip to content

Commit 166d400

Browse files
mjnoviceclaude
andcommitted
ci: add E2E memory tests to GitHub Actions workflow
- Adds e2e-uipath-platform job to test-packages.yml - Runs on uipath-platform changes, Python 3.11, ubuntu-latest - Uses ALPHA_TEST_CLIENT_ID/CLIENT_SECRET for auth (same as integration tests) - Reads memory folder from UIPATH_MEMORY_FOLDER secret - E2E results are non-blocking in the test gate (informational) - Test supports both token-based (local) and client credentials (CI) auth Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent e1adf5e commit 166d400

2 files changed

Lines changed: 79 additions & 3 deletions

File tree

.github/workflows/test-packages.yml

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,55 @@ jobs:
130130
working-directory: packages/uipath-platform
131131
run: uv run pytest
132132

133+
e2e-uipath-platform:
134+
name: E2E (uipath-platform, memory)
135+
needs: detect-changed-packages
136+
runs-on: ubuntu-latest
137+
steps:
138+
- name: Check if package changed
139+
id: check
140+
shell: bash
141+
run: |
142+
if echo '${{ needs.detect-changed-packages.outputs.packages }}' | jq -e 'index("uipath-platform")' > /dev/null; then
143+
echo "skip=false" >> $GITHUB_OUTPUT
144+
else
145+
echo "skip=true" >> $GITHUB_OUTPUT
146+
fi
147+
148+
- name: Skip
149+
if: steps.check.outputs.skip == 'true'
150+
shell: bash
151+
run: echo "Skipping - no changes to uipath-platform"
152+
153+
- name: Checkout
154+
if: steps.check.outputs.skip != 'true'
155+
uses: actions/checkout@v4
156+
157+
- name: Setup uv
158+
if: steps.check.outputs.skip != 'true'
159+
uses: astral-sh/setup-uv@v5
160+
161+
- name: Setup Python
162+
if: steps.check.outputs.skip != 'true'
163+
uses: actions/setup-python@v5
164+
with:
165+
python-version: "3.11"
166+
167+
- name: Install dependencies
168+
if: steps.check.outputs.skip != 'true'
169+
working-directory: packages/uipath-platform
170+
run: uv sync --all-extras --python 3.11
171+
172+
- name: Run E2E memory tests
173+
if: steps.check.outputs.skip != 'true'
174+
working-directory: packages/uipath-platform
175+
env:
176+
UIPATH_URL: ${{ secrets.ALPHA_BASE_URL }}
177+
UIPATH_CLIENT_ID: ${{ secrets.ALPHA_TEST_CLIENT_ID }}
178+
UIPATH_CLIENT_SECRET: ${{ secrets.ALPHA_TEST_CLIENT_SECRET }}
179+
UIPATH_FOLDER_KEY: ${{ secrets.UIPATH_MEMORY_FOLDER }}
180+
run: uv run pytest tests/services/test_memory_service_e2e.py -m e2e -v --no-cov
181+
133182
test-uipath:
134183
name: Test (uipath, ${{ matrix.python-version }}, ${{ matrix.os }})
135184
needs: detect-changed-packages
@@ -184,7 +233,7 @@ jobs:
184233

185234
test-gate:
186235
name: Test
187-
needs: [test-uipath-core, test-uipath-platform, test-uipath]
236+
needs: [test-uipath-core, test-uipath-platform, test-uipath, e2e-uipath-platform]
188237
runs-on: ubuntu-latest
189238
if: always()
190239
steps:
@@ -196,4 +245,8 @@ jobs:
196245
echo "Tests failed"
197246
exit 1
198247
fi
248+
# E2E tests are informational — log but don't block
249+
if [[ "${{ needs.e2e-uipath-platform.result }}" == "failure" ]]; then
250+
echo "⚠️ E2E memory tests failed (non-blocking)"
251+
fi
199252
echo "All tests passed"

packages/uipath-platform/tests/services/test_memory_service_e2e.py

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,17 @@ def _require_env(name: str) -> str:
4040

4141
@pytest.fixture(scope="module")
4242
def sdk() -> UiPath:
43-
"""Create a real UiPath client from env vars."""
43+
"""Create a real UiPath client from env vars.
44+
45+
Supports two auth modes:
46+
- Token-based: UIPATH_URL + UIPATH_ACCESS_TOKEN (from `uipath auth`)
47+
- Client credentials: UIPATH_URL + UIPATH_CLIENT_ID + UIPATH_CLIENT_SECRET (CI)
48+
"""
4449
_require_env("UIPATH_URL")
50+
client_id = os.environ.get("UIPATH_CLIENT_ID")
51+
client_secret = os.environ.get("UIPATH_CLIENT_SECRET")
52+
if client_id and client_secret:
53+
return UiPath(client_id=client_id, client_secret=client_secret)
4554
_require_env("UIPATH_ACCESS_TOKEN")
4655
return UiPath()
4756

@@ -58,7 +67,21 @@ def base_url() -> str:
5867

5968
@pytest.fixture(scope="module")
6069
def access_token() -> str:
61-
return _require_env("UIPATH_ACCESS_TOKEN")
70+
"""Get an access token for raw HTTP calls (feedback creation).
71+
72+
In client credentials mode, creates a UiPath instance to exchange
73+
credentials for a token.
74+
"""
75+
token = os.environ.get("UIPATH_ACCESS_TOKEN")
76+
if token:
77+
return token
78+
client_id = os.environ.get("UIPATH_CLIENT_ID")
79+
client_secret = os.environ.get("UIPATH_CLIENT_SECRET")
80+
if client_id and client_secret:
81+
client = UiPath(client_id=client_id, client_secret=client_secret)
82+
return client._config.secret
83+
pytest.skip("No access token or client credentials available")
84+
return "" # unreachable
6285

6386

6487
@pytest.fixture(scope="module")

0 commit comments

Comments
 (0)