mirror of
https://github.com/element-hq/ess-helm.git
synced 2026-12-03 07:12:39 -08:00
run integration tests on syn2mas job
This commit is contained in:
2 files changed
+69
No files matched your search
@@ -0,0 +1,5 @@
|
||||
# Copyright 2025 New Vector Ltd
|
||||
#
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
export TEST_VALUES_FILE=charts/matrix-stack/ci/pytest-matrix-authentication-service-syn2mas-values.yaml
|
||||
@@ -0,0 +1,64 @@
|
||||
# Copyright 2024 New Vector Ltd
|
||||
#
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import os
|
||||
|
||||
import pyhelm3
|
||||
import pytest
|
||||
|
||||
from .fixtures import ESSData
|
||||
from .lib.utils import value_file_has
|
||||
from .test_matrix_authentication_service import test_matrix_authentication_service_graphql_endpoint
|
||||
|
||||
|
||||
@pytest.mark.skipif(value_file_has("synapse.enabled", False), reason="Synapse not deployed")
|
||||
@pytest.mark.skipif(value_file_has("matrixAuthenticationService.syn2mas.enabled", False), reason="Syn2Mas not deployed")
|
||||
@pytest.mark.asyncio_cooperative
|
||||
async def test_run_syn2mas_upgrade(
|
||||
helm_client: pyhelm3.Client,
|
||||
ingress_ready,
|
||||
ssl_context,
|
||||
generated_data: ESSData,
|
||||
):
|
||||
await ingress_ready("synapse")
|
||||
# After the base chart is setup, we enable MAS to run the syn2mas dry run job
|
||||
|
||||
revision = await helm_client.get_current_revision(
|
||||
generated_data.release_name, namespace=generated_data.ess_namespace
|
||||
)
|
||||
values = await revision.values()
|
||||
values["matrixAuthenticationService"]["enabled"] = True
|
||||
chart = await helm_client.get_chart("charts/matrix-stack")
|
||||
# Install or upgrade a release
|
||||
revision = await helm_client.install_or_upgrade_release(
|
||||
generated_data.release_name,
|
||||
chart,
|
||||
values,
|
||||
namespace=generated_data.ess_namespace,
|
||||
atomic="CI" not in os.environ,
|
||||
wait=True,
|
||||
)
|
||||
assert revision.status == pyhelm3.ReleaseRevisionStatus.DEPLOYED
|
||||
# We should still be able to reach synapse ingress
|
||||
await ingress_ready("synapse")
|
||||
# We then run the final migration
|
||||
revision = await helm_client.get_current_revision(
|
||||
generated_data.release_name, namespace=generated_data.ess_namespace
|
||||
)
|
||||
values = await revision.values()
|
||||
values["matrixAuthenticationService"]["syn2mas"].setdefault("migrate")["dryRun"] = False
|
||||
chart = await helm_client.get_chart("charts/matrix-stack")
|
||||
# Install or upgrade a release
|
||||
revision = await helm_client.install_or_upgrade_release(
|
||||
generated_data.release_name,
|
||||
chart,
|
||||
values,
|
||||
namespace=generated_data.ess_namespace,
|
||||
atomic="CI" not in os.environ,
|
||||
wait=True,
|
||||
)
|
||||
assert revision.status == pyhelm3.ReleaseRevisionStatus.DEPLOYED
|
||||
|
||||
# MAS should be available
|
||||
await test_matrix_authentication_service_graphql_endpoint(ingress_ready, generated_data, ssl_context)
|
||||
Reference in new issue
Block a user