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 support for JSON logging format in minio-js #137

Merged
merged 1 commit into from
Sep 20, 2017

Conversation

kannappanr
Copy link
Collaborator

Add reporter file and the corresponding change in run script and package json to support JSON logging format in minio-js.
Fixes (#136)

@@ -0,0 +1,38 @@
var mocha = require('mocha');
Copy link
Member

Choose a reason for hiding this comment

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

License header is needed..

@nitisht
Copy link
Contributor

nitisht commented Sep 13, 2017

Discussed with @kannappanr the issues will be fixed after minio/minio-js#621 gets merged. This is the current output:

{
  "name": "minio-js",
  "status": "pass",
  "function": "should list bucket",
  "duration": 1564,
  "error": ""
}
{
  "name": "minio-js",
  "status": "pass",
  "function": "should list buckets as promise",
  "duration": 335,
  "error": ""
}
{
  "name": "minio-js",
  "status": "pass",
  "function": "should fail",
  "duration": 0,
  "error": ""
}
{
  "name": "minio-js",
  "status": "pass",
  "function": "should succeed",
  "duration": 1321,
  "error": ""
}
{
  "name": "minio-js",
  "status": "pass",
  "function": "should delete bucket",
  "duration": 1109,
  "error": ""
}
{
  "name": "minio-js",
  "status": "pass",
  "function": "should succeed as promise",
  "duration": 1108,
  "error": ""
}
{
  "name": "minio-js",
  "status": "pass",
  "function": "should delete bucket",
  "duration": 796,
  "error": ""
}
{
  "name": "minio-js",
  "status": "pass",
  "function": "should check if bucket exists",
  "duration": 499,
  "error": ""
}
{
  "name": "minio-js",
  "status": "pass",
  "function": "should check if bucket does not exist",
  "duration": 757,
  "error": ""
}
{
  "name": "minio-js",
  "status": "pass",
  "function": "should check if bucket exists, promise",
  "duration": 248,
  "error": ""
}
{
  "name": "minio-js",
  "status": "pass",
  "function": "should fail for nonexistent bucket",
  "duration": 806,
  "error": ""
}
{
  "name": "minio-js",
  "status": "pass",
  "function": "should succeed as promise",
  "duration": 244,
  "error": ""
}
{
  "name": "minio-js",
  "status": "pass",
  "function": "should upload 100KB stream",
  "duration": 1802,
  "error": ""
}
{
  "name": "minio-js",
  "status": "pass",
  "function": "should download 100KB and match content",
  "duration": 992,
  "error": ""
}
{
  "name": "minio-js",
  "status": "pass",
  "function": "should upload 100KB Buffer",
  "duration": 519,
  "error": ""
}
{
  "name": "minio-js",
  "status": "pass",
  "function": "should download 100KB Buffer upload and match content",
  "duration": 264,
  "error": ""
}
{
  "name": "minio-js",
  "status": "pass",
  "function": "should upload 100KB string",
  "duration": 529,
  "error": ""
}
{
  "name": "minio-js",
  "status": "fail",
  "function": "should download 100KB string upload and match content",
  "duration": 511,
  "error": ""
}
{
  "name": "minio-js",
  "status": "fail",
  "function": "\"after all\" hook",
  "duration": 258,
  "error": {
    "length": 1,
    "name": "",
    "prototype": {}
  }
}

Copy link
Contributor

@nitisht nitisht left a comment

Choose a reason for hiding this comment

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

Currently the log format is not compliant to the format finalized earlier. Issues with the format are

  • function shows a message instead of API being tested
  • args are not shown

@kannappanr kannappanr force-pushed the Mint_JS_Json_Logging branch 2 times, most recently from c7fde2d to 050c02c Compare September 15, 2017 19:28
Add reporter file to display the logs in JSON format.
Change the way the program is called in run.sh to remove
unwanted log message generated.
update the version of Minio-JS to 3.2.1 in ./build/minio-js/install.sh

Fixes minio#136
@nitisht
Copy link
Contributor

nitisht commented Sep 20, 2017

Tested with latest release, couple of issues

  • alert is erroneously present in some PASS cases, also alert can be avoided if there is no value
  • args are not updated in few json entries. For example
{
  "name": "minio-js",
  "status": "PASS",
  "function": "removeObject(bucketName, objectName, cb)",
  "args": "",
  "alert": "remove objects created for test",
  "duration": 2
}
{
  "name": "minio-js",
  "status": "PASS",
  "function": "initiateNewMultipartUpload(bucketName, objectName, contentType, cb)",
  "args": "",
  "alert": "",
  "duration": 11
}
{
  "name": "minio-js",
  "status": "PASS",
  "function": "fPutObject(bucketName, objectName, filePath, contentType, callback)",
  "args": "",
  "alert": "",
  "duration": 135
}
{
  "name": "minio-js",
  "status": "PASS",
  "function": "fPutObject(bucketName, objectName, filePath, contentType, callback)",
  "args": "contentType: customContentType",
  "alert": "",
  "duration": 157
}
{
  "name": "minio-js",
  "status": "PASS",
  "function": "fGetObject(bucketName, objectName, filePath, callback)",
  "args": "",
  "alert": "verify checksum",
  "duration": 45
}
{
  "name": "minio-js",
  "status": "PASS",
  "function": "removeObject(bucketName, objectName, filePath, callback)",
  "args": "",
  "alert": "",
  "duration": 4
}
{
  "name": "minio-js",
  "status": "PASS",
  "function": "fPutObject(bucketName, objectName, filePath, contentType)",
  "args": "",
  "alert": "",
  "duration": 114
}
{
  "name": "minio-js",
  "status": "PASS",
  "function": "fGetObject(bucketName, objectName, filePath)",
  "args": "",
  "alert": "",
  "duration": 38
}
{
  "name": "minio-js",
  "status": "PASS",
  "function": "removeObject(bucketName, objectName, filePath, callback)",
  "args": "",
  "alert": "",
  "duration": 4
}
{
  "name": "minio-js",
  "status": "PASS",
  "function": "putObject(bucketName, objectName, stream, contentType, cb)",
  "args": "",
  "alert": "",
  "duration": 95
}

@nitisht
Copy link
Contributor

nitisht commented Sep 20, 2017

Discussed with @kannappanr on this, log entries can be tweaked later based on confirmation with @abperiasamy , meanwhile we can take this PR in, as the format is overall compliant with json format

@nitisht nitisht merged commit a551063 into minio:master Sep 20, 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

4 participants