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

SDKQE-3460 :- Add dapi alpha api's tests #218

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

CosmicSaaurabh
Copy link

No description provided.

@@ -11,3 +14,757 @@ func (s *GatewayOpsTestSuite) TestDapiAlphaEnabled() {
})
requireRestSuccess(s.T(), resp)
}

func (s *GatewayOpsTestSuite) insertBinaryDocument() string {
Copy link
Member

Choose a reason for hiding this comment

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

This should probably be using one of the existing test functions that exist for pushing document contents to the cluster for tests. Alternatively if there is some specific reason for having this use the DAPI mechanism, it should likely use a normal POST with Content-Type of binary to reflect the actual name of the method (insert as opposed to increment).

assertRestValidMutationToken(s.T(), resp, s.bucketName)

// Verify the key-value is present
resp = s.sendTestHttpRequest(&testHttpRequest{
Copy link
Member

Choose a reason for hiding this comment

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

This should reuse the existing validation methods that are built into the test framework (see the POST/GET/PUT tests in dapi_crud_test.go).

assert.Contains(s.T(), string(resp.Body), string(TEST_APPEND_CONTENT))
})

s.Run("Forbidden", func() {
Copy link
Member

Choose a reason for hiding this comment

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

This test appears to be testing an output of the endpoint as opposed to testing the specific case. I believe there are a couple of cases which will lead to Forbidden such as InvalidAuth, Unauthenticated and PermissionDenied. See dapi_crud_test.go for examples of these. Additionally, I believe the test framework includes a mechanism for automatically running all these common failure cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants