Skip to content

Commit

Permalink
bots: Normalize tests invocation
Browse files Browse the repository at this point in the history
All projects support `test/run` script, so lets use this.
Also context now is image[/scenario]. Scenario cannot contain '/' and is
not necessary. It is every `test/run` scripts duty to be able to parse
TEST_OS and SCENARIO environment variables.

Closes #12367
  • Loading branch information
marusak authored Jul 23, 2019
1 parent cc9483a commit 2cf6e3a
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 188 deletions.
76 changes: 38 additions & 38 deletions bots/image-refresh
Original file line number Diff line number Diff line change
Expand Up @@ -28,79 +28,79 @@ from task import github, REDHAT_STORE

TRIGGERS = {
"centos-7": [
"cockpit/centos-7@cockpit-project/starter-kit",
"centos-7@cockpit-project/starter-kit",
],
"continuous-atomic": [
"cockpit/continuous-atomic@cockpit-project/cockpit-ostree",
"continuous-atomic@cockpit-project/cockpit-ostree",
],
"debian-testing": [
"verify/debian-testing"
"debian-testing"
],
"debian-stable": [
"verify/debian-stable"
"debian-stable"
],
"fedora-29": [
"verify/fedora-atomic",
"cockpit/fedora-29@cockpit-project/cockpit-podman",
"fedora-atomic",
"fedora-29@cockpit-project/cockpit-podman",
],
"fedora-30": [
"verify/fedora-30",
"selenium/chrome",
"selenium/firefox",
"selenium/edge",
"avocado/fedora",
"container/bastion",
"cockpit/fedora-30@cockpit-project/starter-kit",
"cockpit/fedora-30@cockpit-project/cockpit-podman",
"cockpit/fedora-30@weldr/lorax",
"cockpit/fedora-30/live-iso@weldr/lorax",
"cockpit/fedora-30/qcow2@weldr/lorax",
"cockpit/fedora-30/chrome@weldr/cockpit-composer",
"cockpit/fedora-30/firefox@weldr/cockpit-composer",
"cockpit/fedora-30/edge@weldr/cockpit-composer",
"fedora-30",
"fedora-30/selenium-chrome",
"fedora-30/selenium-firefox",
"fedora-30/selenium-edge",
"fedora-30/avocado",
"fedora-30/container-bastion",
"fedora-30@cockpit-project/starter-kit",
"fedora-30@cockpit-project/cockpit-podman",
"fedora-30@weldr/lorax",
"fedora-30/live-iso@weldr/lorax",
"fedora-30/qcow2@weldr/lorax",
"fedora-30/chrome@weldr/cockpit-composer",
"fedora-30/firefox@weldr/cockpit-composer",
"fedora-30/edge@weldr/cockpit-composer",
],
"fedora-atomic": [
"verify/fedora-atomic",
"cockpit/fedora-atomic@cockpit-project/cockpit-ostree",
"fedora-atomic",
"fedora-atomic@cockpit-project/cockpit-ostree",
],
"fedora-testing": [
"verify/fedora-testing"
"fedora-testing"
],
"fedora-i386": [
"verify/fedora-i386"
"fedora-i386"
],
"ubuntu-1804": [
"verify/ubuntu-1804"
"ubuntu-1804"
],
"ubuntu-stable": [
"verify/ubuntu-stable"
"ubuntu-stable"
],
"openshift": [
# FIXME: need to test a rhel-7.x branch here, once we can
],
"ipa": [
"verify/fedora-30",
"verify/ubuntu-1804",
"verify/debian-stable"
"fedora-30",
"ubuntu-1804",
"debian-stable"
],
"selenium": [
"selenium/chrome",
"selenium/firefox",
"fedora-30/selenium-chrome",
"fedora-30/selenium-firefox",
],
"rhel-7-7": [
"cockpit/rhel-7-7/firefox@weldr/cockpit-composer",
"rhel-7-7/firefox@weldr/cockpit-composer",
],
"rhel-8-0": [
"verify/rhel-8-0",
"verify/rhel-8-0-distropkg",
"rhel-8-0",
"rhel-8-0-distropkg",
],
"rhel-8-1": [
"verify/rhel-8-1",
"cockpit/rhel-8-1/chrome@weldr/cockpit-composer",
"cockpit/rhel-8-1@cockpit-project/cockpit-podman",
"rhel-8-1",
"rhel-8-1/chrome@weldr/cockpit-composer",
"rhel-8-1@cockpit-project/cockpit-podman",
],
"rhel-atomic": [
"cockpit/rhel-atomic@cockpit-project/cockpit-ostree",
"rhel-atomic@cockpit-project/cockpit-ostree",
]
}

Expand Down
19 changes: 5 additions & 14 deletions bots/task/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import subprocess
import re

from . import cache
from . import cache, testmap

__all__ = (
'GitHub',
Expand All @@ -55,16 +55,6 @@
# it will publish a test task to the queue (used to trigger specific contexts)
NOT_TESTED_DIRECT = "Not yet tested (direct trigger)"

OUR_CONTEXTS = [
"verify/",
"avocado/",
"container/",
"selenium/",

# generic prefix for external repos
"cockpit/",
]

ISSUE_TITLE_IMAGE_REFRESH = "Image refresh for {0}"

BASE = os.path.normpath(os.path.join(os.path.dirname(__file__), "..", ".."))
Expand All @@ -73,9 +63,10 @@
TEAM_CONTRIBUTORS = "Contributors"

def known_context(context):
for prefix in OUR_CONTEXTS:
if context.startswith(prefix):
return True
for project in testmap.projects():
for branch_tests in testmap.tests_for_project(project).values():
if context in branch_tests:
return True
return False

class Logger(object):
Expand Down
107 changes: 54 additions & 53 deletions bots/task/testmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,97 +17,98 @@

REPO_BRANCH_CONTEXT = {
'cockpit-project/cockpit': {
'master': ['avocado/fedora', 'container/bastion',
'selenium/firefox', 'selenium/chrome', 'selenium/edge',
'verify/debian-stable', 'verify/debian-testing',
'verify/ubuntu-1804', 'verify/ubuntu-stable',
'verify/fedora-30', 'verify/fedora-atomic',
'verify/rhel-8-0-distropkg', 'verify/rhel-8-1',
'master': ['fedora-30/avocado', 'fedora-30/container-bastion',
'fedora-30/selenium-firefox', 'fedora-30/selenium-chrome', 'fedora-30/selenium-edge',
'debian-stable', 'debian-testing',
'ubuntu-1804', 'ubuntu-stable',
'fedora-30', 'fedora-atomic',
'rhel-8-0-distropkg', 'rhel-8-1',
],
'rhel-7.6': ['avocado/fedora', 'container/kubernetes', 'container/bastion',
'selenium/firefox', 'selenium/chrome', 'verify/rhel-7-6',
'rhel-7.6': ['fedora-30/avocado', 'fedora-30/container-kubernetes', 'fedora-30/container-bastion',
'fedora-30/selenium-firefox', 'fedora-30/selenium-chrome', 'rhel-7-6',
],
'rhel-7.7': ['avocado/fedora', 'container/kubernetes', 'container/bastion',
'selenium/firefox', 'selenium/chrome', 'verify/rhel-7-7',
'rhel-7.7': ['fedora-30/avocado-fedora', 'fedora-30/container-kubernetes',
'fedora-30/container-bastion', 'fedora-30/selenium-firefox', 'fedora-30/selenium-chrome', 'rhel-7-7',
],
'rhel-8.0': ['avocado/fedora', 'container/bastion', 'selenium/firefox', 'selenium/chrome',
'verify/rhel-8-0',
'rhel-8.0': ['fedora-30/avocado-fedora', 'fedora-30/container-bastion',
'fedora-30/selenium-firefox', 'fedora-30/selenium-chrome',
'rhel-8-0',
],
'rhel-8-appstream': ['avocado/fedora', 'container/bastion', 'selenium/firefox',
'selenium/chrome', 'verify/rhel-8-0-distropkg', 'verify/rhel-8-1',
'rhel-8-appstream': ['fedora-30/avocado-fedora', 'fedora-30/container-bastion',
'fedora-30/selenium-firefox', 'fedora-30/selenium-chrome', 'rhel-8-0-distropkg', 'rhel-8-1',
],
'rhel-8.1': ['verify/rhel-8-1',
'rhel-8.1': ['rhel-8-1',
],
# These can be triggered manually with bots/tests-trigger
'_manual': ['verify/fedora-i386', 'verify/fedora-testing',
'_manual': ['fedora-i386', 'fedora-testing',
],
},
'cockpit-project/starter-kit': {
'master': [
'cockpit/centos-7',
'cockpit/fedora-30',
'centos-7',
'fedora-30',
],
},
'cockpit-project/cockpit-ostree': {
'master': [
'cockpit/fedora-atomic',
'cockpit/continuous-atomic',
'cockpit/rhel-atomic',
'fedora-atomic',
'continuous-atomic',
'rhel-atomic',
],
},
'cockpit-project/cockpit-podman': {
'master': [
'cockpit/fedora-29',
'cockpit/fedora-30',
'cockpit/rhel-8-1',
'fedora-29',
'fedora-30',
'rhel-8-1',
],
},
'weldr/lorax': {
'master': [
'cockpit/fedora-30',
'cockpit/fedora-30/live-iso',
'cockpit/fedora-30/qcow2',
'cockpit/fedora-30/aws',
'cockpit/fedora-30/openstack',
'cockpit/fedora-30/vmware',
'fedora-30',
'fedora-30/live-iso',
'fedora-30/qcow2',
'fedora-30/aws',
'fedora-30/openstack',
'fedora-30/vmware',
],
'_manual': [
'cockpit/fedora-30/azure',
'fedora-30/azure',

'cockpit/rhel-8-1',
'cockpit/rhel-8-1/live-iso',
'cockpit/rhel-8-1/qcow2',
'cockpit/rhel-8-1/aws',
'cockpit/rhel-8-1/azure',
'cockpit/rhel-8-1/openstack',
'cockpit/rhel-8-1/vmware',
'rhel-8-1',
'rhel-8-1/live-iso',
'rhel-8-1/qcow2',
'rhel-8-1/aws',
'rhel-8-1/azure',
'rhel-8-1/openstack',
'rhel-8-1/vmware',
],
'rhel7-extras': [
'cockpit/rhel-7-7',
'cockpit/rhel-7-7/live-iso',
'cockpit/rhel-7-7/qcow2',
'cockpit/rhel-7-7/aws',
'cockpit/rhel-7-7/azure',
'cockpit/rhel-7-7/openstack',
'cockpit/rhel-7-7/vmware',
'rhel-7-7',
'rhel-7-7/live-iso',
'rhel-7-7/qcow2',
'rhel-7-7/aws',
'rhel-7-7/azure',
'rhel-7-7/openstack',
'rhel-7-7/vmware',
],
},
'weldr/cockpit-composer': {
'master': [
'cockpit/fedora-30/chrome',
'cockpit/fedora-30/firefox',
'cockpit/fedora-30/edge',
'cockpit/rhel-7-7/firefox',
'cockpit/rhel-8-1/chrome',
'fedora-30/chrome',
'fedora-30/firefox',
'fedora-30/edge',
'rhel-7-7/firefox',
'rhel-8-1/chrome',
],
'rhel-8.0': ['cockpit/rhel-8-0/chrome', 'cockpit/rhel-8-0/firefox', 'cockpit/rhel-8-0/edge'
'rhel-8.0': ['rhel-8-0/chrome', 'rhel-8-0/firefox', 'rhel-8-0/edge'
],
'rhel-8.1': ['cockpit/rhel-8-1/chrome', 'cockpit/rhel-8-1/firefox', 'cockpit/rhel-8-1/edge'
'rhel-8.1': ['rhel-8-1/chrome', 'rhel-8-1/firefox', 'rhel-8-1/edge'
],
},
'mvollmer/subscription-manager': {
'_manual': [
'cockpit/rhel-8-0',
'rhel-8-0',
],
}
}
Expand Down
Loading

0 comments on commit 2cf6e3a

Please sign in to comment.