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

Fix unit tests #279

Closed
rmccue opened this issue Jun 5, 2017 · 7 comments
Closed

Fix unit tests #279

rmccue opened this issue Jun 5, 2017 · 7 comments

Comments

@rmccue
Copy link
Collaborator

rmccue commented Jun 5, 2017

PHPUnit was upgraded on Travis, and this has broken all the tests, which use 5.2-style (PHPUnit_Framework_TestCase)

TysonAndre added a commit to TysonAndre/Requests that referenced this issue Jun 5, 2017
… name

This change is intended to work in php 5.2+, the lowest version .travis.yml
indicates this supports.

If PHPUnit_Framework_TestCase does not exist, check if
PHPUnit\Framework\TestCase does exist, and if so, alias it.

- Different versions of phpunit may be required for different php
  versions, so don't try standardizing for now.

Fixes WordPress#279
TysonAndre added a commit to TysonAndre/Requests that referenced this issue Jun 5, 2017
… name

This change is intended to work in php 5.2+, the lowest version .travis.yml
indicates this supports.

If PHPUnit_Framework_TestCase does not exist, check if
PHPUnit\Framework\TestCase does exist, and if so, alias it.

- Different versions of phpunit may be required for different php
  versions, so don't try standardizing for now.

Fixes WordPress#279
@TysonAndre
Copy link
Contributor

3) RequestsTest_Proxy_HTTP::testConnectWithArray with data set #0 ('Requests_Transport_cURL')
Requests_Exception: cURL error 7: couldn't connect to host
/home/travis/build/rmccue/Requests/library/Requests/Transport/cURL.php:422
/home/travis/build/rmccue/Requests/library/Requests/Transport/cURL.php:177
/home/travis/build/rmccue/Requests/library/Requests.php:379
/home/travis/build/rmccue/Requests/library/Requests.php:231
/home/travis/build/rmccue/Requests/tests/Proxy/HTTP.php:54

Is the herokuapp or the proxy broken?

@rmccue
Copy link
Collaborator Author

rmccue commented Jun 6, 2017

For the tests, the proxy it's connecting to is a local copy of mitmproxy, run in https://github.com/rmccue/Requests/blob/master/tests/utils/proxy/start.sh

Seems like it must not be correctly connecting to that; potentially mitmproxy isn't being started correctly. Or, it's possible an underlying update to the Travis boxes broke start-stop-daemon.

@rmccue
Copy link
Collaborator Author

rmccue commented Jun 9, 2017

potentially mitmproxy isn't being started correctly

As suspected: https://travis-ci.org/rmccue/Requests/jobs/241055006

@TysonAndre
Copy link
Contributor

The trusty beta doesn't seem like it'll help (Seems like python 3.4?) (Could try to look for PPAs?)

Alternately, one could

@rmccue
Copy link
Collaborator Author

rmccue commented Jun 9, 2017

Fixed the mitmproxy problem (I just downgraded), working on fixing the other errors now.

@rmccue
Copy link
Collaborator Author

rmccue commented Jun 9, 2017

The trusty beta doesn't seem like it'll help (Seems like python 3.4?) (Could try to look for PPAs?)

FWIW, I think Python 3 is installed, but as the python3 binary, and with a pip3 binary. We can look at using that later if need be.

@jrfnl
Copy link
Member

jrfnl commented Feb 18, 2022

Looks like this was originally fixed in #303 (Dec 2017). The tests have since been made fully PHPUnit cross-version compatible using the PHPUnit Polyfills.

@jrfnl jrfnl closed this as completed Feb 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants