跳转到主要内容

存储测试结果豁免的引擎。

项目描述

WaiverDB

logo of 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 (143.9 kB 查看哈希值)

上传时间

支持者

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误日志 StatusPage StatusPage 状态页面