Skip to content

Commit 255825b

Browse files
authored
Allow to specify the storage enginge when running e2e tests (#1948)
1 parent b9566b4 commit 255825b

File tree

4 files changed

+19
-1
lines changed

4 files changed

+19
-1
lines changed

e2e/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ TEST_USERNAME?=$(USER)
2323
ENABLE_CHAOS_TESTS?=true
2424
CHAOS_NAMESPACE?=chaos-testing
2525
STORAGE_CLASS?=
26+
STORAGE_ENGINE?=
2627
DUMP_OPERATOR_STATE?=true
2728
# Defines the cloud provider used for the underlying Kubernetes cluster. Currently only kind is support, other cloud providers
2829
# should still work but this test framework has no special cases for those.
@@ -129,4 +130,5 @@ nightly-tests: run
129130
--cloud-provider=$(CLOUD_PROVIDER) \
130131
--dump-operator-state=$(DUMP_OPERATOR_STATE) \
131132
--cluster-name=$(CLUSTER_NAME) \
133+
--storage-engine=$(STORAGE_ENGINE) \
132134
| grep -v 'constructing many client instances from the same exec auth config can cause performance problems during cert rotation' &> $(BASE_DIR)/../logs/$<.log

e2e/fixtures/cluster_config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ func (config *ClusterConfig) SetDefaults(factory *Factory) {
134134
}
135135

136136
if config.StorageEngine == "" {
137-
config.StorageEngine = fdbv1beta2.StorageEngineSSD
137+
config.StorageEngine = factory.getStorageEngine()
138138
}
139139

140140
if config.StorageServerPerPod == 0 {

e2e/fixtures/factory.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -881,3 +881,12 @@ func (fdbCluster *FdbCluster) GetNode(name string) *corev1.Node {
881881

882882
return node
883883
}
884+
885+
// getStorageEngine returns the storage engine that should be used by the test cluster. Defaults to ssd.
886+
func (factory *Factory) getStorageEngine() fdbv1beta2.StorageEngine {
887+
if factory.options.storageEngine == "" {
888+
return fdbv1beta2.StorageEngineSSD
889+
}
890+
891+
return fdbv1beta2.StorageEngine(factory.options.storageEngine)
892+
}

e2e/fixtures/options.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ type FactoryOptions struct {
4545
upgradeString string
4646
cloudProvider string
4747
clusterName string
48+
storageEngine string
4849
enableChaosTests bool
4950
enableDataLoading bool
5051
cleanup bool
@@ -135,6 +136,12 @@ func (options *FactoryOptions) BindFlags(fs *flag.FlagSet) {
135136
"foundationdb/fdb-data-loader:latest",
136137
"defines the data loader image that should be used for testing",
137138
)
139+
fs.StringVar(
140+
&options.storageEngine,
141+
"storage-engine",
142+
"",
143+
"defines the storage-engine that should be used by the created FDB cluster.",
144+
)
138145
fs.BoolVar(
139146
&options.enableChaosTests,
140147
"enable-chaos-tests",

0 commit comments

Comments
 (0)