pub struct Config {Show 13 fields
pub name: String,
pub modules: Vec<ModuleConfig>,
pub homeserver: HomeserverConfig,
pub up: Option<UpScript>,
pub run: Option<Script>,
pub down: Option<DownScript>,
pub docker: DockerConfig,
pub users: Vec<User>,
pub synapse: SynapseVersion,
pub credentials: DockerCredentials,
pub directories: Directories,
pub workers: WorkersConfig,
pub autoclean_on_error: bool,
}
Expand description
The contents of a mx-tester.yaml
Fields§
§name: String
A name for this test.
This name is used to generate images, Docker networks, etc.
modules: Vec<ModuleConfig>
Modules to install in Synapse.
homeserver: HomeserverConfig
Values to pass through into the homeserver.yaml for this synapse.
up: Option<UpScript>
A script to run at the end of the setup phase.
run: Option<Script>
The testing script to run.
down: Option<DownScript>
A script to run at the start of the teardown phase.
docker: DockerConfig
Configuration for the docker network.
users: Vec<User>
Any users to register and make available
synapse: SynapseVersion
The version of Synapse to use
credentials: DockerCredentials
Information for logging to a registry.
May be overridden from the command-line.
directories: Directories
Directories to use for the test.
May be overridden from the command-line.
workers: WorkersConfig
Specify whether workers should be used.
May be overridden from the command-line.
autoclean_on_error: bool
Specify whether workers should be used.
May be overridden from the command-line.
Implementations§
Source§impl Config
impl Config
Sourcepub fn builder() -> ConfigBuilder<((), (), (), (), (), (), (), (), (), (), (), (), ())>
pub fn builder() -> ConfigBuilder<((), (), (), (), (), (), (), (), (), (), (), (), ())>
Create a builder for building Config
.
On the builder, call .name(...)
, .modules(...)
(optional), .homeserver(...)
(optional), .up(...)
(optional), .run(...)
(optional), .down(...)
(optional), .docker(...)
(optional), .users(...)
(optional), .synapse(...)
(optional), .credentials(...)
(optional), .directories(...)
(optional), .workers(...)
(optional), .autoclean_on_error(...)
(optional) to set the values of the fields.
Finally, call .build()
to create the instance of Config
.
Source§impl Config
impl Config
Create a map containing the environment variables that are common to all scripts.
Callers may add additional variables that are specific to a given script step.
Sourcepub fn patch_homeserver_config(&self) -> Result<(), Error>
pub fn patch_homeserver_config(&self) -> Result<(), Error>
Patch the homeserver.yaml at the given path (usually one that has been generated by synapse) with the properties in this struct (which will usually have been provided from mx-tester.yaml)
In multiple workers mode, also patch the worker files.
pub fn patch_homeserver_config_content( &self, config: &mut Mapping, ) -> Result<(), Error>
Sourcepub fn test_root(&self) -> PathBuf
pub fn test_root(&self) -> PathBuf
The directory in which we’re putting all data for this test.
Cleaned up upon test start.
Sourcepub fn synapse_root(&self) -> PathBuf
pub fn synapse_root(&self) -> PathBuf
The directory in which we’re putting everything related to synapse data for this test.
Sourcepub fn synapse_data_dir(&self) -> PathBuf
pub fn synapse_data_dir(&self) -> PathBuf
The directory in which Synapse may write data.
Sourcepub fn synapse_workers_dir(&self) -> PathBuf
pub fn synapse_workers_dir(&self) -> PathBuf
The directory in which we’re putting the configuration of workers for this test.
Sourcepub fn etc_dir(&self) -> PathBuf
pub fn etc_dir(&self) -> PathBuf
The directory in which we’re putting files that go to subdirectories of /etc in in the guest.
pub fn scripts_logs_dir(&self) -> PathBuf
Sourcepub fn setup_container_name(&self) -> String
pub fn setup_container_name(&self) -> String
The name for the container we’re using to setup Synapse.
Sourcepub fn run_container_name(&self) -> String
pub fn run_container_name(&self) -> String
The name for the container we’re using to actually run Synapse.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more