Permalink
Browse files

More reliance on environment variables for integ testing

Making it so that the integ tests run without any need to edit config files
if the proper environment variable credentials or ini file is present.
Removing keys from the test_services.json file to discourage placing
keys in this file.
  • Loading branch information...
1 parent e321dcb commit fd101ae04db72ac5a06ace91a14ddd92d8c31e56 @mtdowling mtdowling committed Jul 10, 2014
Showing with 5 additions and 57 deletions.
  1. +0 −1 .travis.yml
  2. +1 −1 phpunit.functional.xml.dist
  3. +0 −43 phpunit.xml.dist
  4. +1 −4 test_services.json.dist → test_services.dist.json
  5. +3 −8 tests/bootstrap.php
View
@@ -8,7 +8,6 @@ php:
before_script:
- sh -c 'if [ $(php -r "echo PHP_MINOR_VERSION;") -le 4 ]; then echo "extension = apc.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;'
- - cp test_services.json.dist test_services.json
- composer self-update
- composer install --no-interaction --prefer-source --dev
@@ -5,7 +5,7 @@
<!-- If you want to run the integration tests, you will need to provide
the path to a service configuration file. You WILL be charged
for your usage if you choose to run the integration tests. -->
- <server name="CONFIG" value="test_services.json" />
+ <server name="CONFIG" value="test_services.dist.json" />
<!-- The PREFIX is added to any globally shared namespaced
resources that are created during integration tests -->
View
@@ -23,49 +23,6 @@
<directory suffix="Interface.php">./src/Aws</directory>
<directory>./src/Aws/**/Enum</directory>
<directory>./src/Aws/**/Resources</directory>
- <directory>./src/Aws/Common/Exception/DomainException.php</directory>
- <directory>./src/Aws/Common/Exception/InvalidArgumentException.php</directory>
- <directory>./src/Aws/Common/Exception/LogicException.php</directory>
- <directory>./src/Aws/Common/Exception/OverflowException.php</directory>
- <directory>./src/Aws/Common/Exception/OutOfBoundsException.php</directory>
- <directory>./src/Aws/Common/Exception/RuntimeException.php</directory>
- <directory>./src/Aws/Common/Exception/UnexpectedValueException.php</directory>
- <directory suffix="Exception.php">./src/Aws/AutoScaling/Exception</directory>
- <directory suffix="Exception.php">./src/Aws/CloudFormation/Exception</directory>
- <directory suffix="Exception.php">./src/Aws/CloudFront/Exception</directory>
- <directory suffix="Exception.php">./src/Aws/CloudSearch/Exception</directory>
- <directory suffix="Exception.php">./src/Aws/CloudSearchDomain/Exception</directory>
- <directory suffix="Exception.php">./src/Aws/CloudTrail/Exception</directory>
- <directory suffix="Exception.php">./src/Aws/CloudWatch/Exception</directory>
- <directory suffix="Exception.php">./src/Aws/CognitoIdentity/Exception</directory>
- <directory suffix="Exception.php">./src/Aws/CognitoSync/Exception</directory>
- <directory suffix="Exception.php">./src/Aws/CloudWatchLogs/Exception</directory>
- <directory suffix="Exception.php">./src/Aws/DataPipeline/Exception</directory>
- <directory suffix="Exception.php">./src/Aws/DirectConnect/Exception</directory>
- <directory suffix="Exception.php">./src/Aws/DynamoDb/Exception</directory>
- <directory suffix="Exception.php">./src/Aws/Ec2/Exception</directory>
- <directory suffix="Exception.php">./src/Aws/ElastiCache/Exception</directory>
- <directory suffix="Exception.php">./src/Aws/ElasticBeanstalk/Exception</directory>
- <directory suffix="Exception.php">./src/Aws/ElasticLoadBalancing/Exception</directory>
- <directory suffix="Exception.php">./src/Aws/ElasticTranscoder/Exception</directory>
- <directory suffix="Exception.php">./src/Aws/Emr/Exception</directory>
- <directory suffix="Exception.php">./src/Aws/Glacier/Exception</directory>
- <directory suffix="Exception.php">./src/Aws/Iam/Exception</directory>
- <directory suffix="Exception.php">./src/Aws/ImportExport/Exception</directory>
- <directory suffix="Exception.php">./src/Aws/Kinesis/Exception</directory>
- <directory suffix="Exception.php">./src/Aws/OpsWorks/Exception</directory>
- <directory suffix="Exception.php">./src/Aws/Rds/Exception</directory>
- <directory suffix="Exception.php">./src/Aws/Redshift/Exception</directory>
- <directory suffix="Exception.php">./src/Aws/Route53/Exception</directory>
- <directory suffix="Exception.php">./src/Aws/S3/Exception</directory>
- <directory suffix="Exception.php">./src/Aws/Ses/Exception</directory>
- <directory suffix="Exception.php">./src/Aws/SimpleDb/Exception</directory>
- <directory suffix="Exception.php">./src/Aws/Sns/Exception</directory>
- <directory suffix="Exception.php">./src/Aws/Sqs/Exception</directory>
- <directory suffix="Exception.php">./src/Aws/StorageGateway/Exception</directory>
- <directory suffix="Exception.php">./src/Aws/Sts/Exception</directory>
- <directory suffix="Exception.php">./src/Aws/Support/Exception</directory>
- <directory suffix="Exception.php">./src/Aws/Swf/Exception</directory>
</exclude>
</whitelist>
</filter>
@@ -3,10 +3,7 @@
"services": {
"default_settings": {
"params": {
- "key": "change_me",
- "secret": "change_me",
- "region": "us-east-1",
- "ssl.certificate_authority": true
+ "region": "us-east-1"
}
},
"cloudfront": {
View
@@ -43,23 +43,18 @@
// Set the service configuration file if it was not provided from the CLI
if (!isset($_SERVER['CONFIG'])) {
$serviceConfig = $_SERVER['CONFIG'] = dirname(__DIR__) . '/test_services.json';
- $_SERVER['CONFIG'] = $serviceConfig;
- if (!file_exists($serviceConfig)) {
- copy($serviceConfig . '.dist', $serviceConfig);
+ if (file_exists($serviceConfig)) {
+ $_SERVER['CONFIG'] = $serviceConfig;
}
}
-if (!is_readable($_SERVER['CONFIG'])) {
- die("Unable to read service configuration from '{$_SERVER['CONFIG']}'\n");
-}
-
// If the global prefix is hostname, then use the crc32() of gethostname()
if (!isset($_SERVER['PREFIX']) || $_SERVER['PREFIX'] == 'hostname') {
$_SERVER['PREFIX'] = crc32(gethostname());
}
// Instantiate the service builder
-$aws = Aws\Common\Aws::factory($_SERVER['CONFIG']);
+$aws = Aws\Common\Aws::factory(isset($_SERVER['CONFIG']) ? $_SERVER['CONFIG'] : null);
// Turn on wire logging if configured
$aws->getEventDispatcher()->addListener('service_builder.create_client', function (\Guzzle\Common\Event $event) {

0 comments on commit fd101ae

Please sign in to comment.