Skip to content
This repository has been archived by the owner on Sep 15, 2021. It is now read-only.

interoptestservice: support GET and POST HTTP requests #115

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

odeke-em
Copy link
Contributor

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

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
@rghetia
Copy link
Contributor

rghetia commented Dec 16, 2018

Thanks Emmanuel for contributing to this effort.

Copy link
Contributor

@rghetia rghetia left a 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/":
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

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 ?

Copy link
Contributor Author

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?

Copy link
Contributor

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants