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

Use httputil.DumpRequest to pretty-print unhandled requests #278

Merged
merged 1 commit into from
Apr 17, 2018

Conversation

benmoss
Copy link
Contributor

@benmoss benmoss commented Apr 12, 2018

Right now when the test server receives an unhandled HTTP request, it prints out default representation of the request object, which ends up being humongous (see https://gist.github.com/benmoss/86f69211817e33161aa678cb63e0ca57).

The httputil package offers a pretty printer for request objects that gives you the relevant details while sparing you the rest.

      Received Unhandled Request
      Expected
          <string>: POST /oauth/token HTTP/1.1
          Host: 127.0.0.1:51014
          Accept: application/json
          Accept-Encoding: gzip
          Content-Length: 97
          Content-Type: application/x-www-form-urlencoded
          User-Agent: Go-http-client/1.1

          client_id=test_client&client_secret=test_secret&grant_type=client_credentials&response_type=token
      to be nil

I can't see how we would encounter an error while dumping the request, but maybe someone more knowledgable than I might have an idea why this might be problematic.

Right now when the test server receives an unhandled HTTP request, it
prints out default representation of the request object, which ends up
being humongous (see
https://gist.github.com/benmoss/86f69211817e33161aa678cb63e0ca57).

The httputil package offers a pretty printer for request objects that
gives you the relevant details while sparing you the rest.

I can't see how we would encounter an error while dumping the request,
but maybe someone more knowledgable than I might have an idea why this
might be problematic.
@benmoss
Copy link
Contributor Author

benmoss commented Apr 12, 2018

Looks like some flaky tests caused the build failure.

@williammartin
Copy link
Sponsor Collaborator

Hey I reran the tests, we're working on fixing flakiness atm. Thanks for the PR, seems to make sense, will have a closer look later.

@williammartin
Copy link
Sponsor Collaborator

williammartin commented Apr 17, 2018

LGTM thanks! Hopefully no one is relying on anything in that stdout though, but I think this is a good change.

@williammartin williammartin merged commit b7d1a52 into onsi:master Apr 17, 2018
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

2 participants