File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020
2121 test :
2222 uses : ./.github/workflows/test.yml
23+ secrets :
24+ 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 :
3134 run : uv sync --all-extras
3235
3336 - name : Run tests
37+ if : " !(matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13')"
3438 run : uv run pytest
3539
40+ - name : Run tests with coverage
41+ if : matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13'
42+ run : uv run pytest --cov-report=xml --cov-report=html --tb=short
43+
44+ - name : Upload coverage HTML report
45+ if : matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13' && always()
46+ uses : actions/upload-artifact@v4
47+ with :
48+ name : coverage-html-report
49+ path : htmlcov/
50+ retention-days : 30
51+
52+ - name : Upload coverage XML report
53+ if : matrix.os == 'ubuntu-latest' && matrix.python-version == '3.13' && always()
54+ uses : actions/upload-artifact@v4
55+ with :
56+ name : coverage-xml-report
57+ path : coverage.xml
58+ retention-days : 30
59+
3660 continue-on-error : true
3761
62+ sonarcloud :
63+ name : SonarCloud
64+ needs : test
65+ runs-on : ubuntu-latest
66+ if : always() && needs.test.result != 'failure'
67+ permissions :
68+ contents : read
69+ steps :
70+ - name : Checkout
71+ uses : actions/checkout@v4
72+ with :
73+ fetch-depth : 0
74+
75+ - name : Download coverage
76+ uses : actions/download-artifact@v4
77+ continue-on-error : true
78+ with :
79+ name : coverage-xml-report
80+
81+ - name : SonarCloud Scan
82+ uses : SonarSource/sonarqube-scan-action@2f77a1ec69fb1d595b06f35ab27e97605bdef703 # v5
83+ env :
84+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
Original file line number Diff line number Diff line change @@ -95,11 +95,26 @@ addopts = "-ra -q --cov=src/uipath --cov-report=term-missing"
9595asyncio_default_fixture_loop_scope = " function"
9696asyncio_mode = " auto"
9797
98+ [tool .coverage .run ]
99+ source = [" src/uipath" ]
100+ relative_files = true
101+ omit = [
102+ " */tests/*" ,
103+ " */__pycache__/*" ,
104+ " */site-packages/*" ,
105+ " */conftest.py" ,
106+ ]
107+
98108[tool .coverage .report ]
99109show_missing = true
100-
101- [tool .coverage .run ]
102- source = [" src" ]
110+ precision = 2
111+ exclude_lines = [
112+ " pragma: no cover" ,
113+ " def __repr__" ,
114+ " raise NotImplementedError" ,
115+ " if TYPE_CHECKING:" ,
116+ " @(abc\\ .)?abstractmethod" ,
117+ ]
103118
104119[[tool .uv .index ]]
105120name = " testpypi"
Original file line number Diff line number Diff line change 1+ sonar.projectKey =UiPath_uipath-runtime-python
2+ sonar.organization =ui
3+ sonar.host.url =https://sonarcloud.io
4+
5+ sonar.sources =src/uipath
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