def test_helm_upgrade(chart_info): builder = ChartBuilder(chart_info, []) with ChartInstallationContext(builder): # Check helm release builder.upgrade_chart() helm_installation = get_helm_installations() assert helm_installation["NAME"][0] == "test" assert helm_installation["REVISION"][0] == "2" assert helm_installation["STATUS"][0] == "deployed" assert helm_installation["NAMESPACE"][0] == "default"
def test_helm_upgrade_w_dependencies(chart_info, grafana_dependency): builder = ChartBuilder( ChartInfo( api_version="3.2.4", name="test", version="0.1.0", app_version="v1", dependencies=[grafana_dependency], ), [], ) with ChartInstallationContext(builder): builder.upgrade_chart(options={"dependency-update": None}) helm_installation = get_helm_installations() assert helm_installation["NAME"][0] == "test" assert helm_installation["REVISION"][0] == "2" assert helm_installation["STATUS"][0] == "deployed" assert helm_installation["NAMESPACE"][0] == "default" remove_stable_repo()
def test_raises_when_invalid_upgrade_parameter_passed(chart_info, config_map): builder = ChartBuilder(chart_info, [config_map]) builder.install_chart() with pytest.raises(HelmError): builder.upgrade_chart(options={"my-invalid-option": "hello"})
def test_chart_not_installed_error(chart_info, config_map): builder = ChartBuilder(chart_info, [config_map]) with pytest.raises(ChartNotInstalledError): builder.upgrade_chart()