File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2323
2424 test :
2525 uses : ./.github/workflows/test.yml
26+ secrets :
27+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
Original file line number Diff line number Diff line change 11name : Test
22
33on :
4- workflow_call
4+ workflow_call :
5+ secrets :
6+ SONAR_TOKEN :
7+ required : false
58
69jobs :
710 test :
3235 run : uv sync --all-extras
3336
3437 - name : Run tests
38+ if : " !(matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13')"
3539 run : uv run pytest
3640
41+ - name : Run tests with coverage
42+ if : matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13'
43+ run : uv run pytest --cov=src/uipath_mcp --cov-report=xml --cov-report=html --tb=short
44+
45+ - name : Upload coverage HTML report
46+ if : matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13' && always()
47+ uses : actions/upload-artifact@v4
48+ with :
49+ name : coverage-html-report
50+ path : htmlcov/
51+ retention-days : 30
52+
53+ - name : Upload coverage XML report
54+ if : matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13' && always()
55+ uses : actions/upload-artifact@v4
56+ with :
57+ name : coverage-xml-report
58+ path : coverage.xml
59+ retention-days : 30
60+
3761 continue-on-error : true
62+
63+ sonarcloud :
64+ name : SonarCloud
65+ needs : test
66+ runs-on : ubuntu-latest
67+ if : always() && needs.test.result != 'failure'
68+ permissions :
69+ contents : read
70+ steps :
71+ - name : Checkout
72+ uses : actions/checkout@v4
73+ with :
74+ fetch-depth : 0
75+
76+ - name : Download coverage
77+ uses : actions/download-artifact@v4
78+ continue-on-error : true
79+ with :
80+ name : coverage-xml-report
81+
82+ - name : SonarCloud Scan
83+ uses : SonarSource/sonarqube-scan-action@2f77a1ec69fb1d595b06f35ab27e97605bdef703 # v5
84+ env :
85+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
Original file line number Diff line number Diff line change @@ -88,6 +88,27 @@ python_files = "test_*.py"
8888addopts = " -ra -q"
8989asyncio_mode = " auto"
9090
91+ [tool .coverage .run ]
92+ source = [" src/uipath_mcp" ]
93+ relative_files = true
94+ omit = [
95+ " */tests/*" ,
96+ " */__pycache__/*" ,
97+ " */site-packages/*" ,
98+ " */conftest.py" ,
99+ ]
100+
101+ [tool .coverage .report ]
102+ show_missing = true
103+ precision = 2
104+ exclude_lines = [
105+ " pragma: no cover" ,
106+ " def __repr__" ,
107+ " raise NotImplementedError" ,
108+ " if TYPE_CHECKING:" ,
109+ " @(abc\\ .)?abstractmethod" ,
110+ ]
111+
91112[[tool .uv .index ]]
92113name = " testpypi"
93114url = " https://test.pypi.org/simple/"
Original file line number Diff line number Diff line change 1+ sonar.projectKey =UiPath_uipath-mcp-python
2+ sonar.organization =ui
3+ sonar.host.url =https://sonarcloud.io
4+
5+ sonar.sources =src/uipath_mcp
6+ sonar.tests =tests
7+
8+ sonar.python.version =3.11,3.12,3.13
9+ sonar.python.coverage.reportPaths =coverage.xml
10+
11+ sonar.exclusions =**/samples/**,**/testcases/**
12+
13+ sonar.sourceEncoding =UTF-8
You can’t perform that action at this time.
0 commit comments