#99 Add scheduling for new Workstation upgrade test flavors
Merged 2 years ago by adamwill. Opened 2 years ago by adamwill.

@@ -325,6 +325,13 @@ 

          return ('', [])

      logger.debug("Finding images for compose %s in location %s", rel.cid, location)

      images = _get_images(rel, wanted=wanted)

+     # these are 'special' upgrade flavors, not associated with an image

+     images.extend(

+         [

+             ("Workstation-upgrade", "x86_64", 0, {}, "Workstation", "upgrade"),

+             ("Workstation-upgrade", "aarch64", 0, {}, "Workstation", "upgrade"),

+         ]

+     )

      if flavors and flavors != ["universal"]:

          # in special cast flavors is just "universal", we don't filter

          # the image list so we can pick the best universal candidate
@@ -335,7 +342,7 @@ 

          logger.debug("Only scheduling jobs for arches %s", ' '.join(arches))

          images = [img for img in images if img[1] in arches]

  

-     if len(images) == 0:

+     if not images or (all(img[0] == "Workstation-upgrade" for img in images) and flavors != ["Workstation-upgrade"]):

          raise TriggerException("Compose found, but no available images")

      jobs = []

      univs = {}

file modified
+10 -9
@@ -380,12 +380,12 @@ 

      # simple case

      ret = schedule.jobs_from_compose(COMPURL)

  

-     # 6 images, 1 universal arch

-     assert fakerun.call_count == 7

+     # 6 images, 1 x86_64 upgrade flavor, 1 universal arch

+     assert fakerun.call_count == 8

  

-     # the list of job ids should be 15 1s, as each fakerun call

+     # the list of job ids should be 8 1s, as each fakerun call

      # returns [1]

-     assert ret == ('Fedora-25-20161115.n.0', [1 for _ in range(7)])

+     assert ret == ('Fedora-25-20161115.n.0', [1 for _ in range(8)])

  

      for argtup in fakerun.call_args_list:

          # check rel identification bits got passed properly
@@ -438,11 +438,12 @@ 

              "dkboot": True,

          },

      ]

-     # first check we get 5 runs (one for each image plus two universal

-     # runs) with no arches set by config or arg, and this WANTED

+     # first check we get 7 runs (one for each image, x86_64 and

+     # aarch64 upgrade flavors, two universal runs) with no arches set

+     # by config or arg, and this WANTED

      schedule.CONFIG.set("schedule", "arches", "")

      ret = schedule.jobs_from_compose(COMPURL, wanted=wanted)

-     assert fakerun.call_count == 5

+     assert fakerun.call_count == 7

      # now check we get only 3 if we limit the arches

      fakerun.reset_mock()

      ret = schedule.jobs_from_compose(COMPURL, wanted=wanted, arches=['i386', 'armhfp'])
@@ -504,7 +505,7 @@ 

  def test_jobs_from_compose_tag(fakeclient, fakerun, ffmock02):

      """Check that we tag candidate composes as 'important'."""

      ret = schedule.jobs_from_compose(COMPURL)

-     assert ret == ('Fedora-25-20161115.n.0', [1 for _ in range(7)])

+     assert ret == ('Fedora-25-20161115.n.0', [1 for _ in range(8)])

      # find the args that openqa_request was last called with

      reqargs = fakeclient.return_value.openqa_request.call_args

      assert reqargs[0] == ('POST', 'groups/1/comments')
@@ -517,7 +518,7 @@ 

      if there is one.

      """

      ret = schedule.jobs_from_compose(COMPURL)

-     assert ret == ('Fedora-25-20161115.n.0', [1 for _ in range(7)])

+     assert ret == ('Fedora-25-20161115.n.0', [1 for _ in range(8)])

      assert fakerun.call_args[1]["label"] == "RC-1.5"

  

  @mock.patch('fedora_openqa.schedule.run_openqa_jobs', return_value=[1], autospec=True)

In order to run post-install tests on upgraded systems, we're
moving the Workstation upgrade test (only that, for now) into
its own flavor:

https://pagure.io/fedora-qa/os-autoinst-distri-fedora/issue/226
https://pagure.io/fedora-qa/os-autoinst-distri-fedora/pull-request/253

this handles the scheduling for those flavors. We add them into
the list we get from parsing the images in the compose, before
the filtering happens so they can be filtered out if desired.
This also requires the tests to be updated, and an improvement
to the logic for raising an exception if we don't find images.

Signed-off-by: Adam Williamson awilliam@redhat.com

Build succeeded.

rebased onto 731ae79

2 years ago

Build succeeded.

Pull-Request has been merged by adamwill

2 years ago