Skip to content

Commit

Permalink
Merge pull request #815 from WordPress/fix/replace-heroku-with-render
Browse files Browse the repository at this point in the history
Replace Heroku test-server with Render alternative
  • Loading branch information
jrfnl committed Jun 26, 2023
2 parents 83ec287 + 87740ab commit efb240e
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/quicktest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ jobs:
echo "REQUESTS_HTTP_PROXY_AUTH_USER=test" >> $GITHUB_ENV
echo "REQUESTS_HTTP_PROXY_AUTH_PASS=pass" >> $GITHUB_ENV
- name: Ensure the HTTPS test instance on Heroku is spun up
run: curl -s -I http://requests-php-tests.herokuapp.com/ > /dev/null
- name: Ensure the HTTPS test instance on Render is spun up
run: curl -s -I https://requests-test-server.onrender.com/ > /dev/null

- name: Check mitmproxy version
run: mitmdump --version
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ jobs:
echo "REQUESTS_HTTP_PROXY_AUTH_USER=test" >> $GITHUB_ENV
echo "REQUESTS_HTTP_PROXY_AUTH_PASS=pass" >> $GITHUB_ENV
- name: Ensure the HTTPS test instance on Heroku is spun up
run: curl -s -I http://requests-php-tests.herokuapp.com/ > /dev/null
- name: Ensure the HTTPS test instance on Render is spun up
run: curl -s -I https://requests-test-server.onrender.com/ > /dev/null

- name: Check mitmproxy version
run: mitmdump --version
Expand Down
34 changes: 34 additions & 0 deletions tests/EnvironmentTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

namespace WpOrg\Requests\Tests;

use WpOrg\Requests\Tests\TestCase;

final class EnvironmentTest extends TestCase {

/**
* Tests whether the HTTP test server is available.
*
* This makes sure that the build actually fails when the HTTP test
* server is not available, as all tests relying on it further down
* the line will just be marked as skipped.
*
* @return void
*/
public function testHttpTestServerAvailable() {
$this->assertTrue(\REQUESTS_TEST_SERVER_HTTP_AVAILABLE);
}

/**
* Tests whether the HTTPS test server is available.
*
* This makes sure that the build actually fails when the HTTPS test
* server is not available, as all tests relying on it further down
* the line will just be marked as skipped.
*
* @return void
*/
public function testHttpsTestServerAvailable() {
$this->assertTrue(\REQUESTS_TEST_SERVER_HTTPS_AVAILABLE);
}
}
2 changes: 1 addition & 1 deletion tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function define_from_env($name, $fallback = false) {
}
}

define_from_env('REQUESTS_TEST_HOST', 'requests-php-tests.herokuapp.com');
define_from_env('REQUESTS_TEST_HOST', 'requests-test-server.onrender.com');
define_from_env('REQUESTS_TEST_HOST_HTTP', REQUESTS_TEST_HOST);
define_from_env('REQUESTS_TEST_HOST_HTTPS', REQUESTS_TEST_HOST);

Expand Down

0 comments on commit efb240e

Please sign in to comment.