-
Notifications
You must be signed in to change notification settings - Fork 622
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
Fixes log format issues #865
Conversation
functional_tests.go
Outdated
return | ||
} | ||
|
||
args["destination"] = dst | ||
// Set args["sourceList"] to "" to stop having 10,001 null headers logged | ||
args["sourceList"] = "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could say something like "source array of 10001 elements".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
functional_tests.go
Outdated
|
||
testName := getFuncName() | ||
function := "ComposeObject(destination, sourceList)" | ||
args := map[string]interface{}{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
functional_tests.go
Outdated
args := map[string]interface{}{} | ||
testName := getFuncName() | ||
function := "ComposeObject(destination, sourceList)" | ||
args := map[string]interface{}{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can also be removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
functional_tests.go
Outdated
args := map[string]interface{}{} | ||
testName := getFuncName() | ||
function := "CopyObject(destination, source)" | ||
args := map[string]interface{}{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can also be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make the changes relating to settings args and function names in the quick test mode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
9c8dc74
to
7088ee5
Compare
functional_tests.go
Outdated
// Tests bucket re-create errors. | ||
func testMakeBucketError() { | ||
region := "eu-central-1" | ||
|
||
// initialize logging params | ||
startTime := time.Now() | ||
function := "MakeBucket(bucketName, region)" | ||
testName := getFuncName() | ||
function := []string{"MakeBucket(bucketName, region)"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't each test suppose to test one SDK API primarily, even though it may use many API methods? Why do we need a []string
for function
field in the log json? This is different from our decided format here - https://github.com/minio/mint#mint-log-format
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's true, but there are still some test cases already part of the existing code, like testFunctionalV2
, and testFunctional
, which come as a bunch of api tests. I guess these tests have been added as part of the new QuickTest
mode which is why the string array is introduced recently.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it mean you need to fix the test than breaking JSON?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, we don't need to fix anything, imho. That is perfectly fine.
So, what I did was to accommodate these kind of test cases and handle them in a kind of a better way.
Now, when these tests run, each and every api name will be printed in the function
field as part of the json file if there is an error. If all of the api tests pass, then all of the api names will be printed out in the function
field as part of the json file. So, no problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you provide sample JSONs on success and failure cases?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is the success example:
go build functional_tests.go;go run functional_tests.go | jq
{
"args": {
"bucketName": "minio-go-test-hx5t3l96fruilwyi"
},
"duration": 2119,
"function": [
"MakeBucket(bucketName, region)",
"BucketExists(bucketName)",
"GetBucketPolicy(bucketName, objectPrefix)",
"SetBucketPolicy(bucketName, objectPrefix, bucketPolicy)",
"ListBuckets()",
"PutObject(bucketName, objectName, reader, contentType)",
"ListObjects(bucketName, objectName, isRecursive, doneCh)",
"ListObjectsV2(bucketName, objectName, isRecursive, doneCh)",
"ListIncompleteUploads(bucketName, objectName, isRecursive, doneCh)",
"GetObject(bucketName, objectName)",
"FGetObject(bucketName, objectName, fileName)",
"PresignedHeadObject(bucketName, objectName, expires, reqParams)",
"PresignedGetObject(bucketName, objectName, expires, reqParams)",
"PresignedPutObject(bucketName, objectName, expires)",
"RemoveObject(bucketName, objectName)",
"RemoveBucket(bucketName)"
],
"name": "minio-go: testFunctional",
"status": "PASS"
}
{
"args": {
"bucketName": "minio-go-test-04ihrp4hwhtm2dst",
"objectName": "minio-go-test-04ihrp4hwhtm2dstunique-presigned"
},
"duration": 634,
"function": [
"MakeBucket(bucketName, region)",
"BucketExists(bucketName)",
"SetBucketPolicy(bucketName, objectPrefix, bucketPolicy)",
"ListBuckets()",
"ListObjects(bucketName, objectName, isRecursive, doneCh)",
"ListIncompleteUploads(bucketName, objectName, isRecursive, doneCh)",
"GetObject(bucketName, objectName)",
"FGetObject(bucketName, objectName, fileName)",
"PresignedHeadObject(bucketName, objectName, expires, reqParams)",
"PresignedGetObject(bucketName, objectName, expires, reqParams)",
"PresignedPutObject(bucketName, objectName, expires)"
],
"name": "minio-go: testFunctionalV2",
"status": "PASS"
}
... and here is the failure example:
(induced an error just before SetBucketPolicy api execution):
$ go build functional_tests.go;go run functional_tests.go | jq
{
"args": {
"bucketName": "minio-go-test-eomoglxiubs5s9h9",
"bucketPolicy": "readonly",
"objectPrefix": ""
},
"duration": 169,
"error": "BOOM!",
"function": [
"SetBucketPolicy(bucketName, objectPrefix, bucketPolicy)"
],
"message": "SetBucketPolicy failed",
"name": "minio-go: testFunctional",
"status": "FAIL"
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see you change function
field as array which leads to dynamic JSON i.e. other tests have the field as string (as per currently agreed JSON format). You would need to fix tests, not JSON.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@balamurugana
The issue here is the way quick
mode feature is designed and implemented. It is a break in the rule of having a single api tested in a single test case. Having a group of api tests running inside a single test case/wrapper and reporting the wrapper name without the covered api names is a shortage of information that is supposed to be conveyed to the end user. That's what is behind the code change of having function
field transformed from string
to array
type. So, it was an attempt to accommodate the existing quick
mode feature design and implementation to our existing standard with minimum effort.
Now, if we don't want to change the function
field to array
type, then we need to decide if we are ok with not reporting apis tested under testFunctionalV2
, and testFunctional
test cases.
Please let me know what you think.
We also need to make sure our whole mint team understand that grouping of api tests in one single test case is against our mint testing design philosophy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@balamurugana
(It is not the finest looking code, but) I kept the function
field as string
and populated it with the list of all apis tested.
Now here how it loooks like:
Success:
$ go build functional_tests.go;go run functional_tests.go | jq
{
"args": {
"bucketName": "minio-go-test-lj99jvecgld2v1rk"
},
"duration": 1486,
"function": "MakeBucket(bucketName, region), BucketExists(bucketName), GetBucketPolicy(bucketName, objectPrefix), SetBucketPolicy(bucketName, objectPrefix, bucketPolicy), GetBucketPolicy(bucketName, objectPrefix), SetBucketPolicy(bucketName, objectPrefix, bucketPolicy), GetBucketPolicy(bucketName, objectPrefix), SetBucketPolicy(bucketName, objectPrefix, bucketPolicy), GetBucketPolicy(bucketName, objectPrefix), ListBuckets(), PutObject(bucketName, objectName, reader, contentType), ListObjects(bucketName, objectName, isRecursive, doneCh), ListObjectsV2(bucketName, objectName, isRecursive, doneCh), ListIncompleteUploads(bucketName, objectName, isRecursive, doneCh), GetObject(bucketName, objectName), FGetObject(bucketName, objectName, fileName), PresignedHeadObject(bucketName, objectName, expires, reqParams), PresignedHeadObject(bucketName, objectName, expires, reqParams), PresignedGetObject(bucketName, objectName, expires, reqParams), PresignedGetObject(bucketName, objectName, expires, reqParams), PresignedPutObject(bucketName, objectName, expires), PresignedPutObject(bucketName, objectName, expires), RemoveObject(bucketName, objectName), RemoveBucket(bucketName)",
"name": "minio-go: testFunctional",
"status": "PASS"
}
{
"args": {
"bucketName": "minio-go-test-oimq6as19p2ut49e",
"objectName": "minio-go-test-oimq6as19p2ut49eunique-presigned"
},
"duration": 437,
"function": "MakeBucket(bucketName, location), BucketExists(bucketName), SetBucketPolicy(bucketName, objectPrefix, bucketPolicy), ListBuckets(), ListObjects(bucketName, objectName, isRecursive, doneCh), ListIncompleteUploads(bucketName, objectName, isRecursive, doneCh), GetObject(bucketName, objectName), FGetObject(bucketName, objectName, fileName), PresignedHeadObject(bucketName, objectName, expires, reqParams), PresignedGetObject(bucketName, objectName, expires, reqParams), PresignedPutObject(bucketName, objectName, expires), GetObject(bucketName, objectName)",
"name": "minio-go: testFunctionalV2",
"status": "PASS"
}
Failure (error induced before BucketExists
api):
go build functional_tests.go;go run functional_tests.go | jq
{
"args": {
"bucketName": "minio-go-test-w3i5rbgfrvh2j5xe"
},
"duration": 212,
"error": "BOOM!",
"function": "BucketExists(bucketName)",
"message": "BucketExists failed",
"name": "minio-go: testFunctional",
"status": "FAIL"
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know whether I understood quick
mode design/implementation here. All tests in minio-go are run in all modes i.e. there is no difference for quick
and enhanced
modes.
I haven't completely understood any arguments about mint JSON till now, hence I can't comment on that. I am only interested in whether I will find what/where the failure happened in tests so that I find the problem and fix it accordingly. If failure log provides such information, I am OK.
If you say below JSON helps tracing down the problem whether its in test and/or server, its good to go.
{
"args": {
"bucketName": "minio-go-test-w3i5rbgfrvh2j5xe"
},
"duration": 212,
"error": "BOOM!",
"function": "BucketExists(bucketName)",
"message": "BucketExists failed",
"name": "minio-go: testFunctional",
"status": "FAIL"
}
6202158
to
4459660
Compare
@ebozduman can you please address the conflicts and travis failures |
Waiting on build failures to get resolved. |
1e82ad2
to
a7a9fb0
Compare
721b4b2
to
db5b6d8
Compare
Fixes #833