Exemple #1
0
def test_lifecycle_hooks_deployment(_: mock.MagicMock) -> None:
    ns = track = "testing"
    project = Project(track=track, url="example.com")
    service = mock.MagicMock()

    k = Kubernetes(track=track)
    k.helm = mock.MagicMock(**{"upgrade_chart.return_value.return_code": 0})
    mock.patch("kolga.libs.kubernetes.KubeLoggerThread")

    Plugin, hook_calls = call_tracking_plugin_factory()
    with load_plugin(Plugin):
        k.deploy_service(namespace=ns, service=service, track=track)
        k.create_application_deployment(namespace=ns,
                                        project=project,
                                        track=track)

    assert [*hook_calls.keys()] == [
        "service_deployment_begin",
        "service_deployment_complete",
        "project_deployment_begin",
        "project_deployment_complete",
    ]
Exemple #2
0
def kubernetes() -> Kubernetes:
    return Kubernetes()