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

php: Add tests for more S3 APIs #78

Merged
merged 1 commit into from
Jul 6, 2017
Merged

Conversation

krisis
Copy link
Member

@krisis krisis commented Jul 5, 2017

  • HeadObject
  • ListObjects
  • ListObjectsV2
  • ListMultipartUploads
  • ListParts
  • UploadPartCopy

}

/**
* testListMultipartUploads tests ListMultipartUploads, ListParts and
Copy link
Member

Choose a reason for hiding this comment

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

Avoided this test on purpose, This won't work on GCS and we also planning the same style for FS backend as well. We can avoid ListMultipartUploads for now.

Copy link
Member Author

Choose a reason for hiding this comment

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

@harshavardhana ListMultipartUploads and ListParts will work on GCS gateway and FS mode (once the backend format changes land in master). They will return an empty response, which doesn't result in failure of this test. Also, erasure code backend will return the list of ongoing multipart uploads as expected and needs to be tested. Since this test is only invoking these list APIs without making any assumption about the response it is OK to have these.

Copy link
Member

Choose a reason for hiding this comment

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

If you are only looking for 200 OK please add a comment and update why you don't validate the results. Also does the paginator return exception upon non 200 OK?

Copy link
Member Author

Choose a reason for hiding this comment

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

Added a comment explaining why we are not verifying the contents of ListMultipartUploads response.

Also does the paginator return exception upon non 200 OK?

yes

Copy link
Member Author

Choose a reason for hiding this comment

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

@harshavardhana

Also does the paginator return exception upon non 200 OK?

I can't find a document that explicitly says so about paginators but https://docs.aws.amazon.com/aws-sdk-php/v3/guide/getting-started/basic-usage.html outlines how the SDK treats successful API operation Vs unsuccessful ones.
My understanding is that paginators would throw an exception when they see one.

}

$paginator = $s3Client->getPaginator('ListObjects', ['Bucket' => $bucket]);
foreach ($paginator->search('Contents[].Key') as $key) {
Copy link
Member

Choose a reason for hiding this comment

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

Can you add negative test cases for listObjects as well? or are they already added?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

}

// Run failure tests
$params = [
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't you validate headObject() for the resultant metadata returned as well?

@nitisht
Copy link
Contributor

nitisht commented Jul 6, 2017

@krisis not exactly related to this PR but I wanted to add another point here. Could you pls add logging to stdout for success cases, probably a simple Running test xyz will be enough for each test case.

Currently this is the only output in aws-sdk-php logs

nitish@torch:~/dev/release/gcs-logs/log/aws-sdk-php$ cat output.log 
4cfca5244d86
4f398d4aaaf7
655a76c3bfb8
7srz3a0a2ax0dbewk84hxvwvowy0u45m
aws-sdk-php-bucket-04123
aws-sdk-php-bucket-21340
bpedze5t67konanbv1vsjlhypbwrtjh7
bqaogawgtw5fcpeoaweb9no9tmmwh7rd
ece2d3b2e999
ersan1
ersan2
foggybank
j9x0sgatffjetvacbavtchxj3twicvig
k0plbm4bj49mkr8d1okpeznh6s8hwptl
krisis1
lvtx4p1xrciwnvnsokoq1nbqtee0x8ex
minio-go-test25stcjh4tf51jh1ez
minio-go-test4obkzfwanhi1usikr
minio-go-testaif4ykqzxtiedb39l
minio-go-testbztukvwotwkak4h2h
minio-go-testdqefu125pht3ztozo
minio-go-testku54jld3aeh4sova4
minio-go-testotlmqxeqf0cdznvug
minio-go-testwrk35ju6bgckmzflt
minio-go-testyb9kim3x03bre23gz
minio-java-test-3jm4heg
minio-java-test-fhp46m
miniodotnet4z3kfk09iccbvst
miniodotneta7tmc1zm14aq6jg
miniodotnetao2ob1l8odtokd6
miniodotnethz1ip5tvldqvddd
miniodotnetolqj56gbkdxclgb
miniodotnetqgdg1c0e0xlr0sd
miniodotnetsg8yq0xyjnuugsu
muddyriver
vmmis6ekienoyuxtgbmymmiuakm8yp3c
wv3y4cmueina4xvpw61ivkmwkj013wp9

@krisis
Copy link
Member Author

krisis commented Jul 6, 2017

@nitisht added logging support.

- HeadObject
- ListObjects
- ListObjectsV2
- ListMultipartUploads
- ListParts
- UploadPartCopy
@nitisht
Copy link
Contributor

nitisht commented Jul 6, 2017

@harshavardhana are your comments addressed here?

Copy link
Member

@harshavardhana harshavardhana left a comment

Choose a reason for hiding this comment

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

LGTM

@nitisht nitisht merged commit d22d492 into minio:master Jul 6, 2017
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.

None yet

3 participants