本文整理汇总了Python中atomic_reactor.inner.DockerBuildWorkflow.postbuild_results方法的典型用法代码示例。如果您正苦于以下问题:Python DockerBuildWorkflow.postbuild_results方法的具体用法?Python DockerBuildWorkflow.postbuild_results怎么用?Python DockerBuildWorkflow.postbuild_results使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类atomic_reactor.inner.DockerBuildWorkflow
的用法示例。
在下文中一共展示了DockerBuildWorkflow.postbuild_results方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_metadata_plugin
# 需要导入模块: from atomic_reactor.inner import DockerBuildWorkflow [as 别名]
# 或者: from atomic_reactor.inner.DockerBuildWorkflow import postbuild_results [as 别名]
def test_metadata_plugin(tmpdir):
def set_annotations_on_build(build_id, labels):
pass
new_environ = deepcopy(os.environ)
new_environ["BUILD"] = '{"metadata": {"name": "asd"}}'
flexmock(OSBS, set_annotations_on_build=set_annotations_on_build)
flexmock(os)
os.should_receive("environ").and_return(new_environ)
workflow = DockerBuildWorkflow({"provider": "git", "uri": "asd"}, "test-image")
workflow.push_conf.add_pulp_registry("test", LOCALHOST_REGISTRY)
workflow.tag_conf.add_primary_image(TEST_IMAGE)
workflow.tag_conf.add_unique_image("namespace/image:asd123")
setattr(workflow, 'builder', X)
workflow.build_logs = ["a", "b"]
workflow.source.lg = LazyGit(None, commit="commit")
flexmock(workflow.source.lg)
workflow.source.lg.should_receive("_commit_id").and_return("commit")
workflow.prebuild_results = {
CpDockerfilePlugin.key: "dockerfile-content",
DistgitFetchArtefactsPlugin.key: "artefact1\nartefact2",
}
workflow.postbuild_results = {
PostBuildRPMqaPlugin.key: "rpm1\nrpm2",
}
runner = PostBuildPluginsRunner(
None,
workflow,
[{
'name': StoreMetadataInOSv3Plugin.key,
"args": {
"url": "http://example.com/"
}
}]
)
output = runner.run()
assert StoreMetadataInOSv3Plugin.key in output
labels = output[StoreMetadataInOSv3Plugin.key]
assert "dockerfile" in labels
assert "artefacts" in labels
assert "logs" in labels
assert "rpm-packages" in labels
assert "repositories" in labels
assert "commit_id" in labels