| |
@@ -73,7 +73,7 @@
|
| |
return FakeRow(name)
|
| |
|
| |
|
| |
- def fake_pginit1(self, site, release, testtype, milestone, compose, info=None, modular=False):
|
| |
+ def fake_pginit1(self, site, release, testtype, milestone, compose, info=None, dist="Fedora"):
|
| |
"""Fake page.__init__ for testing get_validation_page guessing.
|
| |
This one gives us pages that 'exist' if they're Rawhide and don't
|
| |
otherwise.
|
| |
@@ -85,7 +85,7 @@
|
| |
self.exists = False
|
| |
|
| |
|
| |
- def fake_pginit2(self, site, release, testtype, milestone, compose, info=None, modular=False):
|
| |
+ def fake_pginit2(self, site, release, testtype, milestone, compose, info=None, dist="Fedora"):
|
| |
"""Fake page.__init__ for testing get_validation_page guessing.
|
| |
This one gives us pages that 'exist' if they're Branched and don't
|
| |
otherwise.
|
| |
@@ -97,7 +97,7 @@
|
| |
self.exists = False
|
| |
|
| |
|
| |
- def fake_pginit3(self, site, release, testtype, milestone, compose, info=None, modular=False):
|
| |
+ def fake_pginit3(self, site, release, testtype, milestone, compose, info=None, dist="Fedora"):
|
| |
"""Fake page.__init__ for testing get_validation_page guessing.
|
| |
This one just never exists.
|
| |
"""
|
| |
@@ -137,11 +137,13 @@
|
| |
def test_current_event(self, fakeget, faketext, fakeinit):
|
| |
"""Tests for current_event and current_modular_event."""
|
| |
_ = self.site.current_event
|
| |
- fakeget.assert_called_with(mock.ANY, compose="1.1", milestone="Alpha", release="24")
|
| |
+ fakeget.assert_called_with(
|
| |
+ mock.ANY, compose="1.1", milestone="Alpha", release="24", dist="Fedora"
|
| |
+ )
|
| |
fakeget.reset_mock()
|
| |
_ = self.site.current_modular_event
|
| |
fakeget.assert_called_with(
|
| |
- mock.ANY, compose="1.1", milestone="Alpha", release="24", modular=True
|
| |
+ mock.ANY, compose="1.1", milestone="Alpha", release="24", dist="Fedora-Modular"
|
| |
)
|
| |
|
| |
@mock.patch("mwclient.page.Page.__init__", return_value=None)
|
| |
@@ -180,6 +182,8 @@
|
| |
assert list(self.site.walk_category(fakecat1)) == [fakepg1, fakepg2, fakepg3]
|
| |
|
| |
@mock.patch("fedfind.release.Compose.exists", return_value=True)
|
| |
+ @mock.patch("fedfind.release.IoTNightly.label", "RC-20200513.0")
|
| |
+ @mock.patch("fedfind.release.IoTNightly.cid", "Fedora-IoT-33-20200513.0")
|
| |
@mock.patch("fedfind.release.Production.label", "RC-1.6")
|
| |
@mock.patch("fedfind.release.Production.cid", "Fedora-27-20171105.0")
|
| |
@mock.patch("fedfind.helpers.get_current_release", autospec=True, return_value=27)
|
| |
@@ -193,59 +197,71 @@
|
| |
"""Various tests for get_validation_event."""
|
| |
# current event
|
| |
self.site.get_validation_event()
|
| |
- fakecompose.assert_called_with(self.site, "24", "Alpha", "1.1", modular=False, cid="")
|
| |
- self.site.get_validation_event(modular=True)
|
| |
- fakecompose.assert_called_with(self.site, "24", "Alpha", "1.1", modular=True, cid="")
|
| |
+ fakecompose.assert_called_with(self.site, "24", "Alpha", "1.1", dist="Fedora", cid="")
|
| |
+ self.site.get_validation_event(dist="Fedora-Modular")
|
| |
+ fakecompose.assert_called_with(
|
| |
+ self.site, "24", "Alpha", "1.1", dist="Fedora-Modular", cid=""
|
| |
+ )
|
| |
# old-school TC/RC
|
| |
self.site.get_validation_event(23, "Final", "TC9")
|
| |
- fakecompose.assert_called_with(self.site, 23, "Final", "TC9", modular=False, cid="")
|
| |
+ fakecompose.assert_called_with(self.site, 23, "Final", "TC9", dist="Fedora", cid="")
|
| |
self.site.get_validation_event(23, "Beta", "RC1")
|
| |
- fakecompose.assert_called_with(self.site, 23, "Beta", "RC1", modular=False, cid="")
|
| |
+ fakecompose.assert_called_with(self.site, 23, "Beta", "RC1", dist="Fedora", cid="")
|
| |
# old-school nightly
|
| |
self.site.get_validation_event(23, "Rawhide", "20151112")
|
| |
fakenightly.assert_called_with(
|
| |
- self.site, release=23, milestone="Rawhide", compose="20151112", modular=False
|
| |
+ self.site, release=23, milestone="Rawhide", compose="20151112", dist="Fedora"
|
| |
)
|
| |
- self.site.get_validation_event(23, "Branched", "20151211", modular=False)
|
| |
+ self.site.get_validation_event(23, "Branched", "20151211", dist="Fedora")
|
| |
fakenightly.assert_called_with(
|
| |
- self.site, release=23, milestone="Branched", compose="20151211", modular=False
|
| |
+ self.site, release=23, milestone="Branched", compose="20151211", dist="Fedora"
|
| |
)
|
| |
# Pungi 4 production/candidate
|
| |
self.site.get_validation_event(24, "Alpha", "1.1")
|
| |
- fakecompose.assert_called_with(self.site, 24, "Alpha", "1.1", modular=False, cid="")
|
| |
- self.site.get_validation_event(27, "Beta", "1.5", modular=True)
|
| |
- fakecompose.assert_called_with(self.site, 27, "Beta", "1.5", modular=True, cid="")
|
| |
+ fakecompose.assert_called_with(self.site, 24, "Alpha", "1.1", dist="Fedora", cid="")
|
| |
+ self.site.get_validation_event(27, "Beta", "1.5", dist="Fedora-Modular")
|
| |
+ fakecompose.assert_called_with(self.site, 27, "Beta", "1.5", dist="Fedora-Modular", cid="")
|
| |
# Past 23, 'Final' milestone should be converted to 'RC'
|
| |
self.site.get_validation_event(25, "Final", "1.1")
|
| |
- fakecompose.assert_called_with(self.site, 25, "RC", "1.1", modular=False, cid="")
|
| |
+ fakecompose.assert_called_with(self.site, 25, "RC", "1.1", dist="Fedora", cid="")
|
| |
# Pungi 4 nightly
|
| |
self.site.get_validation_event(24, "Rawhide", "20160222.n.0")
|
| |
fakenightly.assert_called_with(
|
| |
- self.site, release=24, milestone="Rawhide", compose="20160222.n.0", modular=False
|
| |
+ self.site, release=24, milestone="Rawhide", compose="20160222.n.0", dist="Fedora"
|
| |
)
|
| |
self.site.get_validation_event(24, "Branched", "20160315.n.1")
|
| |
fakenightly.assert_called_with(
|
| |
- self.site, release=24, milestone="Branched", compose="20160315.n.1", modular=False
|
| |
+ self.site, release=24, milestone="Branched", compose="20160315.n.1", dist="Fedora"
|
| |
)
|
| |
- self.site.get_validation_event(27, "Branched", "20171110.n.1", modular=True)
|
| |
+ self.site.get_validation_event(27, "Branched", "20171110.n.1", dist="Fedora-Modular")
|
| |
fakenightly.assert_called_with(
|
| |
- self.site, release=27, milestone="Branched", compose="20171110.n.1", modular=True
|
| |
+ self.site,
|
| |
+ release=27,
|
| |
+ milestone="Branched",
|
| |
+ compose="20171110.n.1",
|
| |
+ dist="Fedora-Modular",
|
| |
)
|
| |
# Rawhide nightly compose ID
|
| |
- self.site.get_validation_event(cid="Fedora-Rawhide-20180220.n.0", modular=False)
|
| |
+ self.site.get_validation_event(cid="Fedora-Rawhide-20180220.n.0", dist="Fedora")
|
| |
fakenightly.assert_called_with(
|
| |
- self.site, release="28", milestone="Rawhide", compose="20180220.n.0", modular=False
|
| |
+ self.site, release="28", milestone="Rawhide", compose="20180220.n.0", dist="Fedora"
|
| |
)
|
| |
# Branched nightly compose ID
|
| |
- self.site.get_validation_event(cid="Fedora-27-20171120.n.0", modular=False)
|
| |
+ self.site.get_validation_event(cid="Fedora-27-20171120.n.0", dist="Fedora")
|
| |
fakenightly.assert_called_with(
|
| |
- self.site, release="27", milestone="Branched", compose="20171120.n.0", modular=False
|
| |
+ self.site, release="27", milestone="Branched", compose="20171120.n.0", dist="Fedora"
|
| |
)
|
| |
# Candidate compose ID (note compose ID passthrough)
|
| |
- self.site.get_validation_event(cid="Fedora-27-20171105.0", modular=False)
|
| |
+ self.site.get_validation_event(cid="Fedora-27-20171105.0", dist="Fedora")
|
| |
fakecompose.assert_called_with(
|
| |
- self.site, "27", "RC", "1.6", modular=False, cid="Fedora-27-20171105.0"
|
| |
+ self.site, "27", "RC", "1.6", dist="Fedora", cid="Fedora-27-20171105.0"
|
| |
)
|
| |
+ # IoT compose: these are technically productions but quack and
|
| |
+ # walk like nightlies, with dates in the labels; we intend to
|
| |
+ # treat them as nightlies and create nightly events
|
| |
+ fakegetcurr.return_value = 32
|
| |
+ self.site.get_validation_event(cid="Fedora-IoT-33-20200513.0", dist="Fedora-IoT")
|
| |
+ fakenightly.assert_called_with(self.site, "33", "RC", "20200513.0", dist="Fedora-IoT")
|
| |
|
| |
with pytest.raises(ValueError):
|
| |
# Non-nightly compose but no milestone
|
| |
@@ -293,7 +309,7 @@
|
| |
assert "Could not find any event" in err
|
| |
|
| |
@mock.patch("wikitcms.event.ComposeEvent.__init__", return_value=None, autospec=True)
|
| |
- @mock.patch("wikitcms.wiki.Wiki.current_event")
|
| |
+ @mock.patch("wikitcms.wiki.Wiki.get_current_event")
|
| |
def test_get_validation_event_guess_nomatch(self, fakecurr, fakeevent, fakemwp):
|
| |
"""Check that when we guess but specify a release or milestone
|
| |
and the guessed release doesn't match the requested release or
|
| |
@@ -323,56 +339,60 @@
|
| |
# current event
|
| |
self.site.get_validation_page("Installation")
|
| |
fakecompose.assert_called_with(
|
| |
- self.site, "24", "Installation", "Alpha", "1.1", modular=False
|
| |
+ self.site, "24", "Installation", "Alpha", "1.1", dist="Fedora"
|
| |
)
|
| |
# old-school TC/RC
|
| |
self.site.get_validation_page("Installation", 23, "Final", "TC9")
|
| |
- fakecompose.assert_called_with(self.site, 23, "Installation", "Final", "TC9", modular=False)
|
| |
+ fakecompose.assert_called_with(self.site, 23, "Installation", "Final", "TC9", dist="Fedora")
|
| |
self.site.get_validation_page("Installation", 23, "Beta", "RC1")
|
| |
- fakecompose.assert_called_with(self.site, 23, "Installation", "Beta", "RC1", modular=False)
|
| |
+ fakecompose.assert_called_with(self.site, 23, "Installation", "Beta", "RC1", dist="Fedora")
|
| |
# old-school nightly
|
| |
self.site.get_validation_page("Installation", 23, "Rawhide", "20151112")
|
| |
fakenightly.assert_called_with(
|
| |
- self.site, 23, "Installation", "Rawhide", "20151112", modular=False
|
| |
+ self.site, 23, "Installation", "Rawhide", "20151112", dist="Fedora"
|
| |
)
|
| |
self.site.get_validation_page("Installation", 23, "Branched", "20151211")
|
| |
fakenightly.assert_called_with(
|
| |
- self.site, 23, "Installation", "Branched", "20151211", modular=False
|
| |
+ self.site, 23, "Installation", "Branched", "20151211", dist="Fedora"
|
| |
)
|
| |
# Pungi 4 production/candidate
|
| |
self.site.get_validation_page("Installation", 24, "Alpha", "1.1")
|
| |
- fakecompose.assert_called_with(self.site, 24, "Installation", "Alpha", "1.1", modular=False)
|
| |
- self.site.get_validation_page("Installation", 27, "Beta", "1.5", modular=True)
|
| |
- fakecompose.assert_called_with(self.site, 27, "Installation", "Beta", "1.5", modular=True)
|
| |
+ fakecompose.assert_called_with(self.site, 24, "Installation", "Alpha", "1.1", dist="Fedora")
|
| |
+ self.site.get_validation_page("Installation", 27, "Beta", "1.5", dist="Fedora-Modular")
|
| |
+ fakecompose.assert_called_with(
|
| |
+ self.site, 27, "Installation", "Beta", "1.5", dist="Fedora-Modular"
|
| |
+ )
|
| |
# Past 23, 'Final' milestone should be converted to 'RC'
|
| |
self.site.get_validation_page("Installation", 25, "Final", "1.1")
|
| |
- fakecompose.assert_called_with(self.site, 25, "Installation", "RC", "1.1", modular=False)
|
| |
+ fakecompose.assert_called_with(self.site, 25, "Installation", "RC", "1.1", dist="Fedora")
|
| |
# Pungi 4 nightly
|
| |
self.site.get_validation_page("Installation", 24, "Rawhide", "20160222.n.0")
|
| |
fakenightly.assert_called_with(
|
| |
- self.site, 24, "Installation", "Rawhide", "20160222.n.0", modular=False
|
| |
+ self.site, 24, "Installation", "Rawhide", "20160222.n.0", dist="Fedora"
|
| |
)
|
| |
self.site.get_validation_page("Installation", 24, "Branched", "20160315.n.1")
|
| |
fakenightly.assert_called_with(
|
| |
- self.site, 24, "Installation", "Branched", "20160315.n.1", modular=False
|
| |
+ self.site, 24, "Installation", "Branched", "20160315.n.1", dist="Fedora"
|
| |
+ )
|
| |
+ self.site.get_validation_page(
|
| |
+ "Installation", 27, "Branched", "20171110.n.1", dist="Fedora-Modular"
|
| |
)
|
| |
- self.site.get_validation_page("Installation", 27, "Branched", "20171110.n.1", modular=True)
|
| |
fakenightly.assert_called_with(
|
| |
- self.site, 27, "Installation", "Branched", "20171110.n.1", modular=True
|
| |
+ self.site, 27, "Installation", "Branched", "20171110.n.1", dist="Fedora-Modular"
|
| |
)
|
| |
# Rawhide nightly compose ID
|
| |
self.site.get_validation_page("Installation", cid="Fedora-Rawhide-20180220.n.0")
|
| |
fakenightly.assert_called_with(
|
| |
- self.site, "28", "Installation", "Rawhide", "20180220.n.0", modular=False
|
| |
+ self.site, "28", "Installation", "Rawhide", "20180220.n.0", dist="Fedora"
|
| |
)
|
| |
# Branched nightly compose ID
|
| |
self.site.get_validation_page("Installation", cid="Fedora-27-20171120.n.0")
|
| |
fakenightly.assert_called_with(
|
| |
- self.site, "27", "Installation", "Branched", "20171120.n.0", modular=False
|
| |
+ self.site, "27", "Installation", "Branched", "20171120.n.0", dist="Fedora"
|
| |
)
|
| |
# Candidate compose ID
|
| |
self.site.get_validation_page("Installation", cid="Fedora-27-20171105.0")
|
| |
- fakecompose.assert_called_with(self.site, "27", "Installation", "RC", "1.6", modular=False)
|
| |
+ fakecompose.assert_called_with(self.site, "27", "Installation", "RC", "1.6", dist="Fedora")
|
| |
|
| |
with pytest.raises(ValueError):
|
| |
# Non-nightly compose but no milestone
|
| |
@@ -425,7 +445,7 @@
|
| |
"compose": "",
|
| |
"date": "20200407.n.0",
|
| |
}
|
| |
- with mock.patch("wikitcms.wiki.Wiki.current_compose", fakecurr):
|
| |
+ with mock.patch("wikitcms.wiki.Wiki.get_current_compose", return_value=fakecurr):
|
| |
with pytest.raises(ValueError) as err:
|
| |
self.site.get_validation_page("Installation", release=23)
|
| |
assert "does not match requested" in err
|
| |
@@ -561,8 +581,8 @@
|
| |
# this is more or less what the return of
|
| |
# category.members(generator=False) looks like - it's an
|
| |
# mwclient 'List' instance
|
| |
- instmx = {"title": "Template:Installation modular test matrix", "pageid": 77036, "ns": 10}
|
| |
- servmx = {"title": "Template:Server modular test matrix", "pageid": 77040, "ns": 10}
|
| |
+ instmx = {"title": "Template:Installation Modular test matrix", "pageid": 77036, "ns": 10}
|
| |
+ servmx = {"title": "Template:Server Modular test matrix", "pageid": 77040, "ns": 10}
|
| |
fakemembers.return_value = [instmx, servmx]
|
| |
assert self.site.modular_testtypes == ["Installation", "Server"]
|
| |
|
| |
We only ever did two Fedora-Modular composes, in the end, so all
the effort I put into supporting a parallel set of events for
modular composes seemed wasted. BUT! We now want a parallel event
stream for IoT composes: https://pagure.io/fedora-qa/issue/623
So, we can achieve that by making all this code to handle modular
composes more generic. Instead of hardcoding the concept of a
"modular event" for modular composes, we just kinda allow for
the existence of event streams for any given "dist", where a
"dist" is a Pungi compose shortname like "Fedora" (which gives
all the current page names and texts and category names and so
on), "Fedora-IoT" or "Fedora-Cloud" (which will give page names
and category names and texts based on those strings), or
"Fedora-Modular" (which will give the names and texts I hardcoded
before, via some ugly grandfathering hacks, where the new generic
dist name handling code would give something different).
We will need to tweak some of the actual wiki templates a bit
for this, too, and adjust relval and relvalconsumer to the new
way of doing things.
Signed-off-by: Adam Williamson awilliam@redhat.com