存储测试结果豁免的引擎。
项目描述
WaiverDB
什么是WaiverDB
WaiverDB是ResultsDB的配套服务,用于记录针对测试结果的豁免。
快速开发设置
设置开发环境最快的方法是安装docker-compose或podman-compose,并使用make up
来配置所需的容器,并使用make test
来运行测试或使用make coverage
来生成和打开覆盖率报告。
作为使用容器的替代方案,以下是本地机器上设置开发环境的步骤。
安装依赖项
$ sudo dnf builddep waiverdb.spec
在本地机器上配置Postgres,创建一个名为waiverdb
的数据库
$ 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
的Postgres数据库。默认情况下,它期望在本地机器上对Postgres有超级用户权限。
要针对所有支持的Python版本进行测试,您可以使用tox:
$ sudo dnf install python3-tox
$ tox
构建文档
您可以使用以下命令在本地查看文档:
$ cd docs
$ make html
$ firefox _build/html/index.html
查看已发布的fedmsgs
您可以通过以下方式查看创建新waiver时发布的fedmsgs:
$ fedmsg-relay --config-filename fedmsg.d/config.py &
$ fedmsg-tail --config fedmsg.d/config.py --no-validate --really-pretty
WaiverDB CLI
WaiverDB具有用于针对测试结果创建新waiver的命令行客户端界面。一个示例配置已安装为/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.
项目详情
waiverdb-1.4.0.tar.gz的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 15eab2f1a17775c23adaaa67e9a026d0e2eda417addba47b3020815a5657576e |
|
MD5 | c837cdaad00f119fb32e12dc88181ee1 |
|
BLAKE2b-256 | 5aa548a67a8e970060debc338e5cc7e9533726b027574563c37b0330f19c204a |