跳转到主要内容

从软件质量数据创建人性化的报告

项目描述

squad-report

从软件质量数据创建人性化的报告。

squad 是一个软件质量仪表板。该服务提供存储和公共API。

squad-client 是客户端库。该库从 squad 服务API获取数据。

squad-report 是一个命令行程序,使用 squad-clientsquad 服务获取软件质量数据来创建人性化的报告。

安装

使用 pippypi 安装。

pip install squad-report

配置

用户特定的配置文件位于 ~/.config/squad_report/config.yaml

注意:所有配置值将覆盖命令行选项。

示例配置

config: &config
    sig_name: "Anders Roxell"
    sig_url: "https://lkft.linaro.org"
    email_from: "LKFT <lkft@linaro.org>"
    email_to: "LKFT <lkft@linaro.org>"
    email_subject: "LKFT Test Report"
    reported_tested_by: "Anders Roxell <anders.roxell@linaro.org>"

report:
  - name: report
    << : *config
    email_subject: "testing Stable RC reports"
    template: report
    output: report.txt

示例配置使用方法

$ squad-report \
        --config-report-type=report \
        --group=lkft --project=linux-next-master --build=next-20210223
Report created in report.txt

$ cat report.txt
From: LKFT <lkft@linaro.org>
To: LKFT <lkft@linaro.org>
Cc:
Subject: [REGRESSION] testing Stable RC reports

## Build
* kernel: 5.11.0
* git: ['https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git', 'https://gitlab.com/Linaro/lkft/mirrors/next/linux-next']
* git branch: master
* git commit: 8431fb50e1a7ffe7fcc4da2f798d3100315cee7b
* git describe: next-20210223
* test details: https://qa-reports.linaro.org/lkft/linux-next-master/build/next-20210223

...

Reported-by: Anders Roxell <anders.roxell@linaro.org>

...

--
Anders Roxell
https://lkft.linaro.org

模板

用户特定的模板目录位于 ~/.config/squad_report/templates

如果您想添加自己的模板,需要将它们复制到上面的目录,并命名为 <template>.txt.jinja

电子邮件

您可以在报告中指定要包含的电子邮件标题,以便稍后发送。

电子邮件主题可以是模板化的。例如

build: {{ build.metadata.kernel_version }}/{{ build.version }}

注意:只有指定了电子邮件主题,电子邮件标题才会存在。

示例电子邮件使用

$ squad-report \
        --email-from="lkft@linaro.org" \
        --email-to="lkft@linaro.org"   \
        --email-subject="report for linux-next" \
        --group=lkft --project=linux-next-master --build=next-20210223 \
        --template=report --output=report.txt
Report created in report.txt

$ head -n 15 report.txt
From: lkft@linaro.org
To: lkft@linaro.org
Cc: None
Subject: [REGRESSION] report for linux-next

## Build
* kernel: 5.11.0
* git: ['https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git', 'https://gitlab.com/Linaro/lkft/mirrors/next/linux-next']
* git branch: master
* git commit: 8431fb50e1a7ffe7fcc4da2f798d3100315cee7b
* git describe: next-20210223
* test details: https://qa-reports.linaro.org/lkft/linux-next-master/build/next-20210223

...

示例

squad 项目创建报告

squad-report --group=lkft --project=linux-next-master --build=next-20210223 --template=report-full

创建显示所有环境构建结果的报告

squad-report --group=lkft --project=linux-next-master --build=next-20210223 --suites=build --template=report-full

创建显示 arm64 环境构建结果的报告

squad-report --group=lkft --project=linux-next-master --build=next-20210223 --suites=build --environments=arm64 --template=report-full

创建显示 kselftest 结果的报告

squad-report --group=lkft --project=linux-next-master --build=next-20210223 --suite-prefixes=kselftest --template=report-full

使用 mmtests 为 sysbenchcpu 数据创建性能报告

squad-report --group=~anders.roxell --project=linux-stable-linux-5.10.y --build=v5.10.93
      --base-build=v5.10.90 --environments=x86 --suites=mmtests-sysbenchcpu-tests
      --template=perf-report --perf-report-hook=mmtests --perf-report-hook-args=/path/to/mmtests

用法

usage: squad-report [-h] [--cache CACHE] [--token TOKEN] [--url URL]
       [--group GROUP] [--project PROJECT] [--build BUILD] [--base-build BASE_BUILD]
       [--environments ENVIRONMENTS | --environment-prefixes ENVIRONMENT_PREFIXES]
       [--suites SUITES | --suite-prefixes SUITE_PREFIXES]
       [--email-cc EMAIL_CC] [--email-from EMAIL_FROM] [--email-subject EMAIL_SUBJECT] [--email-to EMAIL_TO]
       [--output OUTPUT] [--send-on SEND_ON] [--template TEMPLATE]
       [--config CONFIG] [--config-report-type CONFIG_REPORT_TYPE]
       [--perf-report-hook SCRIPT] [--perf-report-hook-args ARGS] [--unfinished] [--version]

Create a report using data from SQUAD

optional arguments:
  -h, --help            show this help message and exit
  --cache CACHE         Cache squad-client requests with a timeout
  --token TOKEN         Authenticate to SQUAD using this token
  --url URL             URL of the SQUAD service
  --group GROUP         SQUAD group
  --project PROJECT     SQUAD project
  --build BUILD         SQUAD build
  --base-build BASE_BUILD
                        SQUAD build to compare to
  --environments ENVIRONMENTS
                        List of SQUAD environments to include
  --environment-prefixes ENVIRONMENT_PREFIXES
                        List of prefixes of SQUAD environments to include
  --suites SUITES       List of SQUAD suites to include
  --suite-prefixes SUITE_PREFIXES
                        List of prefixes of SQUAD suites to include
  --email-cc EMAIL_CC   Create the report with email cc
  --email-from EMAIL_FROM
                        Create the report with email from
  --email-subject EMAIL_SUBJECT
                        Create the report with this email subject
  --email-to EMAIL_TO   Create the report with email to
  --output OUTPUT       Write the report to this file
  --send-on SEND_ON     Send on failures, regressions or always.
                        example: FAIL:REG, REG default: ALL
  --template TEMPLATE   Create the report with this template
  --config CONFIG       Create the report using this configuration
  --config-report-type CONFIG_REPORT_TYPE
                        Set the report type to use in the local config file
  --perf-report-hook SCRIPT
                        Set the performance script
  --perf-report-hook-args ARGS
                        Set arguments for the performance script
  --unfinished          Create a report even if a build is not finished
  --version             Print out the version

记录

要启用记录输出,请设置您的环境中的 LOG_LEVEL

最常用的级别是 INFODEBUG

有关更多选项,请参阅 记录级别

贡献

CONTRIBUTING.md

许可

MIT

项目详情


下载文件

下载适合您平台的文件。如果您不确定选择哪个,请了解有关 安装包 的更多信息。

源分发

squad-report-1.9.0.tar.gz (16.0 kB 查看散列)

上传时间

构建分发

squad_report-1.9.0-py3-none-any.whl (18.5 kB 查看散列)

上传时间 Python 3

支持者

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