-
Notifications
You must be signed in to change notification settings - Fork 11
interoptestservice: support GET and POST HTTP requests #115
base: master
Are you sure you want to change the base?
Conversation
Support for requests over HTTP with: * GET to /result/:id which will retrieve a test result. As shown in the template route, ":id" must be replaced with the actual id which is a 64-bit signed integer * POST to /result and /run which will For /result submit a result For /run, run the test asynchronously Fixes #81
bca3fbe
to
7ff9403
Compare
Thanks Emmanuel for contributing to this effort. |
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.
one comment, otherwise LGTM.
} | ||
res, err = s.Run(ctx, inrreq) | ||
|
||
case "/result", "/result/": |
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.
what is the difference between POST /result and GET /result?
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.
- GET /result is to retrieve the results by ID or later for listing all the results
- POST /result submits a single result
and as per the PR there are two different methods handleHTTPGET and handleHTTPPOST
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.
What I meant was GET /result and POST /result do the same thing. They both retrieve result. Why is there a need for POST /result ?
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.
What I meant was GET /result and POST /result do the same thing. They both retrieve result. Why is there a need for POST /result ?
Am a little confused by your the ask of this issue then: A POST method is used to upload content, a GET is used to retrieve it. https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods my apologies if am perhaps preaching to the choir.
POST was coded to be able to receive test results from whoever is running it e.g. a sharded test runner; GET to actually retrieve them(following the HTTP conventions)
Did you just want only functionality of a GET?
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.
Test coordinator is computing results based on test it requests to test-services (javaservice, etc) and traces it receives from OC Agent. So no entity is actually posting any result to Test coordinator.
Also, the code for POST /result is actually reading the request from the body and returning the results. It isn't uploading any content.
Support for requests over HTTP with:
GET to /result/:id
which will retrieve a test result. As shown in the template
route, ":id" must be replaced with the actual id which is
a 64-bit signed integer
POST to /result and /run
which will
For /result submit a result
For /run, run the test asynchronously
Fixes #81