From 044590f9e370de565aed04812f6889d04781e7e3 Mon Sep 17 00:00:00 2001 From: ellie timoney Date: Wed, 11 Sep 2024 12:02:44 +1000 Subject: [PATCH] WIP TestCase: run magic much earlier this allows the want->needs mappings to work, but all the "magic attribute sets config..." logging now happens at cassandane startup instead of when the test actually runs, which is pretty annoying --- cassandane/Cassandane/Cyrus/TestCase.pm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/cassandane/Cassandane/Cyrus/TestCase.pm b/cassandane/Cassandane/Cyrus/TestCase.pm index e120747e3c..c3cbe4ea85 100644 --- a/cassandane/Cassandane/Cyrus/TestCase.pm +++ b/cassandane/Cassandane/Cyrus/TestCase.pm @@ -139,6 +139,13 @@ sub new $self->want($name, $value) if $value; } + # initialise config and run magic early, so needs are determined before + # we try to use them to skip tests whose features are missing + my $config = $self->{_instance_params}->{config} + || Cassandane::Config->default(); + $self->{_config} = $config->clone(); + $self->_run_magic(); + return $self; } @@ -585,11 +592,6 @@ sub _create_instances my $backend2_service_port; my $backupd_port; - $self->{_config} = $self->{_instance_params}->{config} || Cassandane::Config->default(); - $self->{_config} = $self->{_config}->clone(); - - $self->_run_magic(); - my $want = $self->{_want}; my %instance_params = %{$self->{_instance_params}};