From 537e37afa169dbed80e41f8e1cf3b202fc8700f1 Mon Sep 17 00:00:00 2001 From: James Titcumb Date: Wed, 15 Dec 2021 08:20:51 +0000 Subject: [PATCH] Ensure curl is installed for http test --- .github/workflows/tests.yml | 14 +++++++++++--- tests/Integration/AgentTest.php | 4 ++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 84d84be8..65cf4d2a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -16,9 +16,8 @@ jobs: fail-fast: false matrix: dependencies: ["lowest", "highest"] + scout-ext: ["with-scout-ext", "no-scout-ext"] extensions: [ - "scoutapm", - "scoutapm, mongodb", "", "mongodb" ] @@ -43,7 +42,16 @@ jobs: coverage: "none" php-version: "${{ matrix.php-version }}" tools: pecl - extensions: ${{ matrix.extensions }} + extensions: "curl, ${{ matrix.extensions }}" + # Normally, we'd just add "scoutapm" to the above extensions in shivammathur/setup-php, but libcurl appears to + # be missing wherever the extension is built (not immediately obvious), so install it first + - name: "Install scoutapm extension" + if: ${{ matrix.scout-ext == 'with-scout-ext' }} + run: | + sudo apt-get install -y libcurl4-openssl-dev + sudo mkdir -p /tmp/pear/temp + sudo pecl update-channels + yes | sudo pecl install -f scoutapm - name: "Install lowest dependencies" if: ${{ matrix.dependencies == 'lowest' }} run: "composer update --prefer-lowest --prefer-dist --no-interaction --no-progress" diff --git a/tests/Integration/AgentTest.php b/tests/Integration/AgentTest.php index f21eb405..03119431 100644 --- a/tests/Integration/AgentTest.php +++ b/tests/Integration/AgentTest.php @@ -476,6 +476,10 @@ public function testHttpSpansArePromoted(): void self::markTestSkipped('scoutapm extension must be enabled for HTTP spans'); } + if (! extension_loaded('curl')) { + self::markTestSkipped('curl extension must be enabled for HTTP spans'); + } + $this->setUpWithConfiguration(Config::fromArray([ ConfigKey::APPLICATION_NAME => self::APPLICATION_NAME, ConfigKey::MONITORING_ENABLED => true,