| |
@@ -9,7 +9,8 @@
|
| |
import module_build_service.scheduler.handlers.repos
|
| |
import module_build_service.scheduler.handlers.tags
|
| |
import module_build_service.models
|
| |
- from tests import conf
|
| |
+
|
| |
+ from module_build_service.scheduler.events import KojiTagChange
|
| |
|
| |
import koji
|
| |
|
| |
@@ -23,23 +24,23 @@
|
| |
that we do nothing gracefully.
|
| |
"""
|
| |
from_tag_change_event.return_value = None
|
| |
- msg = module_build_service.messaging.KojiTagChange(
|
| |
+ msg = KojiTagChange(
|
| |
"no matches for this...", "2016-some-nonexistent-build", "artifact", "artifact-1.2-1")
|
| |
module_build_service.scheduler.handlers.tags.tagged(
|
| |
- config=conf, db_session=db_session, msg=msg)
|
| |
+ db_session=db_session, msg=msg)
|
| |
|
| |
def test_no_matching_artifact(self, db_session):
|
| |
""" Test that when a tag msg hits us and we have no match,
|
| |
that we do nothing gracefully.
|
| |
"""
|
| |
- msg = module_build_service.messaging.KojiTagChange(
|
| |
+ msg = KojiTagChange(
|
| |
"id",
|
| |
"module-testmodule-master-20170219191323-c40c156c-build",
|
| |
"artifact",
|
| |
"artifact-1.2-1",
|
| |
)
|
| |
module_build_service.scheduler.handlers.tags.tagged(
|
| |
- config=conf, db_session=db_session, msg=msg)
|
| |
+ db_session=db_session, msg=msg)
|
| |
|
| |
@patch(
|
| |
"module_build_service.builder.GenericBuilder.default_buildroot_groups",
|
| |
@@ -85,24 +86,24 @@
|
| |
db_session.commit()
|
| |
|
| |
# Tag the first component to the buildroot.
|
| |
- msg = module_build_service.messaging.KojiTagChange(
|
| |
+ msg = KojiTagChange(
|
| |
"id",
|
| |
"module-testmodule-master-20170219191323-c40c156c-build",
|
| |
"perl-Tangerine",
|
| |
"perl-Tangerine-0.23-1.module+0+d027b723",
|
| |
)
|
| |
module_build_service.scheduler.handlers.tags.tagged(
|
| |
- config=conf, db_session=db_session, msg=msg
|
| |
+ db_session=db_session, msg=msg
|
| |
)
|
| |
# Tag the first component to the final tag.
|
| |
- msg = module_build_service.messaging.KojiTagChange(
|
| |
+ msg = KojiTagChange(
|
| |
"id",
|
| |
"module-testmodule-master-20170219191323-c40c156c",
|
| |
"perl-Tangerine",
|
| |
"perl-Tangerine-0.23-1.module+0+d027b723",
|
| |
)
|
| |
module_build_service.scheduler.handlers.tags.tagged(
|
| |
- config=conf, db_session=db_session, msg=msg
|
| |
+ db_session=db_session, msg=msg
|
| |
)
|
| |
|
| |
# newRepo should not be called, because there are still components
|
| |
@@ -110,14 +111,14 @@
|
| |
assert not koji_session.newRepo.called
|
| |
|
| |
# Tag the second component to the buildroot.
|
| |
- msg = module_build_service.messaging.KojiTagChange(
|
| |
+ msg = KojiTagChange(
|
| |
"id",
|
| |
"module-testmodule-master-20170219191323-c40c156c-build",
|
| |
"perl-List-Compare",
|
| |
"perl-List-Compare-0.53-5.module+0+d027b723",
|
| |
)
|
| |
module_build_service.scheduler.handlers.tags.tagged(
|
| |
- config=conf, db_session=db_session, msg=msg
|
| |
+ db_session=db_session, msg=msg
|
| |
)
|
| |
|
| |
# newRepo should not be called, because the component has not been
|
| |
@@ -125,14 +126,14 @@
|
| |
assert not koji_session.newRepo.called
|
| |
|
| |
# Tag the first component to the final tag.
|
| |
- msg = module_build_service.messaging.KojiTagChange(
|
| |
+ msg = KojiTagChange(
|
| |
"id",
|
| |
"module-testmodule-master-20170219191323-c40c156c",
|
| |
"perl-List-Compare",
|
| |
"perl-List-Compare-0.53-5.module+0+d027b723",
|
| |
)
|
| |
module_build_service.scheduler.handlers.tags.tagged(
|
| |
- config=conf, db_session=db_session, msg=msg)
|
| |
+ db_session=db_session, msg=msg)
|
| |
|
| |
# newRepo should be called now - all components have been tagged.
|
| |
koji_session.newRepo.assert_called_once_with(
|
| |
@@ -181,23 +182,23 @@
|
| |
db_session.commit()
|
| |
|
| |
# Tag the perl-List-Compare component to the buildroot.
|
| |
- msg = module_build_service.messaging.KojiTagChange(
|
| |
+ msg = KojiTagChange(
|
| |
"id",
|
| |
"module-testmodule-master-20170219191323-c40c156c-build",
|
| |
"perl-Tangerine",
|
| |
"perl-Tangerine-0.23-1.module+0+d027b723",
|
| |
)
|
| |
module_build_service.scheduler.handlers.tags.tagged(
|
| |
- config=conf, db_session=db_session, msg=msg)
|
| |
+ db_session=db_session, msg=msg)
|
| |
# Tag the perl-List-Compare component to final tag.
|
| |
- msg = module_build_service.messaging.KojiTagChange(
|
| |
+ msg = KojiTagChange(
|
| |
"id",
|
| |
"module-testmodule-master-20170219191323-c40c156c",
|
| |
"perl-Tangerine",
|
| |
"perl-Tangerine-0.23-1.module+0+d027b723",
|
| |
)
|
| |
module_build_service.scheduler.handlers.tags.tagged(
|
| |
- config=conf, db_session=db_session, msg=msg)
|
| |
+ db_session=db_session, msg=msg)
|
| |
|
| |
# newRepo should not be called, because perl-List-Compare has not been
|
| |
# built yet.
|
| |
@@ -251,24 +252,24 @@
|
| |
db_session.commit()
|
| |
|
| |
# Tag the perl-List-Compare component to the buildroot.
|
| |
- msg = module_build_service.messaging.KojiTagChange(
|
| |
+ msg = KojiTagChange(
|
| |
"id",
|
| |
"module-testmodule-master-20170219191323-c40c156c-build",
|
| |
"perl-List-Compare",
|
| |
"perl-List-Compare-0.53-5.module+0+d027b723",
|
| |
)
|
| |
module_build_service.scheduler.handlers.tags.tagged(
|
| |
- config=conf, db_session=db_session, msg=msg
|
| |
+ db_session=db_session, msg=msg
|
| |
)
|
| |
# Tag the perl-List-Compare component to final tag.
|
| |
- msg = module_build_service.messaging.KojiTagChange(
|
| |
+ msg = KojiTagChange(
|
| |
"id",
|
| |
"module-testmodule-master-20170219191323-c40c156c",
|
| |
"perl-List-Compare",
|
| |
"perl-List-Compare-0.53-5.module+0+d027b723",
|
| |
)
|
| |
module_build_service.scheduler.handlers.tags.tagged(
|
| |
- config=conf, db_session=db_session, msg=msg)
|
| |
+ db_session=db_session, msg=msg)
|
| |
|
| |
# newRepo should be called now - all successfully built
|
| |
# components have been tagged.
|
| |
@@ -327,69 +328,69 @@
|
| |
db_session.commit()
|
| |
|
| |
# Tag the first component to the buildroot.
|
| |
- msg = module_build_service.messaging.KojiTagChange(
|
| |
+ msg = KojiTagChange(
|
| |
"id",
|
| |
"module-testmodule-master-20170219191323-c40c156c-build",
|
| |
"perl-Tangerine",
|
| |
"perl-Tangerine-0.23-1.module+0+d027b723",
|
| |
)
|
| |
module_build_service.scheduler.handlers.tags.tagged(
|
| |
- config=conf, db_session=db_session, msg=msg)
|
| |
+ db_session=db_session, msg=msg)
|
| |
# Tag the first component to the final tag.
|
| |
- msg = module_build_service.messaging.KojiTagChange(
|
| |
+ msg = KojiTagChange(
|
| |
"id",
|
| |
"module-testmodule-master-20170219191323-c40c156c",
|
| |
"perl-Tangerine",
|
| |
"perl-Tangerine-0.23-1.module+0+d027b723",
|
| |
)
|
| |
module_build_service.scheduler.handlers.tags.tagged(
|
| |
- config=conf, db_session=db_session, msg=msg)
|
| |
+ db_session=db_session, msg=msg)
|
| |
|
| |
# newRepo should not be called, because there are still components
|
| |
# to tag.
|
| |
assert not koji_session.newRepo.called
|
| |
|
| |
# Tag the second component to the buildroot.
|
| |
- msg = module_build_service.messaging.KojiTagChange(
|
| |
+ msg = KojiTagChange(
|
| |
"id",
|
| |
"module-testmodule-master-20170219191323-c40c156c-build",
|
| |
"perl-List-Compare",
|
| |
"perl-List-Compare-0.53-5.module+0+d027b723",
|
| |
)
|
| |
module_build_service.scheduler.handlers.tags.tagged(
|
| |
- config=conf, db_session=db_session, msg=msg)
|
| |
+ db_session=db_session, msg=msg)
|
| |
# Tag the second component to final tag.
|
| |
- msg = module_build_service.messaging.KojiTagChange(
|
| |
+ msg = KojiTagChange(
|
| |
"id",
|
| |
"module-testmodule-master-20170219191323-c40c156c",
|
| |
"perl-List-Compare",
|
| |
"perl-List-Compare-0.53-5.module+0+d027b723",
|
| |
)
|
| |
module_build_service.scheduler.handlers.tags.tagged(
|
| |
- config=conf, db_session=db_session, msg=msg)
|
| |
+ db_session=db_session, msg=msg)
|
| |
|
| |
# newRepo should not be called, because there are still components
|
| |
# to tag.
|
| |
assert not koji_session.newRepo.called
|
| |
|
| |
# Tag the component from first batch to final tag.
|
| |
- msg = module_build_service.messaging.KojiTagChange(
|
| |
+ msg = KojiTagChange(
|
| |
"id",
|
| |
"module-testmodule-master-20170219191323-c40c156c",
|
| |
"module-build-macros",
|
| |
"module-build-macros-0.1-1.module+0+b0a1d1f7",
|
| |
)
|
| |
module_build_service.scheduler.handlers.tags.tagged(
|
| |
- config=conf, db_session=db_session, msg=msg)
|
| |
+ db_session=db_session, msg=msg)
|
| |
# Tag the component from first batch to the buildroot.
|
| |
- msg = module_build_service.messaging.KojiTagChange(
|
| |
+ msg = KojiTagChange(
|
| |
"id",
|
| |
"module-testmodule-master-20170219191323-c40c156c-build",
|
| |
"module-build-macros",
|
| |
"module-build-macros-0.1-1.module+0+b0a1d1f7",
|
| |
)
|
| |
module_build_service.scheduler.handlers.tags.tagged(
|
| |
- config=conf, db_session=db_session, msg=msg)
|
| |
+ db_session=db_session, msg=msg)
|
| |
|
| |
# newRepo should be called now - all components have been tagged.
|
| |
koji_session.newRepo.assert_called_once_with(
|
| |
@@ -454,33 +455,33 @@
|
| |
db_session.commit()
|
| |
|
| |
# Tag the perl-Tangerine component to the buildroot.
|
| |
- msg = module_build_service.messaging.KojiTagChange(
|
| |
+ msg = KojiTagChange(
|
| |
"id",
|
| |
"module-testmodule-master-20170219191323-c40c156c-build",
|
| |
"perl-Tangerine",
|
| |
"perl-Tangerine-0.23-1.module+0+d027b723",
|
| |
)
|
| |
module_build_service.scheduler.handlers.tags.tagged(
|
| |
- config=conf, db_session=db_session, msg=msg)
|
| |
+ db_session=db_session, msg=msg)
|
| |
assert not koji_session.newRepo.called
|
| |
# Tag the perl-List-Compare component to the buildroot.
|
| |
- msg = module_build_service.messaging.KojiTagChange(
|
| |
+ msg = KojiTagChange(
|
| |
"id",
|
| |
"module-testmodule-master-20170219191323-c40c156c-build",
|
| |
"perl-List-Compare",
|
| |
"perl-List-Compare-0.53-5.module+0+d027b723",
|
| |
)
|
| |
module_build_service.scheduler.handlers.tags.tagged(
|
| |
- config=conf, db_session=db_session, msg=msg)
|
| |
+ db_session=db_session, msg=msg)
|
| |
# Tag the perl-List-Compare component to final tag.
|
| |
- msg = module_build_service.messaging.KojiTagChange(
|
| |
+ msg = KojiTagChange(
|
| |
"id",
|
| |
"module-testmodule-master-20170219191323-c40c156c",
|
| |
"perl-List-Compare",
|
| |
"perl-List-Compare-0.53-5.module+0+d027b723",
|
| |
)
|
| |
module_build_service.scheduler.handlers.tags.tagged(
|
| |
- config=conf, db_session=db_session, msg=msg)
|
| |
+ db_session=db_session, msg=msg)
|
| |
|
| |
# newRepo should be called now - all successfully built
|
| |
# components have been tagged.
|
| |
@@ -553,41 +554,41 @@
|
| |
db_session.commit()
|
| |
|
| |
# Tag the first component to the buildroot.
|
| |
- msg = module_build_service.messaging.KojiTagChange(
|
| |
+ msg = KojiTagChange(
|
| |
"id",
|
| |
"module-testmodule-master-20170219191323-c40c156c-build",
|
| |
"perl-Tangerine",
|
| |
"perl-Tangerine-0.23-1.module+0+d027b723",
|
| |
)
|
| |
module_build_service.scheduler.handlers.tags.tagged(
|
| |
- config=conf, db_session=db_session, msg=msg)
|
| |
+ db_session=db_session, msg=msg)
|
| |
# Tag the first component to the final tag.
|
| |
- msg = module_build_service.messaging.KojiTagChange(
|
| |
+ msg = KojiTagChange(
|
| |
"id",
|
| |
"module-testmodule-master-20170219191323-c40c156c",
|
| |
"perl-Tangerine",
|
| |
"perl-Tangerine-0.23-1.module+0+d027b723",
|
| |
)
|
| |
module_build_service.scheduler.handlers.tags.tagged(
|
| |
- config=conf, db_session=db_session, msg=msg)
|
| |
+ db_session=db_session, msg=msg)
|
| |
# Tag the second component to the buildroot.
|
| |
- msg = module_build_service.messaging.KojiTagChange(
|
| |
+ msg = KojiTagChange(
|
| |
"id",
|
| |
"module-testmodule-master-20170219191323-c40c156c-build",
|
| |
"perl-List-Compare",
|
| |
"perl-List-Compare-0.53-5.module+0+d027b723",
|
| |
)
|
| |
module_build_service.scheduler.handlers.tags.tagged(
|
| |
- config=conf, db_session=db_session, msg=msg)
|
| |
+ db_session=db_session, msg=msg)
|
| |
# Tag the second component to the final tag.
|
| |
- msg = module_build_service.messaging.KojiTagChange(
|
| |
+ msg = KojiTagChange(
|
| |
"id",
|
| |
"module-testmodule-master-20170219191323-c40c156c",
|
| |
"perl-List-Compare",
|
| |
"perl-List-Compare-0.53-5.module+0+d027b723",
|
| |
)
|
| |
module_build_service.scheduler.handlers.tags.tagged(
|
| |
- config=conf, db_session=db_session, msg=msg)
|
| |
+ db_session=db_session, msg=msg)
|
| |
|
| |
# All components are tagged, newRepo should be called if there are no active tasks.
|
| |
if expect_new_repo:
|
| |