python-3.x - 如何修复以下警告:`WARN: The resource for '' is not found, 无法深入了解此测试的详细信息。`
问题描述
我的删节sonar-project.properties
文件如下:
# Sources
sonar.sources=felix
sonar.sources.inclusions=**/**.py
sonar.exclusions=**/test_*.py,**/**.pyc,felix/utils/*,**/*.iml
# Linter
sonar.python.pylint=/usr/local/bin/pylint
sonar.python.pylint_config=.pylintrc
sonar.python.pylint.reportPath=pylint-report.txt
# Coverage / Unit Tests
sonar.tests=./tests
sonar.test.inclusions=**/test_**.py
sonar.python.xunit.skipDetails=false
#DEFAULT VALUES: sonar.python.xunit.reportPath=xunit-reports/xunit-result-*.xml
#DEFAULT VALUES: sonar.python.coverage.reportPath=coverage-reports/*coverage-*.xml
删减的源代码树是这样的:
├── felix
│ ├── __init__.py
│ ├── __pycache__
│ │ ├── __init__.cpython-35.pyc
│ │ ├── process.cpython-35.pyc
│ │ └── spark.cpython-35.pyc
│ ├── felix.iml
│ ├── process.py
│ ├── spark.py
│ └── utils
│ └── utils.py
├── requirements.txt
├── setup.py
├── sonar-project.properties
├── tests
│ ├── __init__.py
│ ├── __pycache__
│ │ ├── __init__.cpython-35.pyc
│ │ └── test_process.cpython-35-PYTEST.pyc
│ ├── cia-spark.iml
│ ├── data
│ └── test_process.py
└── tox.ini
但是,当我运行时,我收到以下警告sonar-scanner
:WARN: The resource for '' is not found, drilling down to the details of this test won't be possible
请有人告诉我为什么我会收到此警告以及如何摆脱/修复它?谢谢。
解决方案
我收到此警告是因为我从分析中排除了测试文件。我看到,在您的属性中,您也排除了您的测试:
sonar.exclusions=**/test_*.py,**/**.pyc,felix/utils/*,**/*.iml
这将阻止声纳计算测试数量及其通过/失败状态,如此处的开源所示
推荐阅读
- python - 将权重和偏差转换为稀疏张量 pytorch
- python-3.x - 如何离线安装pyarrow、fastparquet?
- javascript - TypeError:无法读取 React 中未定义的属性“注释”
- c++ - 用纯虚函数绕圈子
- javascript - 绝对新手 - 第一个功能问题
- php - 是什么导致此 Ajax 调用出现 403 -Forbidden 错误
- amazon-web-services - BATS::SAM::CodeS3Bucket 在云形成模板中的作用是什么
- flutter - 减少 Flutter 中 dispose() 的样板文件?
- r - 是否有一个库可以提供更好的决策树图片,或者是否有另一种方法可以让我的决策树在 R 中更易于阅读?
- android - 无法使用 Dagger Hilt `@WorkerInject` 注入 Android WorkManager Worker