Add testcase_stats role to publish testcase_stats HTML on openQA

As with fedora_nightlies, I'm offloading this from my personal
domain. Happily this one doesn't need a consumer, it just runs
hourly. Again we just dump the output in openQA's public dir.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
Adam Williamson 2020-11-21 18:58:08 -08:00
parent f12e26a781
commit c678f1caf6
5 changed files with 27 additions and 1 deletions

View file

@ -0,0 +1 @@
testcase_stats_output_dir: /usr/share/openqa/public/testcase_stats

View file

@ -570,6 +570,9 @@ openqa01.iad2.fedoraproject.org
[fedora_nightlies]
openqa01.iad2.fedoraproject.org
[testcase_stats]
openqa01.iad2.fedoraproject.org
[resultsdb:children]
resultsdb_stg
resultsdb_prod

View file

@ -212,13 +212,14 @@
# relvalconsumer isn't particularly related to openQA in any way, we
# just put that role on these boxes. There's nowhere more obviously
# correct for it, really. Ditto fedora_nightlies
# correct for it, really. Ditto fedora_nightlies and testcase_stats
roles:
- { role: openqa/server, tags: ['openqa_server'] }
- { role: openqa/dispatcher, tags: ['openqa_dispatcher'] }
- { role: check-compose, tags: ['check-compose'], when: "checkcompose_env_suffix is defined" }
- { role: relvalconsumer, tags: ['relvalconsumer'], when: "relvalconsumer_env_suffix is defined" }
- { role: fedora_nightlies, tags: ['fedora_nightlies'], when: "fedora_nightlies_amqp_queue is defined" }
- { role: testcase_stats, tags: ['testcase_stats'], when: "testcase_stats_output_dir is defined" }
handlers:
- import_tasks: "{{ handlers_path }}/restart_services.yml"

View file

@ -0,0 +1,17 @@
# This role installs relval (if needed) and deploys a cron drop-in to
# run `relval testcase-stats` for the next Fedora release once an hour
# and dump the output to a configured location.
# Required vars
# - testcase_stats_output_dir
## string - Directory where the output should be written.
- name: Install required packages
package:
name: relval
state: present
tags:
- packages
- name: Deploy the cronjob
template: src=testcase_stats.cron dest=/etc/cron.hourly/testcase_stats owner=root group=root mode=0755

View file

@ -0,0 +1,4 @@
#!/bin/sh
relval testcase-stats --release {{ FedoraCycleNumber|int + 1 }} --out {{ testcase_stats_output_dir }}/{{ FedoraCycleNumber|int + 1 }} > /dev/null 2>&1
chmod 0755 {{ testcase_stats_output_dir }}/{{ FedoraCycleNumber|int + 1 }}
restorecon -r {{ testcase_stats_output_dir }}/{{ FedoraCycleNumber|int + 1 }}