Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add test for different deployments #64

Merged
merged 2 commits into from
Mar 26, 2018
Merged

Conversation

ObiWahn
Copy link
Contributor

@ObiWahn ObiWahn commented Mar 22, 2018

No description provided.

@ObiWahn ObiWahn force-pushed the test/different-deployments branch 9 times, most recently from 89ded28 to 6081d4f Compare March 23, 2018 10:28
@ObiWahn
Copy link
Contributor Author

ObiWahn commented Mar 23, 2018

Should tests that contain multiple deployments at the same time be added here?

Copy link
Contributor

@ewoutp ewoutp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of comments, mostly because of changes in master.


// Prepare deployment config
deploymentTemplate := newDeployment("test-1-deployment-" + string(mode) + "-" + string(engine) + "-" + uniuri.NewLen(4))
deploymentTemplate.Spec.Mode = mode
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please merge in master.
After that, this code will no longer compile since Mode & StorageEngine are now references.
Fix it like this:

deploymentTemplate.Spec.Mode = api.NewMode(mode)
deploymentTemplate.Spec.StorageEngine = api.NewStorageEngine(engine)


k8sNameSpace := getNamespace(t)
k8sClient := mustNewKubeClient(t)
deploymentClient := kubeArangoClient.MustNewInCluster() //
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// without comment
either remove or fill in comment

DBClient := mustNewArangodDatabaseClient(ctx, k8sClient, deployment, t)

// deployment checks
if deployment.Spec.Mode == api.DeploymentModeCluster {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After master merge, change deployment.Spec.Mode to deployment.Spec.GetMode()

}); err != nil {
t.Fatalf("Cluster not running in expected health in time: %v", err)
}
} else if deployment.Spec.Mode == api.DeploymentModeSingle {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

t.Fatalf("Single Server not running in time: %v", err)
}
} else {
t.Fatalf("DeploymentMode %v is not supported!", deployment.Spec.Mode)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here


// environements: provided from outside

func TestDeploymentSingleMMFiles(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All exported functions must have a comment.
For test functions, explain what the test is intended to test.
This could be "// TestDeploymentSingleMMFiles tests the successful creation of a deployment of a single server with mmfiles storage engine"

@ObiWahn ObiWahn force-pushed the test/different-deployments branch from 76f42c2 to 6ee0b23 Compare March 26, 2018 05:37
@ObiWahn ObiWahn merged commit 6ee0b23 into master Mar 26, 2018
@ObiWahn ObiWahn deleted the test/different-deployments branch March 29, 2018 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants