Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 36 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

permissions:
contents: read
pull-requests: write

steps:
# NOTE: Conditions are duplicated on each step instead of using job-level conditionals
Expand All @@ -41,19 +42,50 @@
if: "!contains(github.event.pull_request.labels.*.name, 'test-core-dev-version')"
uses: actions/setup-python@v5
with:
python-version-file: ".python-version"
python-version: ${{ matrix.python-version }}

- name: Install dependencies
if: "!contains(github.event.pull_request.labels.*.name, 'test-core-dev-version')"
run: uv sync --all-extras
run: uv sync --all-extras --python ${{ matrix.python-version }}

- name: Run tests
if: "!contains(github.event.pull_request.labels.*.name, 'test-core-dev-version')"
if: "!contains(github.event.pull_request.labels.*.name, 'test-core-dev-version') && !(matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13')"
run: uv run pytest
env:
UIPATH_URL: ${{ secrets.UIPATH_URL }}
UIPATH_CLIENT_ID: ${{ secrets.UIPATH_CLIENT_ID }}
UIPATH_CLIENT_SECRET: ${{ secrets.UIPATH_CLIENT_SECRET }}

continue-on-error: true
- name: Run tests with coverage
if: "!contains(github.event.pull_request.labels.*.name, 'test-core-dev-version') && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13'"
run: uv run pytest --cov-report=xml --cov-report=html --tb=short
env:
UIPATH_URL: ${{ secrets.UIPATH_URL }}
UIPATH_CLIENT_ID: ${{ secrets.UIPATH_CLIENT_ID }}
UIPATH_CLIENT_SECRET: ${{ secrets.UIPATH_CLIENT_SECRET }}

- name: Upload coverage HTML report
if: "!contains(github.event.pull_request.labels.*.name, 'test-core-dev-version') && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13' && always()"
uses: actions/upload-artifact@v4
with:
name: coverage-html-report
path: htmlcov/
retention-days: 30

- name: Upload coverage XML report
if: "!contains(github.event.pull_request.labels.*.name, 'test-core-dev-version') && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13' && always()"
uses: actions/upload-artifact@v4
with:
name: coverage-xml-report
path: coverage.xml
retention-days: 30

- name: Coverage PR comment
if: "!contains(github.event.pull_request.labels.*.name, 'test-core-dev-version') && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13' && github.event_name == 'pull_request'"
uses: py-cov-action/python-coverage-comment-action@v3

Check warning

Code scanning / CodeQL

Unpinned tag for a non-immutable Action in workflow Medium test

Unpinned 3rd party Action 'Test' step
Uses Step
uses 'py-cov-action/python-coverage-comment-action' with ref 'v3', not a pinned commit hash
with:
GITHUB_TOKEN: ${{ github.token }}
MINIMUM_GREEN: 90
MINIMUM_ORANGE: 80

continue-on-error: true
23 changes: 22 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,31 @@ disallow_untyped_defs = false
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = "test_*.py"
addopts = "-ra -q"
addopts = "-ra -q --cov=src/uipath_langchain --cov-report=term-missing"
asyncio_default_fixture_loop_scope = "function"
asyncio_mode = "auto"

[tool.coverage.run]
source = ["src/uipath_langchain"]
relative_files = true
omit = [
"*/tests/*",
"*/__pycache__/*",
"*/site-packages/*",
"*/conftest.py",
]

[tool.coverage.report]
show_missing = true
precision = 2
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise NotImplementedError",
"if TYPE_CHECKING:",
"@(abc\\.)?abstractmethod",
]

[[tool.uv.index]]
name = "testpypi"
url = "https://test.pypi.org/simple/"
Expand Down
Loading