用于存储对测试结果的弃权的引擎。
waiverdb的Python项目详细描述
放弃RDB
什么是弃权
弃权是 ResultsDB,用于记录弃权 对照测试结果。
快速开发设置
安装依赖项:
$ sudo dnf builddep waiverdb.spec
使用waiverdb
数据库在本地计算机上配置postgres:
$ sudo dnf install postgresql-server
$ sudo postgresql-setup --initdb
$ sudo systemctl enable --now postgresql
$ sudo -u postgres createuser --superuser $USER
$ createdb waiverdb
创建本地配置文件:
$ cp conf/settings.py.example conf/settings.py
填充数据库:
$ PYTHONPATH=. DEV=true python3 waiverdb/manage.py db upgrade
运行服务器:
$ PYTHONPATH=. DEV=true python3 waiverdb/manage.py run -h localhost -p 5004 --debugger
服务器现在在http://localhost:5004运行,api调用可以发送到
http://localhost:5004/api/v1.0。所有数据都存储在waiverdb
postgres中
本地计算机上的数据库。您可以验证服务器是否正常运行
通过访问http://localhost:5004/api/v1.0/about。
调整配置
您可以通过将conf/settings.py.example
复制到
conf/settings.py
并根据需要调整值。它覆盖默认值
waiverdb/config.py
中的值。
运行测试套件
您可以使用以下命令运行此测试套件:
$ py.test-3 tests/
测试套件将删除并重新创建一个名为
waiverdb_test
。默认情况下,它希望超级用户可以在
本地机器。
要测试所有受支持的python版本,可以使用tox::
$ sudo dnf install python3-tox
$ tox
生成文档
您可以使用以下命令在本地查看文档:
$ cd docs
$ make html
$ firefox _build/html/index.html
查看已发布的fedmsg
通过执行以下操作,可以查看创建新豁免时发布的FEDMSG:
$ fedmsg-relay --config-filename fedmsg.d/config.py &
$ fedmsg-tail --config fedmsg.d/config.py --no-validate --really-pretty
弃权声明
弃权数据库有一个命令行客户端接口,用于创建针对测试的新弃权
结果。示例配置安装为/usr/share/doc/waiverdb/client.conf.example
。
复制到/etc/waiverdb/client.conf
并在那里编辑。或者您可以使用--config-file
指定一个。
Usage: waiverdb-cli [OPTIONS]
Creates new waivers against test results.
Examples:
waiverdb-cli -r 47 -r 48 -p "fedora-28" -c "This is fine"
or
waiverdb-cli -t dist.rpmdeplint -s '{"item": "qclib-1.3.1-3.fc28", "type": "koji_build"}' -p "fedora-28" -c "This is expected for non-x86 packages"
Options:
-C, --config-file PATH Specify a config file to use.
-r, --result-id INTEGER Specify one or more results to be waived.
-s, --subject TEXT Deprecated. Use --subject-identifier and
--subject-type instead. Subject for a result to waive.
-i, --subject-identifier TEXT Subject identifier for a result to waive.
-T, --subject-type TEXT Subject type for a result to waive.
-t, --testcase TEXT Specify a testcase for the subject.
-p, --product-version TEXT Specify one of PDC's product version
identifiers.
--waived / --no-waived Whether or not the result is waived.
-c, --comment TEXT A comment explaining why the result is waived.
-h, --help Show this message and exit.