编译源码生成wheel包
git clone https://github.com/apache/tsfile.git
cd tsfile
mvn clean install -P with-python -DskipTests # wheel包位于tsfile根目录下/python/dist中
引用wheel包
git clone https://github.com/thulab/python-tsfile-api-test.git
cd python-tsfile-api-test
pip3 install tsfile-*.whl
# 删除旧引用:pip3 uninstall tsfile
cd tests
pytest
# 1、收集要测量覆盖率的源码放到程序根目录的tsfile下
# 2、执行下面命令进行代码覆盖率测试并生成报告文件(已开启分支覆盖)
cd tests
pytest --cov=tsfile --cov-report=html --cov-branch
生成的报告默认位于 ${python-client-api-test}/test/htmlcov/
下的index.html
文件
生成json覆盖率报告:pytest --cov=tsfile --cov-report=json --cov-config=.coveragerc --cov-branch
暂未实现
# 1、覆盖率+自动化
pytest --cov=tsfile --cov-report=html --cov-branch --html=report.html