def test_derive_supply_requirements_es_and_plugin_source_build(self): # corresponds to --revision="elasticsearch:abc,community-plugin:effab" core_plugin = team.PluginDescriptor("analysis-icu", core_plugin=True) external_plugin = team.PluginDescriptor("community-plugin", core_plugin=False) requirements = supplier._supply_requirements( sources=True, distribution=False, build=True, plugins=[core_plugin, external_plugin], revisions={ "elasticsearch": "abc", "all": "abc", "community-plugin": "effab" }, distribution_version=None) self.assertDictEqual( { "elasticsearch": ("source", "abc", True), # core plugin configuration is forced to be derived from ES "analysis-icu": ("source", "abc", True), "community-plugin": ("source", "effab", True), }, requirements)
def test_derive_supply_requirements_es_source_build(self): # corresponds to --revision="abc" requirements = supplier._supply_requirements( sources=True, distribution=False, plugins=[], revisions={"elasticsearch": "abc"}, distribution_version=None) assert requirements == {"elasticsearch": ("source", "abc", True)}
def test_derive_supply_requirements_es_distribution(self): # corresponds to --distribution-version=6.0.0 requirements = supplier._supply_requirements( sources=False, distribution=True, plugins=[], revisions={}, distribution_version="6.0.0") self.assertDictEqual( {"elasticsearch": ("distribution", "6.0.0", False)}, requirements)
def test_derive_supply_requirements_es_source_skip(self): # corresponds to --pipeline=from-sources-skip-build requirements = supplier._supply_requirements( sources=True, distribution=False, build=False, plugins=[], revisions={"elasticsearch": "current"}, distribution_version=None) self.assertDictEqual({"elasticsearch": ("source", "current", False)}, requirements)
def test_derive_supply_requirements_es_distribution_and_plugin_source_skip(self): # corresponds to --from-sources-skip-build --revision="community-plugin:current" --distribution-version="6.0.0" core_plugin = team.PluginDescriptor("analysis-icu", core_plugin=True) external_plugin = team.PluginDescriptor("community-plugin", core_plugin=False) requirements = supplier._supply_requirements(sources=True, distribution=False, build=False, plugins=[core_plugin, external_plugin], revisions={"community-plugin": "current"}, distribution_version="6.0.0") self.assertDictEqual({ "elasticsearch": ("distribution", "6.0.0", False), # core plugin configuration is forced to be derived from ES "analysis-icu": ("distribution", "6.0.0", False), "community-plugin": ("source", "current", False), }, requirements)
def test_derive_supply_requirements_es_distribution_and_plugin_source_build( self): # corresponds to --revision="community-plugin:effab" --distribution-version="6.0.0" core_plugin = team.PluginDescriptor("analysis-icu", core_plugin=True) external_plugin = team.PluginDescriptor("community-plugin", core_plugin=False) requirements = supplier._supply_requirements( sources=False, distribution=True, plugins=[core_plugin, external_plugin], revisions={"community-plugin": "effab"}, distribution_version="6.0.0", ) # core plugin is not contained, its configured is forced to be derived by ES assert requirements == { "elasticsearch": ("distribution", "6.0.0", False), # core plugin configuration is forced to be derived from ES "analysis-icu": ("distribution", "6.0.0", False), "community-plugin": ("source", "effab", True), }