Class ClusterFixtureOptions
Options for the ClusterFixture.
Namespace: Neon.Kube.Xunit
Assembly: Neon.Kube.Xunit.dll
Syntax
public class ClusterFixtureOptions
Constructors
ClusterFixtureOptions()
Constructor. This initializes the properties to reasonable defaults.
Declaration
public ClusterFixtureOptions()
Properties
CaptureDeploymentLogs
Optionally write the cluster deployment logs to TestOutputHelper.
This defaults to true
.
Declaration
public bool CaptureDeploymentLogs { get; set; }
Property Value
Type | Description |
---|---|
bool |
CloudMarketplace
For cloud environments, this specifies whether the cluster should be provisioned
using a VM image from the public cloud marketplace when true
or from the
private NEONFORGE image gallery for testing when false
. This is ignored
for on-premise environments. This defaults to true
.
note
You must be a NEONKUBE maintainer to use private node images.
Declaration
public bool CloudMarketplace { get; set; }
Property Value
Type | Description |
---|---|
bool |
ImageUriOrPath
Optionally specifies the URI or file path to the node image to be used when deploying the cluster.
This is used to override the default published node image. This default to null
.
Declaration
public string ImageUriOrPath { get; set; }
Property Value
Type | Description |
---|---|
string |
MaxParallel
Optionally specifies the maximum number of operations to be performed in parallel.
This defaults to 500
which is effectively infinite.
Declaration
public int MaxParallel { get; set; }
Property Value
Type | Description |
---|---|
int |
NeonCloudHeadendUri
Optionally overrides the default NEONCLOUD headend URI. This defaults to null
.
Declaration
public string NeonCloudHeadendUri { get; set; }
Property Value
Type | Description |
---|---|
string |
RemoveClusterOnDispose
Controls whether ClusterFixture will remove the cluster after unit test
have finished executing or whether it will delete it. This defaults to false
.
note
This property applies only to clusters deployed by ClusterFixture. Existing clusters will never be removed.
Declaration
public bool RemoveClusterOnDispose { get; set; }
Property Value
Type | Description |
---|---|
bool |
RemoveClusterOnStart
Forces the removal of any existing cluster when the associated ClusterFixture
is started. This defaults to false
.
note
This property applies only to clusters deployed by ClusterFixture. Existing clusters will never be removed.
Declaration
public bool RemoveClusterOnStart { get; set; }
Property Value
Type | Description |
---|---|
bool |
Remarks
For hypervisor hosted clusters, setting this to true
turn off and remove all VMs
that have the same name prefix as is specified by the test cluster definition and for cloud
hosted clusters, the specified resource group will be removed. This ensures that even
partially deployed clusters can be removed.
note
An existing cluster that cannot be managed via an existing kubecontext and cluster login
will always be removed. For clusters that can be managed, ClusterFixture
will compare the cluster definition of the existing cluster with the definition for the
specified test cluster and when these are different, ClusterFixture will
remove the existing cluster when RemoveClusterOnStart is true
or
throw a NeonKubeException when RemoveClusterOnStart is
false
.
ResetOptions
Specifies the options that ResetCluster() will use when resetting the target cluster. This defaults to the stock ClusterResetOptions which performs a full cluster reset.
Declaration
public ClusterResetOptions ResetOptions { get; set; }
Property Value
Type | Description |
---|---|
ClusterResetOptions |
TestOutputHelper
Optionally specifies a Xunit.Abstractions.ITestOutputHelper where ClusterFixture can write diagnostics including the cluster deployment logs.
Declaration
public ITestOutputHelper TestOutputHelper { get; set; }
Property Value
Type | Description |
---|---|
ITestOutputHelper |
Unredacted
Optionally disables the redaction of potentially sensitive information from cluster
deployment logs. This defaults to false
.
Declaration
public bool Unredacted { get; set; }
Property Value
Type | Description |
---|---|
bool |
Methods
Clone()
Returns a copy of the instance.
Declaration
public ClusterFixtureOptions Clone()
Returns
Type | Description |
---|---|
ClusterFixtureOptions | The cloned instance. |