Skip to content
This repository has been archived by the owner on Oct 19, 2023. It is now read-only.

Commit

Permalink
Install opencensus extension (#359)
Browse files Browse the repository at this point in the history
* Install opencensus extension

* Add opencensus to the list of available extension in extension enabler

* Add a test for opencensus extension
Also enable grpc and pdo_sqlite in composer.json

* Add a missing semicolon

* Fixing a broken e2e test
  • Loading branch information
Takashi Matsuo authored Sep 11, 2017
1 parent c12d192 commit 3cab1c1
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 16 deletions.
2 changes: 2 additions & 0 deletions php-base/build-scripts/install_extensions.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class InstallExtensions
'memcached',
'mongodb',
'oauth',
'opencensus',
'phalcon',
'pq',
'protobuf',
Expand Down Expand Up @@ -81,6 +82,7 @@ class InstallExtensions
'ds' => ['5.6'],
'lua' => ['5.6'],
'memcache' => ['7.0', '7.1'],
'opencensus' => ['5.6'],
'phalcon' => ['7.1'],
'v8js' => ['5.6'],
'vips' => ['5.6'],
Expand Down
1 change: 1 addition & 0 deletions php-base/build-scripts/install_php70.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ apt-get install -y \
gcp-php70-memcached \
gcp-php70-mongodb \
gcp-php70-oauth \
gcp-php70-opencensus \
gcp-php70-phalcon \
gcp-php70-pq \
gcp-php70-protobuf \
Expand Down
1 change: 1 addition & 0 deletions php-base/build-scripts/install_php71.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ apt-get install -y \
gcp-php71-memcached \
gcp-php71-mongodb \
gcp-php71-oauth \
gcp-php71-opencensus \
gcp-php71-pq \
gcp-php71-protobuf \
gcp-php71-rdkafka \
Expand Down
1 change: 1 addition & 0 deletions php-base/build-scripts/install_php72.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ apt-get install -y \
gcp-php72-memcached \
gcp-php72-mongodb \
gcp-php72-oauth \
gcp-php72-opencensus \
gcp-php72-pq \
gcp-php72-protobuf \
gcp-php72-rdkafka \
Expand Down
3 changes: 3 additions & 0 deletions testapps/build_pipeline/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
],
"require": {
"php": "7.1.*",
"ext-grpc": "*",
"ext-opencensus": "*",
"ext-pdo_sqlite": "*",
"google/auth": "^0.11",
"grpc/grpc": "^1.0",
"silex/silex": "^1.3"
Expand Down
16 changes: 0 additions & 16 deletions testapps/build_pipeline/php.ini

This file was deleted.

22 changes: 22 additions & 0 deletions testapps/build_pipeline/tests/tests/EndToEndTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,28 @@ public function testGoodbye()
});
}

/**
* @dataProvider extensions
*/
public function testExtensions($extensionName)
{
$this->runEventuallyConsistentTest(function () use ($extensionName) {
$query = http_build_query(['ext' => $extensionName]);
$resp = $this->client->get('/check_extensions.php?' . $query);
$this->assertEquals('200', $resp->getStatusCode(),
"failed to confirm $extensionName is loaded");
});
}

public function extensions()
{
return [
['grpc'],
['opencensus'],
['pdo_sqlite'],
];
}

public function testPhpInfo()
{
$this->runEventuallyConsistentTest(function () {
Expand Down
25 changes: 25 additions & 0 deletions testapps/build_pipeline/web/check_extensions.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

/*
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

$ext = $_GET["ext"];

if (! extension_loaded($ext)) {
die(1);
}

echo 'OK';

0 comments on commit 3cab1c1

Please sign in to comment.