Merge pull request #1767 from coolo/fix_check_command
Support OBS checks instead of openqa
This commit is contained in:
commit
7014285550
@ -73,14 +73,15 @@ class CheckCommand(object):
|
||||
break
|
||||
|
||||
# openQA results
|
||||
if self.api.copenqa:
|
||||
if not project['openqa_jobs']:
|
||||
report.append(' - No openQA result yet')
|
||||
for job in project['openqa_jobs']:
|
||||
if job['result'] != 'passed':
|
||||
qa_result = job['result'] if job['result'] != 'none' else 'running'
|
||||
report.append(" - openQA's overall status is %s for %s/tests/%s" % (qa_result, self.api.copenqa, job['id']))
|
||||
report.extend(' %s: fail' % module['name'] for module in job['modules'] if module['result'] == 'fail')
|
||||
for check in project.get('missing_checks', []):
|
||||
report.append(' - Missing check: ' + check)
|
||||
|
||||
for check in project.get('checks', []):
|
||||
if check['state'] != 'success':
|
||||
info = " - %s check: %s" % (check['state'], check['name'])
|
||||
if check['url']:
|
||||
info += " " + check['url']
|
||||
report.append(info)
|
||||
break
|
||||
|
||||
if project['overall_state'] == 'acceptable':
|
||||
|
@ -228,6 +228,8 @@ class StagingAPI(object):
|
||||
packages_staged = {}
|
||||
for prj in self.get_staging_projects():
|
||||
status = self.project_status(prj, True)
|
||||
if not status:
|
||||
continue
|
||||
meta = self.load_prj_pseudometa(status['description'])
|
||||
for req in meta['requests']:
|
||||
packages_staged[req['package']] = {'prj': prj, 'rq_id': req['id']}
|
||||
|
@ -7,36 +7,103 @@ from osclib.check_command import CheckCommand
|
||||
from osclib.stagingapi import StagingAPI
|
||||
|
||||
FULL_REPORT = """
|
||||
++ Acceptable staging project openSUSE:Factory:Staging:A
|
||||
|
||||
++ Acceptable staging project openSUSE:Factory:Staging:C
|
||||
|
||||
-- REVIEW Project openSUSE:Factory:Staging:F still needs attention
|
||||
- yast2-iscsi-client: Missing reviews: factory-repo-checker
|
||||
|
||||
-- REVIEW Project openSUSE:Factory:Staging:G still needs attention
|
||||
- Mesa: Missing reviews: opensuse-review-team
|
||||
|
||||
-- BUILDING Project openSUSE:Factory:Staging:H still needs attention
|
||||
- kiwi: Missing reviews: opensuse-review-team
|
||||
-- BUILDING Project openSUSE:Factory:Staging:A still needs attention
|
||||
- pcre: Missing reviews: repo-checker
|
||||
- At least following repositories are still building:
|
||||
standard/i586: building
|
||||
- openQA's overall status is failed for https://openqa.opensuse.org/tests/10660
|
||||
first_boot: fail
|
||||
- Following packages are broken:
|
||||
installation-images:Kubic (standard): failed
|
||||
|
||||
-- REVIEW Project openSUSE:Factory:Staging:J still needs attention
|
||||
- jeuclid: Missing reviews: factory-repo-checker
|
||||
-- TESTING Project openSUSE:Factory:Staging:B still needs attention
|
||||
- perl-File-Copy-Recursive: Missing reviews: repo-checker
|
||||
- Missing check: openqa:cryptlvm
|
||||
|
||||
-- BUILDING Project openSUSE:Factory:Staging:C still needs attention
|
||||
- perl: Missing reviews: repo-checker
|
||||
- At least following repositories are still building:
|
||||
standard/i586: building
|
||||
- Missing check: openqa:cryptlvm
|
||||
|
||||
-- FAILED Project openSUSE:Factory:Staging:D still needs attention
|
||||
- failure check: openqa:textmode https://openqa.opensuse.org/tests/790715#step/partitioning/2
|
||||
|
||||
++ Acceptable staging project openSUSE:Factory:Staging:E
|
||||
|
||||
-- FAILED Project openSUSE:Factory:Staging:F still needs attention
|
||||
- python-ceilometerclient: Missing reviews: repo-checker
|
||||
- Following packages are broken:
|
||||
dleyna-server (standard): unresolvable
|
||||
- pending check: openqa:textmode https://openqa.opensuse.org/tests/790912
|
||||
|
||||
-- UNACCEPTABLE Project openSUSE:Factory:Staging:adi:16 still needs attention
|
||||
- postfixadmin: declined
|
||||
- postfixadmin: Missing reviews: repo-checker
|
||||
|
||||
-- UNACCEPTABLE Project openSUSE:Factory:Staging:adi:17 still needs attention
|
||||
- cf-cli: declined
|
||||
- Following packages are broken:
|
||||
cf-cli:test (standard): failed
|
||||
|
||||
-- FAILED Project openSUSE:Factory:Staging:adi:35 still needs attention
|
||||
- checkpolicy: Missing reviews: repo-checker
|
||||
- Following packages are broken:
|
||||
checkpolicy (standard): unresolvable
|
||||
|
||||
-- FAILED Project openSUSE:Factory:Staging:adi:36 still needs attention
|
||||
- python-QtPy: Missing reviews: opensuse-review-team
|
||||
- Following packages are broken:
|
||||
python-QtPy (standard): failed
|
||||
|
||||
-- FAILED Project openSUSE:Factory:Staging:adi:38 still needs attention
|
||||
- lmms: Missing reviews: repo-checker
|
||||
- Following packages are broken:
|
||||
lmms (standard): unresolvable
|
||||
|
||||
-- FAILED Project openSUSE:Factory:Staging:adi:39 still needs attention
|
||||
- Following packages are broken:
|
||||
ocaml-extlib (standard): unresolvable
|
||||
|
||||
-- FAILED Project openSUSE:Factory:Staging:adi:40 still needs attention
|
||||
- apache2-mod_auth_openidc: Missing reviews: repo-checker
|
||||
- Following packages are broken:
|
||||
apache2-mod_auth_openidc (standard): unresolvable
|
||||
|
||||
-- FAILED Project openSUSE:Factory:Staging:adi:44 still needs attention
|
||||
- Following packages are broken:
|
||||
nut (standard): failed
|
||||
|
||||
-- FAILED Project openSUSE:Factory:Staging:adi:5 still needs attention
|
||||
- verilator: Missing reviews: opensuse-review-team
|
||||
- Following packages are broken:
|
||||
verilator (standard): unresolvable
|
||||
|
||||
-- FAILED Project openSUSE:Factory:Staging:adi:56 still needs attention
|
||||
- Following packages are broken:
|
||||
firehol (standard): unresolvable
|
||||
|
||||
-- UNACCEPTABLE Project openSUSE:Factory:Staging:adi:62 still needs attention
|
||||
- rubygem-passenger: declined
|
||||
- rubygem-passenger: Missing reviews: opensuse-review-team
|
||||
- Following packages are broken:
|
||||
rubygem-passenger (standard): failed
|
||||
|
||||
-- UNACCEPTABLE Project openSUSE:Factory:Staging:adi:65 still needs attention
|
||||
- python-easypysmb: declined
|
||||
- python-easypysmb: Missing reviews: opensuse-review-team
|
||||
|
||||
-- FAILED Project openSUSE:Factory:Staging:adi:67 still needs attention
|
||||
- cargo-vendor: Missing reviews: repo-checker
|
||||
- Following packages are broken:
|
||||
cargo-vendor (standard): unresolvable
|
||||
|
||||
-- UNACCEPTABLE Project openSUSE:Factory:Staging:adi:7 still needs attention
|
||||
- osslsigncode: declined
|
||||
- x86info: Missing reviews: opensuse-review-team
|
||||
"""
|
||||
|
||||
H_REPORT = """
|
||||
-- BUILDING Project openSUSE:Factory:Staging:H still needs attention
|
||||
- kiwi: Missing reviews: opensuse-review-team
|
||||
- At least following repositories are still building:
|
||||
standard/i586: scheduling
|
||||
standard/x86_64: building
|
||||
images/x86_64: blocked
|
||||
- openQA's overall status is failed for https://openqa.opensuse.org/tests/10660
|
||||
livecdreboot: fail
|
||||
-- FAILED Project openSUSE:Factory:Staging:H still needs attention
|
||||
- failure check: openqa:textmode https://openqa.opensuse.org/tests/790715#step/partitioning/2
|
||||
"""
|
||||
|
||||
|
||||
@ -54,9 +121,10 @@ class TestCheckCommand(unittest.TestCase):
|
||||
def test_check_command_all(self):
|
||||
"""Validate json conversion for all projects."""
|
||||
report = self.checkcommand._check_project()
|
||||
self.assertEqual('\n'.join(report).strip(), FULL_REPORT.strip())
|
||||
self.maxDiff = 20000
|
||||
self.assertMultiLineEqual('\n'.join(report).strip(), FULL_REPORT.strip())
|
||||
|
||||
def test_check_command_single(self):
|
||||
"""Validate json conversion for a single project."""
|
||||
report = self.checkcommand._check_project('H')
|
||||
self.assertEqual('\n'.join(report).strip(), H_REPORT.strip())
|
||||
self.assertMultiLineEqual('\n'.join(report).strip(), H_REPORT.strip())
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,107 +1,143 @@
|
||||
{
|
||||
"overall_state": "building",
|
||||
"broken_packages": [],
|
||||
"building_repositories": [
|
||||
"selected_requests" : [
|
||||
{
|
||||
"arch": "i586",
|
||||
"code": "scheduling",
|
||||
"dirty": "true",
|
||||
"repository": "standard",
|
||||
"state": "scheduling"
|
||||
},
|
||||
{
|
||||
"arch": "x86_64",
|
||||
"code": "building",
|
||||
"dirty": "true",
|
||||
"repository": "standard",
|
||||
"state": "building"
|
||||
},
|
||||
{
|
||||
"arch": "x86_64",
|
||||
"code": "blocked",
|
||||
"repository": "images",
|
||||
"state": "blocked"
|
||||
"superseded_by" : null,
|
||||
"package" : "kernel-source",
|
||||
"project" : "openSUSE:Factory",
|
||||
"state" : "review",
|
||||
"approver" : null,
|
||||
"description" : "4.19 (let's not supersede 4.18.16 to have this pending as I assume there will be some problems in staging again)",
|
||||
"id" : 1152735,
|
||||
"updated_at" : "2018-11-02T04:26:34.024Z",
|
||||
"request_type" : "submit",
|
||||
"superseded_by_id" : null,
|
||||
"priority" : "moderate",
|
||||
"accept_at" : null,
|
||||
"creator" : "jirislaby",
|
||||
"number" : 643881,
|
||||
"created_at" : "2018-10-23T06:31:44.000Z",
|
||||
"updated_when" : "2018-11-02T04:26:34.024Z"
|
||||
}
|
||||
],
|
||||
"description": "requests:\n- {id: 234999, package: kdebase4-openSUSE}\n- {id: 235422, package: yast2-network}\n- {id: 235482, package: libmtp}\n- {id: 235495, package: yast2-kdump}\n- {id: 235524, package: kdebase4-workspace}\n- {id: 235547, package: kiwi}\n",
|
||||
"missing_reviews": [
|
||||
"obsolete_requests" : [],
|
||||
"broken_packages" : [],
|
||||
"missing_checks" : [],
|
||||
"name" : "openSUSE:Factory:Staging:H",
|
||||
"checks" : [
|
||||
{
|
||||
"by": "opensuse-review-team",
|
||||
"id": 253740,
|
||||
"package": "kiwi",
|
||||
"request": 235547,
|
||||
"state": "new"
|
||||
"short_description" : null,
|
||||
"name" : "openqa:minimalx@64bit",
|
||||
"updated_at" : "2018-11-09T13:47:06.000Z",
|
||||
"state" : "success",
|
||||
"id" : 3906,
|
||||
"created_at" : "2018-11-09T12:53:23.000Z",
|
||||
"status_reports_id" : 411,
|
||||
"url" : "https://openqa.opensuse.org/tests/790707"
|
||||
},
|
||||
{
|
||||
"state" : "success",
|
||||
"id" : 3909,
|
||||
"updated_at" : "2018-11-09T12:56:00.000Z",
|
||||
"status_reports_id" : 411,
|
||||
"url" : "https://openqa.opensuse.org/tests/790708",
|
||||
"created_at" : "2018-11-09T12:53:23.000Z",
|
||||
"short_description" : null,
|
||||
"name" : "openqa:rescue_system"
|
||||
},
|
||||
{
|
||||
"short_description" : null,
|
||||
"name" : "openqa:minimalx@uefi-staging",
|
||||
"created_at" : "2018-11-09T12:53:23.000Z",
|
||||
"status_reports_id" : 411,
|
||||
"url" : "https://openqa.opensuse.org/tests/790709",
|
||||
"updated_at" : "2018-11-09T13:47:31.000Z",
|
||||
"state" : "success",
|
||||
"id" : 3912
|
||||
},
|
||||
{
|
||||
"short_description" : null,
|
||||
"name" : "openqa:RAID0",
|
||||
"status_reports_id" : 411,
|
||||
"url" : "https://openqa.opensuse.org/tests/790710",
|
||||
"created_at" : "2018-11-09T12:53:23.000Z",
|
||||
"state" : "success",
|
||||
"id" : 3915,
|
||||
"updated_at" : "2018-11-09T13:32:09.000Z"
|
||||
},
|
||||
{
|
||||
"updated_at" : "2018-11-09T13:51:17.000Z",
|
||||
"state" : "success",
|
||||
"id" : 3918,
|
||||
"created_at" : "2018-11-09T12:53:24.000Z",
|
||||
"status_reports_id" : 411,
|
||||
"url" : "https://openqa.opensuse.org/tests/790711",
|
||||
"short_description" : null,
|
||||
"name" : "openqa:cryptlvm"
|
||||
},
|
||||
{
|
||||
"url" : "https://openqa.opensuse.org/tests/790712",
|
||||
"status_reports_id" : 411,
|
||||
"created_at" : "2018-11-09T12:53:25.000Z",
|
||||
"id" : 3921,
|
||||
"state" : "success",
|
||||
"updated_at" : "2018-11-09T14:02:05.000Z",
|
||||
"name" : "openqa:gnome",
|
||||
"short_description" : null
|
||||
},
|
||||
{
|
||||
"short_description" : null,
|
||||
"name" : "openqa:kde@64bit",
|
||||
"updated_at" : "2018-11-09T14:22:48.000Z",
|
||||
"state" : "success",
|
||||
"id" : 3924,
|
||||
"created_at" : "2018-11-09T12:53:25.000Z",
|
||||
"status_reports_id" : 411,
|
||||
"url" : "https://openqa.opensuse.org/tests/790713"
|
||||
},
|
||||
{
|
||||
"created_at" : "2018-11-09T12:53:25.000Z",
|
||||
"url" : "https://openqa.opensuse.org/tests/790714",
|
||||
"status_reports_id" : 411,
|
||||
"updated_at" : "2018-11-09T14:21:51.000Z",
|
||||
"id" : 3927,
|
||||
"state" : "success",
|
||||
"name" : "openqa:kde@USBboot_64",
|
||||
"short_description" : null
|
||||
},
|
||||
{
|
||||
"id" : 3930,
|
||||
"state" : "failure",
|
||||
"updated_at" : "2018-11-09T13:09:16.000Z",
|
||||
"url" : "https://openqa.opensuse.org/tests/790715#step/partitioning/2",
|
||||
"status_reports_id" : 411,
|
||||
"created_at" : "2018-11-09T12:53:26.000Z",
|
||||
"name" : "openqa:textmode",
|
||||
"short_description" : null
|
||||
},
|
||||
{
|
||||
"short_description" : null,
|
||||
"name" : "openqa:update_staging",
|
||||
"state" : "success",
|
||||
"id" : 3933,
|
||||
"updated_at" : "2018-11-09T13:39:36.000Z",
|
||||
"status_reports_id" : 411,
|
||||
"url" : "https://openqa.opensuse.org/tests/790716",
|
||||
"created_at" : "2018-11-09T12:53:26.000Z"
|
||||
},
|
||||
{
|
||||
"name" : "openqa:RAID1",
|
||||
"short_description" : null,
|
||||
"created_at" : "2018-11-09T12:53:26.000Z",
|
||||
"url" : "https://openqa.opensuse.org/tests/790717",
|
||||
"status_reports_id" : 411,
|
||||
"updated_at" : "2018-11-09T14:12:49.000Z",
|
||||
"id" : 3936,
|
||||
"state" : "success"
|
||||
}
|
||||
],
|
||||
"name": "openSUSE:Factory:Staging:H",
|
||||
"obsolete_requests": [],
|
||||
"openqa_jobs": [
|
||||
{
|
||||
"clone_id": null,
|
||||
"id": 10661,
|
||||
"iso": null,
|
||||
"name": "opensuse-Staging:H-Staging-DVD-x86_64-Build92.10-cryptlvm",
|
||||
"result": "passed",
|
||||
"state": "done",
|
||||
"modules": [
|
||||
{
|
||||
"name": "isosize",
|
||||
"result": "ok"
|
||||
},
|
||||
{
|
||||
"name": "livecdreboot",
|
||||
"result": "ok"
|
||||
},
|
||||
{
|
||||
"name": "first_boot",
|
||||
"result": "ok"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"clone_id": null,
|
||||
"id": 10660,
|
||||
"iso": null,
|
||||
"name": "opensuse-Staging:H-Staging-DVD-x86_64-Build92.10-RAID1",
|
||||
"result": "failed",
|
||||
"state": "done",
|
||||
"modules": [
|
||||
{
|
||||
"name": "isosize",
|
||||
"result": "ok"
|
||||
},
|
||||
{
|
||||
"name": "livecdreboot",
|
||||
"result": "fail"
|
||||
},
|
||||
{
|
||||
"name": "first_boot",
|
||||
"result": "na"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"clone_id": null,
|
||||
"id": 10659,
|
||||
"iso": null,
|
||||
"name": "opensuse-Staging:H-Staging-DVD-x86_64-Build92.10-minimalx",
|
||||
"result": "passed",
|
||||
"state": "done",
|
||||
"modules": [
|
||||
{
|
||||
"name": "isosize",
|
||||
"result": "ok"
|
||||
},
|
||||
{
|
||||
"name": "livecdreboot",
|
||||
"result": "na"
|
||||
},
|
||||
{
|
||||
"name": "first_boot",
|
||||
"result": "ok"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"untracked_requests": []
|
||||
"untracked_requests" : [],
|
||||
"missing_reviews" : [],
|
||||
"overall_state" : "failed",
|
||||
"description" : "requests:\n- {author: jirislaby, id: 643881, package: kernel-source, type: submit}\nrequests_comment: 21343\nsplitter_info:\n activated: '2018-10-23 06:12:35.646967'\n group: kernel-source\n strategy: {name: special}\n",
|
||||
"building_repositories" : []
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ PROJECT = 'openSUSE:Factory'
|
||||
|
||||
FIXTURES = os.path.join(os.getcwd(), 'tests/fixtures')
|
||||
|
||||
DEBUG = True
|
||||
DEBUG = False
|
||||
|
||||
|
||||
# The idiotic routing system of httpretty use a hash table. Because
|
||||
|
@ -16,9 +16,6 @@ class TestUnselect(unittest.TestCase):
|
||||
|
||||
def test_cleanup_filter(self):
|
||||
UnselectCommand.config_init(self.api)
|
||||
UnselectCommand.cleanup_days = 1
|
||||
obsolete = self.api.project_status_requests('obsolete', UnselectCommand.filter_obsolete)
|
||||
self.assertTrue('492438' in obsolete, 'revoked')
|
||||
self.assertTrue('592437' in obsolete, 'superseded but over threshold')
|
||||
self.assertTrue('492439' in obsolete, 'declined by leaper')
|
||||
self.assertTrue('492441' in obsolete, 'declined but over threshold')
|
||||
self.assertEqual(len(obsolete), 4)
|
||||
self.assertSequenceEqual(['627445', '642126', '646560', '645723', '646823'], obsolete)
|
||||
|
Loading…
x
Reference in New Issue
Block a user