feat(eval): honor UIPATH_AGENT_ID, UIPATH_CLOUD_USER_ID, UIPATH_PROJECT_FILES_SOURCE env vars [AE-1396] #4975
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: uipath - Test Langchain | |
| on: | |
| pull_request: | |
| types: [ opened, synchronize, reopened, labeled ] | |
| jobs: | |
| build-wheels: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| if: contains(github.event.pull_request.labels.*.name, 'test:uipath-langchain') | |
| steps: | |
| - name: Checkout uipath-python | |
| uses: actions/checkout@v4 | |
| - name: Setup uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Build uipath-core package | |
| working-directory: packages/uipath-core | |
| run: uv build | |
| - name: Build uipath-platform package | |
| working-directory: packages/uipath-platform | |
| run: uv build | |
| - name: Build uipath package | |
| working-directory: packages/uipath | |
| run: uv build | |
| - name: Upload wheels | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: uipath-wheels | |
| path: packages/*/dist/*.whl | |
| test-uipath-langchain: | |
| needs: [build-wheels] | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| python-version: [ "3.11", "3.12", "3.13" ] | |
| os: [ ubuntu-latest, windows-latest ] | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Setup uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Download wheels | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: uipath-wheels | |
| path: wheels | |
| - name: Checkout uipath-langchain-python | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: 'UiPath/uipath-langchain-python' | |
| path: 'uipath-langchain-python' | |
| - name: Update uipath packages | |
| shell: bash | |
| working-directory: uipath-langchain-python | |
| run: | | |
| uv add ../wheels/uipath-core/dist/*.whl --dev | |
| uv add ../wheels/uipath-platform/dist/*.whl --dev | |
| uv add ../wheels/uipath/dist/*.whl --dev | |
| - name: Run uipath-langchain tests | |
| working-directory: uipath-langchain-python | |
| run: | | |
| uv sync --all-extras | |
| uv run pytest | |
| discover-testcases: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| needs: [test-uipath-langchain] | |
| outputs: | |
| testcases: ${{ steps.discover.outputs.testcases }} | |
| steps: | |
| - name: Checkout uipath-langchain-python | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: 'UiPath/uipath-langchain-python' | |
| path: 'uipath-langchain-python' | |
| - name: Discover testcases | |
| id: discover | |
| working-directory: uipath-langchain-python | |
| run: | | |
| # Find all testcase folders (excluding common folders like README, etc.) | |
| testcase_dirs=$(find testcases -maxdepth 1 -type d -name "*-*" | sed 's|testcases/||' | sort) | |
| echo "Found testcase directories:" | |
| echo "$testcase_dirs" | |
| # Convert to JSON array for matrix | |
| testcases_json=$(echo "$testcase_dirs" | jq -R -s -c 'split("\n")[:-1]') | |
| echo "testcases=$testcases_json" >> $GITHUB_OUTPUT | |
| run-uipath-langchain-integration-tests: | |
| runs-on: ubuntu-latest | |
| needs: [build-wheels, discover-testcases] | |
| container: | |
| image: ghcr.io/astral-sh/uv:python3.12-bookworm | |
| env: | |
| UIPATH_JOB_KEY: "3a03d5cb-fa21-4021-894d-a8e2eda0afe0" | |
| UIPATH_TRACING_ENABLED: false | |
| permissions: | |
| contents: read | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| testcase: ${{ fromJson(needs.discover-testcases.outputs.testcases) }} | |
| environment: [alpha, staging] # temporary disable [cloud] | |
| use_azure_chat: [true, false] | |
| name: "${{ matrix.testcase }} / ${{ matrix.environment }} / ${{ matrix.use_azure_chat && 'UiPathAzureChatOpenAI' || 'UiPathChat' }}" | |
| steps: | |
| - name: Download wheels | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: uipath-wheels | |
| path: wheels | |
| - name: Checkout uipath-langchain-python | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: 'UiPath/uipath-langchain-python' | |
| path: 'uipath-langchain-python' | |
| - name: Update uipath packages | |
| shell: bash | |
| working-directory: uipath-langchain-python | |
| run: | | |
| uv add ../wheels/uipath-core/dist/*.whl | |
| uv add ../wheels/uipath-platform/dist/*.whl | |
| uv add ../wheels/uipath/dist/*.whl | |
| - name: Install dependencies | |
| working-directory: uipath-langchain-python | |
| run: uv sync | |
| - name: Run testcase | |
| env: | |
| 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 }} | |
| 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 }} | |
| BASE_URL: ${{ matrix.environment == 'alpha' && secrets.ALPHA_BASE_URL || matrix.environment == 'staging' && secrets.STAGING_BASE_URL || matrix.environment == 'cloud' && secrets.CLOUD_BASE_URL }} | |
| USE_AZURE_CHAT: ${{ matrix.use_azure_chat }} | |
| UV_PYTHON: "3.12" | |
| working-directory: uipath-langchain-python/testcases/${{ matrix.testcase }} | |
| run: | | |
| echo "Running testcase: ${{ matrix.testcase }}" | |
| echo "Environment: ${{ matrix.environment }}" | |
| echo "LLM: ${{ matrix.use_azure_chat && 'UiPathAzureChatOpenAI' || 'UiPathChat' }}" | |
| echo "USE_AZURE_CHAT: ${{ matrix.use_azure_chat }}" | |
| # Execute the testcase run script directly | |
| bash run.sh | |
| bash ../common/validate_output.sh | |
| notify-on-failure: | |
| needs: [test-uipath-langchain, run-uipath-langchain-integration-tests] | |
| if: always() && contains(github.event.pull_request.labels.*.name, 'test:uipath-langchain') && (needs.test-uipath-langchain.result == 'failure' || needs.run-uipath-langchain-integration-tests.result == 'failure') | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pull-requests: write | |
| steps: | |
| - name: Comment on PR | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const marker = '<!-- cross-test-failure:uipath-langchain -->'; | |
| const runUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`; | |
| const body = [ | |
| marker, | |
| '## :rotating_light: **Heads up: `uipath-langchain` cross-tests are FAILING** :rotating_light:', | |
| '', | |
| 'Your changes may break the **[`uipath-langchain-python`](https://github.com/UiPath/uipath-langchain-python)** integration.', | |
| '', | |
| '> :warning: **These checks are NOT enforced by branch protection rules.** Please review the failures before merging.', | |
| '', | |
| `**:mag: [Inspect the failed run →](${runUrl})**`, | |
| ].join('\n'); | |
| // Delete any prior failure comments for this workflow so the new | |
| // one always lands at the bottom of the PR conversation. | |
| const { data: comments } = await github.rest.issues.listComments({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number, | |
| }); | |
| for (const c of comments) { | |
| if (c.body && c.body.includes(marker)) { | |
| await github.rest.issues.deleteComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| comment_id: c.id, | |
| }); | |
| } | |
| } | |
| await github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: context.issue.number, | |
| body, | |
| }); |