Skip to content

Fix line delimited JSON response#7886

Merged
LK4D4 merged 1 commit intomoby:masterfrom
jessfraz:7047-json-line-delim
Sep 8, 2014
Merged

Fix line delimited JSON response#7886
LK4D4 merged 1 commit intomoby:masterfrom
jessfraz:7047-json-line-delim

Conversation

@jessfraz
Copy link
Copy Markdown
Contributor

@jessfraz jessfraz commented Sep 4, 2014

For GET /events, line delimit JSON.
Fixes #7047

Signed-off-by: Jessica Frazelle [email protected]

@vieux
Copy link
Copy Markdown
Contributor

vieux commented Sep 4, 2014

@paultag can you please take a look? Thanks.

@paultag
Copy link
Copy Markdown

paultag commented Sep 4, 2014

all over checking this out tonight. sweeettttttttttttttttttttttttttttt

On Thu, Sep 4, 2014 at 3:08 PM, Victor Vieux [email protected]
wrote:

@paultag https://github.com/paultag can you please take a look? Thanks.


Reply to this email directly or view it on GitHub
#7886 (comment).

:wq

@tiborvass
Copy link
Copy Markdown
Contributor

Is there a way we can add a Test case for this?

@jessfraz
Copy link
Copy Markdown
Contributor Author

jessfraz commented Sep 4, 2014

ya I was thinking of a way to go about that

@jessfraz jessfraz force-pushed the 7047-json-line-delim branch 3 times, most recently from 385cb44 to 80fb36a Compare September 6, 2014 00:51
@jessfraz
Copy link
Copy Markdown
Contributor Author

jessfraz commented Sep 6, 2014

ping @paultag @vieux this is way simpler now & has a test

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not sure that cli tests is place for doing such things. We definitely need api tests, but we have no still :) This possibly could be tested in events unit_tests by creating fake job and adding connecting pipe to stdout.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

But maybe it's time to bring api testing. ping @unclejack

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm OK with doing this. The name integration-cli still applies, the tests can do what it takes to get changes tested.

@jessfraz
Copy link
Copy Markdown
Contributor Author

jessfraz commented Sep 7, 2014

ping @LK4D4 moved test to a docker_api_events_test.go file

@jessfraz
Copy link
Copy Markdown
Contributor Author

jessfraz commented Sep 7, 2014

also ping @unclejack @tiborvass

Comment thread integration-cli/docker_utils.go Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not sure about this code. You can only test that answer is EOL-delimited by this :) It should be in your test I think. Here I think should be only:

ioutil.ReadAll(resp.Body)

@jessfraz jessfraz force-pushed the 7047-json-line-delim branch from 61ad09f to 2bbbc20 Compare September 8, 2014 15:42
Comment thread integration-cli/docker_utils.go Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think you do need to do a defer client.Close().

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

right my b, got a little delete happy

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed!

@jessfraz
Copy link
Copy Markdown
Contributor Author

jessfraz commented Sep 8, 2014

updated ping @LK4D4 @tiborvass

@jessfraz jessfraz force-pushed the 7047-json-line-delim branch from 2bbbc20 to c7539d4 Compare September 8, 2014 16:09
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You could add linesRead for more information.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

added :)

@jessfraz jessfraz force-pushed the 7047-json-line-delim branch from c7539d4 to 4e56094 Compare September 8, 2014 16:16
@tiborvass
Copy link
Copy Markdown
Contributor

LGTM

@tiborvass
Copy link
Copy Markdown
Contributor

please rebase

For GET /events, line delimit JSON.
Fixes moby#7047

Signed-off-by: Jessica Frazelle <[email protected]>

Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <[email protected]> (github: )
@jessfraz jessfraz force-pushed the 7047-json-line-delim branch from 4e56094 to d2f75a3 Compare September 8, 2014 16:42
@jessfraz
Copy link
Copy Markdown
Contributor Author

jessfraz commented Sep 8, 2014

rebased :)

@LK4D4
Copy link
Copy Markdown
Contributor

LK4D4 commented Sep 8, 2014

LGTM

LK4D4 added a commit that referenced this pull request Sep 8, 2014
@LK4D4 LK4D4 merged commit 2360d4a into moby:master Sep 8, 2014
@vieux
Copy link
Copy Markdown
Contributor

vieux commented Sep 9, 2014

Thanks @jfrazelle

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.

events stream endpoint doesn't newline delim json

6 participants