mirror of
https://github.com/element-hq/ess-helm.git
synced 2026-11-21 09:31:28 -08:00
- Each secret can exist either inline or in config - This discovers secrets and prompt for missing ones - Secrets are outputed in dedicated files - Helm Values will refer to the secret data imported in kubernetes
54 lines
1.5 KiB
Python
54 lines
1.5 KiB
Python
# Copyright 2026 Element Creations Ltd
|
|
#
|
|
# SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
|
"""
|
|
Pytest fixtures for migration tests.
|
|
Centralizes common test configurations to reduce duplication.
|
|
"""
|
|
|
|
import pytest
|
|
import yaml
|
|
|
|
|
|
@pytest.fixture
|
|
def basic_synapse_config():
|
|
"""Basic Synapse configuration for testing."""
|
|
return {
|
|
"server_name": "test.example.com",
|
|
"public_baseurl": "https://matrix.example.com",
|
|
"database": {
|
|
"args": {"database": "synapse", "user": "synapse", "host": "postgres", "port": 5432, "password": "test"}
|
|
},
|
|
"macaroon_secret_key": "test_macaroon_secret",
|
|
"registration_shared_secret": "test_registration_secret",
|
|
}
|
|
|
|
|
|
@pytest.fixture
|
|
def write_synapse_config(tmp_path):
|
|
"""Helper fixture to write a Synapse config file."""
|
|
|
|
def _write_config(config_data):
|
|
synapse_config_file = tmp_path / "synapse.yaml"
|
|
with open(synapse_config_file, "w") as f:
|
|
yaml.dump(config_data, f)
|
|
return synapse_config_file
|
|
|
|
return _write_config
|
|
|
|
|
|
@pytest.fixture
|
|
def synapse_config_with_signing_key(tmp_path, basic_synapse_config):
|
|
"""Synapse configuration with a signing key file."""
|
|
# Create signing key file
|
|
signing_key_file = tmp_path / "signing.key"
|
|
signing_key_file.write_text("test_signing_key_content")
|
|
|
|
# Add signing key to config
|
|
config = basic_synapse_config.copy()
|
|
config["signing_key_path"] = str(signing_key_file)
|
|
|
|
return config
|