-
Notifications
You must be signed in to change notification settings - Fork 32
Use cURL extension instead of Guzzle #5
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
Conversation
$output->writeln("Unexpected response: ".$response->code." ".$response->message); | ||
$output->writeln($response->body); | ||
$ret = 1; | ||
break; |
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.
I'm seeing
PHP Parse error: syntax error, unexpected 'public' (T_PUBLIC) in /home/travis/build/codeclimate/php-test-reporter/src/CodeClimate/Bundle/TestReporterBundle/Command/TestReporterCommand.php on line 86
on Travis.
I think you're missing the closing brace for the switch
.
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.
Whoops. Sorry.
Note that Guzzle is still installed as an (implicit) dependency of satooshi/php-coveralls. I'm not sure why CodeClimate's reporter depends on coveralls.io's reporter. Unless I'm missing something, all that is being used is the code to convert PHPUnit's Clover XML report into JSON? |
Yes, the dependency is for the XML->JSON class(es). As you might've guessed, none of us here are PHP devs, but we knew that the coveralls package was doing the same basic thing we needed to. One option was to hand-copy the code in and make modifications, the other was to depend on the library and use/extend its classes. We chose the latter. Any PRs that removed that additional dependency by hand-rolling the XML->JSON stuff would be most welcome. Also, were you experiencing the certificate issue? If so, do you know if this PR addresses that issue, or should I still make the change in |
Would you mind creating a dedicated issue for that, ideally explaining some background information, so others can understand the full rationale of the current code and what the actual server-side technical requirements are? E.g., one of the first and foremost questions would be why the code coverage data is converted into JSON in the first place, instead of uploading the original/raw Clover XML report?
Nope, this PR does not help to resolve #3 - it only replaces usage of Guzzle with native cURL (which Guzzle 3 uses anyway under the hood). The only difference compared to HEAD is that (1) PHP cURL uses the operating system's certs by default and (2) in case of that cert verification error, PHP cURL outputs a more helpful error message. Regarding the proposed change of That said, I'd recommend to create a PR for the |
Thanks.
My current plan is this:
|
@sun can you rebase this over current master? That'll make it so our travis build attempts to submit coverage as another check on the changes before merging. |
Testing the branch locally, I'm seeing the following:
|
@sun is that output expected? Can we hide it? Does there need to be logic to look for |
I've taken care of the rebase and fixed the incorrect handling of the 100 status. Opened as a new PR: #12 |
The only HTTP client operation in this library is to transfer the resulting JSON data in a trivial HTTP POST request with minimal error handling (can't do anything besides outputting the error to CLI).
This PR…
ApiClient
to return a very simplistic response object.TestReporterCommand
accordingly.Note: An alternative implementation using PHP HTTP/SSL stream contexts would be possible, but requires additional code to cleanly handle PHP warnings possibly thrown by
fopen()
, unless error handling is removed altogether.