From 56981458c00ab381b3d6032e1138d88d82bd9cf2 Mon Sep 17 00:00:00 2001 From: Zach Borboa Date: Sun, 28 Mar 2021 23:10:03 -0400 Subject: [PATCH 1/5] Clean up html tags --- www/index.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/www/index.php b/www/index.php index 240c6c9..8459557 100644 --- a/www/index.php +++ b/www/index.php @@ -180,22 +180,22 @@ p:last-child { + src="https://img.shields.io/github/release/php-curl-class/php-curl-class.svg?style=flat-square" /> + src="https://img.shields.io/github/license/php-curl-class/php-curl-class.svg?style=flat-square" /> + src="https://img.shields.io/github/workflow/status/php-curl-class/php-curl-class/ci?style=flat-square" /> + src="https://img.shields.io/packagist/dt/php-curl-class/php-curl-class.svg?style=flat-square" />

From 3a095e7780c9d33056b41c2d63d6ef06a5e464f6 Mon Sep 17 00:00:00 2001 From: Zach Borboa Date: Sun, 28 Mar 2021 23:14:29 -0400 Subject: [PATCH 2/5] Remove version check as all tested versions use the built-in development server --- tests/before_script.sh | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/tests/before_script.sh b/tests/before_script.sh index 69747a4..4f59d33 100755 --- a/tests/before_script.sh +++ b/tests/before_script.sh @@ -17,18 +17,4 @@ composer install --prefer-source --no-interaction # Let test server know we should allow testing. export PHP_CURL_CLASS_TEST_MODE_ENABLED="yes" -if [[ "${CI_PHP_VERSION}" == "7.0" ]]; then - start_php_servers -elif [[ "${CI_PHP_VERSION}" == "7.1" ]]; then - start_php_servers -elif [[ "${CI_PHP_VERSION}" == "7.2" ]]; then - start_php_servers -elif [[ "${CI_PHP_VERSION}" == "7.3" ]]; then - start_php_servers -elif [[ "${CI_PHP_VERSION}" == "7.4" ]]; then - start_php_servers -elif [[ "${CI_PHP_VERSION}" == "8.0" ]]; then - start_php_servers -elif [[ "${CI_PHP_VERSION}" == "nightly" ]]; then - start_php_servers -fi +start_php_servers From 64df98c50fcc8c1cfd712608a7e8cee8d85873db Mon Sep 17 00:00:00 2001 From: Zach Borboa Date: Sun, 28 Mar 2021 23:44:25 -0400 Subject: [PATCH 3/5] Match number of servers started --- examples/multi_curl_get_load_test.php | 4 ++-- tests/before_script.sh | 19 ++++++++++--------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/examples/multi_curl_get_load_test.php b/examples/multi_curl_get_load_test.php index 6b93431..d124477 100644 --- a/examples/multi_curl_get_load_test.php +++ b/examples/multi_curl_get_load_test.php @@ -3,12 +3,12 @@ require __DIR__ . '/../vendor/autoload.php'; use Curl\MultiCurl; -$server_count = 5; +$server_count = 7; $urls = []; $port = 8000; for ($i = 0; $i < $server_count; $i++) { - $port += 1; $urls[] = 'http://localhost:' . $port . '/'; + $port += 1; } $multi_curl = new MultiCurl(); diff --git a/tests/before_script.sh b/tests/before_script.sh index 4f59d33..0d17844 100755 --- a/tests/before_script.sh +++ b/tests/before_script.sh @@ -1,12 +1,5 @@ -start_php_servers() { - for i in $(seq 0 6); do - port=8000 - (( port += $i )) - php -S "127.0.0.1:${port}" -t tests/PHPCurlClass/ & - done -} - set -x + echo "CI_PHP_VERSION: ${CI_PHP_VERSION}" php -r "var_dump(phpversion());" php -r "var_dump(curl_version());" @@ -17,4 +10,12 @@ composer install --prefer-source --no-interaction # Let test server know we should allow testing. export PHP_CURL_CLASS_TEST_MODE_ENABLED="yes" -start_php_servers +# Start test servers. Run servers on different ports to allow simultaneous +# requests without blocking. +server_count=7 +for i in $(seq 0 $(("${server_count}" - 1))); do + port=8000 + (( port += $i )) + + php -S "127.0.0.1:${port}" -t tests/PHPCurlClass/ & +done From a315b541bef5d5965f96b112d61dfed363aad472 Mon Sep 17 00:00:00 2001 From: Zach Borboa Date: Mon, 29 Mar 2021 00:14:52 -0400 Subject: [PATCH 4/5] Consolidate continuous integration scripts Merge before_script.sh into script.sh --- .github/workflows/ci.yml | 4 +--- tests/before_script.sh | 21 --------------------- tests/script.sh | 25 ++++++++++++++++++++++--- 3 files changed, 23 insertions(+), 27 deletions(-) delete mode 100755 tests/before_script.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d74119c..4eaffd7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,8 +27,6 @@ jobs: uses: actions/checkout@v2 - name: Test - run: | - bash tests/before_script.sh - bash tests/script.sh + run: bash tests/script.sh env: CI_PHP_VERSION: ${{ matrix.php }} diff --git a/tests/before_script.sh b/tests/before_script.sh deleted file mode 100755 index 0d17844..0000000 --- a/tests/before_script.sh +++ /dev/null @@ -1,21 +0,0 @@ -set -x - -echo "CI_PHP_VERSION: ${CI_PHP_VERSION}" -php -r "var_dump(phpversion());" -php -r "var_dump(curl_version());" - -composer self-update -composer install --prefer-source --no-interaction - -# Let test server know we should allow testing. -export PHP_CURL_CLASS_TEST_MODE_ENABLED="yes" - -# Start test servers. Run servers on different ports to allow simultaneous -# requests without blocking. -server_count=7 -for i in $(seq 0 $(("${server_count}" - 1))); do - port=8000 - (( port += $i )) - - php -S "127.0.0.1:${port}" -t tests/PHPCurlClass/ & -done diff --git a/tests/script.sh b/tests/script.sh index ac8f0e8..113beda 100755 --- a/tests/script.sh +++ b/tests/script.sh @@ -1,3 +1,25 @@ +set -x + +echo "CI_PHP_VERSION: ${CI_PHP_VERSION}" +php -r "var_dump(phpversion());" +php -r "var_dump(curl_version());" + +composer self-update +composer install --prefer-source --no-interaction + +# Let test server know we should allow testing. +export PHP_CURL_CLASS_TEST_MODE_ENABLED="yes" + +# Start test servers. Run servers on different ports to allow simultaneous +# requests without blocking. +server_count=7 +for i in $(seq 0 $(("${server_count}" - 1))); do + port=8000 + (( port += $i )) + + php -S "127.0.0.1:${port}" -t tests/PHPCurlClass/ & +done + SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" cd "${SCRIPT_DIR}" @@ -34,9 +56,6 @@ errors=() source "check_syntax.sh" -# Let test server know we should allow testing. -export PHP_CURL_CLASS_TEST_MODE_ENABLED="yes" - # Determine which phpunit to use. if [[ -f "../vendor/bin/phpunit" ]]; then phpunit_to_use="../vendor/bin/phpunit" From 3305e9c0b176fcf18e56e7ce3b3c08e9166d3f31 Mon Sep 17 00:00:00 2001 From: Zach Borboa Date: Mon, 29 Mar 2021 10:08:26 -0400 Subject: [PATCH 5/5] Rename continuous integration script --- .github/workflows/ci.yml | 2 +- tests/{script.sh => ci.sh} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename tests/{script.sh => ci.sh} (100%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4eaffd7..7c932fb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,6 +27,6 @@ jobs: uses: actions/checkout@v2 - name: Test - run: bash tests/script.sh + run: bash tests/ci.sh env: CI_PHP_VERSION: ${{ matrix.php }} diff --git a/tests/script.sh b/tests/ci.sh similarity index 100% rename from tests/script.sh rename to tests/ci.sh