Skip to content
This repository has been archived by the owner on Apr 30, 2020. It is now read-only.

Commit

Permalink
report tested arches
Browse files Browse the repository at this point in the history
When creating the ResultsYaml format, later to be reported to ResultsDB,
list all the architectures that have been tested by this test run. This
allows people+systems to see what was tested and what was not, and
allows to query whether a specific architecture has a result or not.
  • Loading branch information
kparal authored and hroncok committed May 28, 2018
1 parent 82db17a commit 1081859
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ __pycache__
.cache
*.egg-info
tests.retry
/.pytest_cache/
17 changes: 11 additions & 6 deletions python_versions_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@


def run(koji_build, workdir='.', artifactsdir='artifacts',
testcase='dist.python-versions'):
testcase='dist.python-versions', arches=['x86_64', 'noarch', 'src']):
'''The main method to run from Taskotron'''
workdir = os.path.abspath(workdir)
results_path = os.path.join(artifactsdir, 'taskotron', 'results.yml')
Expand Down Expand Up @@ -75,10 +75,11 @@ def run(koji_build, workdir='.', artifactsdir='artifacts',
srpm_packages + packages, koji_build, artifact))
details.append(task_python_usage(logs, koji_build, artifact))

# update testcase for all subtasks (use their existing testcase as a
# suffix)
for detail in details:
# update testcase for all subtasks (use their existing testcase as a
# suffix)
detail.checkname = '{}.{}'.format(testcase, detail.checkname)
detail.keyvals['arch'] = arches

# finally, the main detail with overall results
outcome = 'PASSED'
Expand All @@ -89,12 +90,14 @@ def run(koji_build, workdir='.', artifactsdir='artifacts',
overall_detail = check.CheckDetail(checkname=testcase,
item=koji_build,
report_type=check.ReportType.KOJI_BUILD,
outcome=outcome)
outcome=outcome,
keyvals={'arch': arches})
if outcome == 'FAILED':
overall_detail.artifact = artifact
details.append(overall_detail)

summary = 'python-versions {} for {}.'.format(outcome, koji_build)
summary = 'python-versions {} for {} ({}).'.format(
outcome, koji_build, ', '.join(arches))
log.info(summary)

# generate output reportable to ResultsDB
Expand All @@ -106,8 +109,10 @@ def run(koji_build, workdir='.', artifactsdir='artifacts',


if __name__ == '__main__':
arches = sys.argv[5].split(',')
rc = run(koji_build=sys.argv[1],
workdir=sys.argv[2],
artifactsdir=sys.argv[3],
testcase=sys.argv[4])
testcase=sys.argv[4],
arches=arches)
sys.exit(rc)
12 changes: 6 additions & 6 deletions tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,25 +51,25 @@
debug:
var: workdir.path

- name: Compute architectures to download
- name: Compute architectures to test
set_fact:
download_arches: "{{ taskotron_supported_arches | join(',') }}"
test_arches: "{{ taskotron_supported_arches }} + ['noarch', 'src']"

- name: Print architectures to download
- name: Print architectures to test
debug:
var: download_arches
var: test_arches

- block:
- name: Download RPMs from Koji
shell: >
python2 download_rpms.py {{ taskotron_item }} {{ workdir.path }}
{{ download_arches }}
{{ test_arches | join(',') }}
&> {{ artifacts }}/test.log
- name: Run task
shell: >
python2 python_versions_check.py {{ taskotron_item }} {{ workdir.path }}
{{ artifacts }} {{ testcase }}
{{ artifacts }} {{ testcase }} {{ test_arches | join(',') }}
&>> {{ artifacts }}/test.log
always:
- name: Print results location
Expand Down

0 comments on commit 1081859

Please sign in to comment.