@@ -99,15 +99,15 @@ func deploymentSubTest(t *testing.T, mode api.DeploymentMode, engine api.Storage
9999 return nil
100100}
101101
102- // test setup containing multiple deployments
103- func TestMultiDeployment1 (t * testing.T ) {
102+ // test a setup containing multiple deployments
103+ func TestMultiDeployment (t * testing.T ) {
104104 longOrSkip (t )
105105
106106 k8sNameSpace := getNamespace (t )
107107 k8sClient := mustNewKubeClient (t )
108108 deploymentClient := kubeArangoClient .MustNewInCluster ()
109109
110- // Prepare deployment config
110+ // Prepare deployment configurations
111111 deploymentTemplate1 := newDeployment ("test-multidep1-1-" + uniuri .NewLen (4 ))
112112 deploymentTemplate1 .Spec .Mode = api .NewMode (api .DeploymentModeCluster )
113113 deploymentTemplate1 .Spec .StorageEngine = api .NewStorageEngine (api .StorageEngineRocksDB )
@@ -120,27 +120,28 @@ func TestMultiDeployment1(t *testing.T) {
120120 deploymentTemplate2 .Spec .TLS = api.TLSSpec {} // should auto-generate cert
121121 deploymentTemplate2 .Spec .SetDefaults (deploymentTemplate2 .GetName ()) // this must be last
122122
123- // Create deployment
123+ // Create deployments
124124 _ , err := deploymentClient .DatabaseV1alpha ().ArangoDeployments (k8sNameSpace ).Create (deploymentTemplate1 )
125125 assert .NoError (t , err , fmt .Sprintf ("Deployment creation failed: %v" , err ))
126126
127127 _ , err = deploymentClient .DatabaseV1alpha ().ArangoDeployments (k8sNameSpace ).Create (deploymentTemplate2 )
128128 assert .NoError (t , err , fmt .Sprintf ("Deployment creation failed: %v" , err ))
129129
130- // Wait for deployment to be ready
130+ // Wait for deployments to be ready
131131 deployment1 , err := waitUntilDeployment (deploymentClient , deploymentTemplate1 .GetName (), k8sNameSpace , deploymentIsReady ())
132132 assert .NoError (t , err , fmt .Sprintf ("Deployment not running in time: %v" , err ))
133133
134134 deployment2 , err := waitUntilDeployment (deploymentClient , deploymentTemplate2 .GetName (), k8sNameSpace , deploymentIsReady ())
135135 assert .NoError (t , err , fmt .Sprintf ("Deployment not running in time: %v" , err ))
136136
137- // Create a database client
137+ // Create a database clients
138138 ctx := context .Background ()
139139 DBClient1 := mustNewArangodDatabaseClient (ctx , k8sClient , deployment1 , t )
140140 assert .NoError (t , waitUntilArangoDeploymentHealthy (deployment1 , DBClient1 , k8sClient , "" ), fmt .Sprintf ("Deployment not healthy in time: %v" , err ))
141141 DBClient2 := mustNewArangodDatabaseClient (ctx , k8sClient , deployment2 , t )
142142 assert .NoError (t , waitUntilArangoDeploymentHealthy (deployment1 , DBClient1 , k8sClient , "" ), fmt .Sprintf ("Deployment not healthy in time: %v" , err ))
143143
144+ // Test if we are able to create a collections in both deployments.
144145 db1 , err := DBClient1 .Database (ctx , "_system" )
145146 assert .NoError (t , err , "failed to get database" )
146147 _ , err = db1 .CreateCollection (ctx , "col1" , nil )
@@ -151,6 +152,8 @@ func TestMultiDeployment1(t *testing.T) {
151152 _ , err = db2 .CreateCollection (ctx , "col2" , nil )
152153 assert .NoError (t , err , "failed to create collection" )
153154
155+ // The newly created collections must be (only) visible in the deployment
156+ // that it was created in. The following lines ensure this behavior.
154157 collections1 , err := db1 .Collections (ctx )
155158 assert .NoError (t , err , "failed to get collections" )
156159 collections2 , err := db2 .Collections (ctx )
0 commit comments