Skip to content

Commit

Permalink
Merge pull request aws#636 from jeskew/feature/behat-integration-tests
Browse files Browse the repository at this point in the history
Add shared SDK cucumber tests to PHP repo
  • Loading branch information
jeskew committed Jun 26, 2015
2 parents 74876b5 + 5c44fda commit 3cccb2c
Show file tree
Hide file tree
Showing 48 changed files with 985 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
build/ export-ignore
docs/ export-ignore
tests/ export-ignore
features/ export-ignore
vendor/ export-ignore
.gitattributes export-ignore
.gitignore export-ignore
Expand Down
5 changes: 5 additions & 0 deletions behat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
default:
suites:
smoke:
paths: [ %paths.base%/features/smoke ]
contexts: [ Aws\Test\Integ\SmokeContext ]
8 changes: 7 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"ext-json": "*",
"ext-dom": "*",
"ext-simplexml": "*",
"phpunit/phpunit": "~4.0"
"phpunit/phpunit": "~4.0",
"behat/behat": "~3.0"
},
"suggest": {
"ext-openssl": "Allows working with CloudFront private distributions and verifying received SNS messages",
Expand All @@ -41,6 +42,11 @@
},
"files": ["src/functions.php"]
},
"autoload-dev": {
"psr-4": {
"Aws\\Test\\": "tests/"
}
},
"extra": {
"branch-alias": {
"dev-master": "3.0-dev"
Expand Down
18 changes: 18 additions & 0 deletions features/smoke/autoscaling/autoscaling.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# language: en
@autoscaling
Feature: Auto Scaling

Scenario: Making a request
When I call the "DescribeScalingProcessTypes" API
Then the value at "Processes" should be a list

Scenario: Handing errors
When I attempt to call the "CreateLaunchConfiguration" API with:
| LaunchConfigurationName | |
| ImageId | ami-12345678 |
| InstanceType | m1.small |
Then I expect the response error code to be "ValidationError"
And I expect the response error message to include:
"""
Member must have length greater than or equal to 1
"""
17 changes: 17 additions & 0 deletions features/smoke/cloudformation/cloudformation.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# language: en
@cloudformation
Feature: AWS CloudFormation

Scenario: Making a request
When I call the "ListStacks" API
Then the value at "StackSummaries" should be a list

Scenario: Handling errors
When I attempt to call the "CreateStack" API with:
| StackName | fakestack |
| TemplateURL | http://s3.amazonaws.com/foo/bar |
Then I expect the response error code to be "ValidationError"
And I expect the response error message to include:
"""
TemplateURL must reference a valid S3 object to which you have access.
"""
17 changes: 17 additions & 0 deletions features/smoke/cloudfront/cloudfront.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# language: en
@cloudfront
Feature: Amazon CloudFront

Scenario: Making a basic request
When I call the "ListDistributions" API with:
| MaxItems | 1 |
Then the value at "DistributionList.Items" should be a list

Scenario: Error handling
When I attempt to call the "GetDistribution" API with:
| Id | fake-id |
Then I expect the response error code to be "NoSuchDistribution"
And I expect the response error message to include:
"""
The specified distribution does not exist.
"""
16 changes: 16 additions & 0 deletions features/smoke/cloudhsm/cloudhsm.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# language: en
@cloudhsm
Feature: Amazon CloudHSM

Scenario: Making a request
When I call the "ListHapgs" API
Then the value at "HapgList" should be a list

Scenario: Handling errors
When I attempt to call the "DescribeHapg" API with:
| HapgArn | bogus-arn |
Then I expect the response error code to be "ValidationException"
And I expect the response error message to include:
"""
Value 'bogus-arn' at 'hapgArn' failed to satisfy constraint
"""
16 changes: 16 additions & 0 deletions features/smoke/cloudsearch/cloudsearch.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# language: en
@cloudsearch
Feature: Amazon CloudSearch

Scenario: Making a request
When I call the "DescribeDomains" API
Then the response should contain a "DomainStatusList"

Scenario: Handling errors
When I attempt to call the "DescribeIndexFields" API with:
| DomainName | fakedomain |
Then I expect the response error code to be "ResourceNotFound"
And I expect the response error message to include:
"""
Domain not found: fakedomain
"""
16 changes: 16 additions & 0 deletions features/smoke/cloudtrail/cloudtrail.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# language: en
@cloudtrail
Feature: AWS CloudTrail

Scenario: Making a request
When I call the "DescribeTrails" API
Then the response should contain a "trailList"

Scenario: Handling errors
When I attempt to call the "DeleteTrail" API with:
| Name | faketrail |
Then I expect the response error code to be "TrailNotFoundException"
And I expect the response error message to include:
"""
Unknown trail
"""
19 changes: 19 additions & 0 deletions features/smoke/cloudwatch/cloudwatch.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# language: en
@cloudwatch
Feature: Amazon CloudWatch

Scenario: Making a request
When I call the "ListMetrics" API with:
| Namespace | AWS/EC2 |
Then the value at "Metrics" should be a list

Scenario: Handling errors
When I attempt to call the "SetAlarmState" API with:
| AlarmName | abc |
| StateValue | mno |
| StateReason | xyz |
Then I expect the response error code to be "ValidationError"
And I expect the response error message to include:
"""
failed to satisfy constraint
"""
17 changes: 17 additions & 0 deletions features/smoke/cloudwatchlogs/cloudwatchlogs.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# language: en
@cloudwatchlogs
Feature: Amazon CloudWatch Logs

Scenario: Making a request
When I call the "DescribeLogGroups" API
Then the value at "logGroups" should be a list

Scenario: Handling errors
When I attempt to call the "GetLogEvents" API with:
| logGroupName | fakegroup |
| logStreamName | fakestream |
Then I expect the response error code to be "ResourceNotFoundException"
And I expect the response error message to include:
"""
The specified log group does not exist.
"""
16 changes: 16 additions & 0 deletions features/smoke/codedeploy/codedeploy.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# language: en
@codedeploy
Feature: Amazon CodeDeploy

Scenario: Making a request
When I call the "ListApplications" API
Then the value at "applications" should be a list

Scenario: Handling errors
When I attempt to call the "GetApplication" API with:
| applicationName | bogus-app |
Then I expect the response error code to be "ApplicationDoesNotExistException"
And I expect the response error message to include:
"""
No application found for name: bogus-app
"""
19 changes: 19 additions & 0 deletions features/smoke/cognitoidentity/cognitoidentity.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# language: en
@cognitoidentity
Feature: Amazon Cognito Idenity

Scenario: Making a request
When I call the "ListIdentityPools" API with JSON:
"""
{"MaxResults": 10}
"""
Then the value at "IdentityPools" should be a list

Scenario: Handling errors
When I attempt to call the "DescribeIdentityPool" API with:
| IdentityPoolId | us-east-1:aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee |
Then I expect the response error code to be "ResourceNotFoundException"
And I expect the response error message to include:
"""
IdentityPool 'us-east-1:aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee' not found
"""
16 changes: 16 additions & 0 deletions features/smoke/cognitosync/cognitosync.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# language: en
@cognitosync
Feature: Amazon Cognito Sync

Scenario: Making a request
When I call the "ListIdentityPoolUsage" API
Then the value at "IdentityPoolUsages" should be a list

Scenario: Handling errors
When I attempt to call the "DescribeIdentityPoolUsage" API with:
| IdentityPoolId | us-east-1:aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee |
Then I expect the response error code to be "ResourceNotFoundException"
And I expect the response error message to include:
"""
IdentityPool 'us-east-1:aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee' not found
"""
17 changes: 17 additions & 0 deletions features/smoke/configservice/configservice.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# language: en
@configservice
Feature: AWS Config

Scenario: Making a request
When I call the "DescribeConfigurationRecorders" API
Then the value at "ConfigurationRecorders" should be a list

Scenario: Handling errors
When I attempt to call the "GetResourceConfigHistory" API with:
| resourceType | fake-type |
| resourceId | fake-id |
Then I expect the response error code to be "ValidationException"
And I expect the response error message to include:
"""
failed to satisfy constraint
"""
16 changes: 16 additions & 0 deletions features/smoke/datapipeline/datapipeline.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# language: en
@datapipeline
Feature: AWS Data Pipeline

Scenario: Making a request
When I call the "ListPipelines" API
Then the response should contain a "pipelineIdList"

Scenario: Handling errors
When I attempt to call the "GetPipelineDefinition" API with:
| pipelineId | fake-id |
Then I expect the response error code to be "PipelineNotFoundException"
And I expect the response error message to include:
"""
does not exist
"""
16 changes: 16 additions & 0 deletions features/smoke/directconnect/directconnect.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# language: en
@directconnect
Feature: AWS Direct Connect

Scenario: Making a request
When I call the "DescribeConnections" API
Then the value at "connections" should be a list

Scenario: Handling errors
When I attempt to call the "DescribeConnections" API with:
| connectionId | fake-connection |
Then I expect the response error code to be "DirectConnectClientException"
And I expect the response error message to include:
"""
Connection ID fake-connection has an invalid format
"""
17 changes: 17 additions & 0 deletions features/smoke/directoryservice/directoryservice.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# language: en
@directoryservice
Feature: AWS Directory Service

I want to use AWS Directory Service

Scenario: Making a request
When I call the "DescribeDirectories" API
Then the value at "DirectoryDescriptions" should be a list

Scenario: Handling errors
When I attempt to call the "CreateDirectory" API with:
| Name | |
| Password | |
| Size | |
Then I expect the response error code to be "ValidationException"

19 changes: 19 additions & 0 deletions features/smoke/dynamodb/dynamodb.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# language: en
@dynamodb
Feature: Amazon DynamoDB

Scenario: Making a request
When I call the "ListTables" API with JSON:
"""
{"Limit": 1}
"""
Then the value at "TableNames" should be a list

Scenario: Handling errors
When I attempt to call the "DescribeTable" API with:
| TableName | fake-table |
Then I expect the response error code to be "ResourceNotFoundException"
And I expect the response error message to include:
"""
Requested resource not found: Table: fake-table not found
"""
18 changes: 18 additions & 0 deletions features/smoke/ec2/ec2.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# language: en
@ec2
Feature: Amazon Elastic Compute Cloud

Scenario: Making a request
When I call the "DescribeRegions" API
Then the value at "Regions" should be a list

Scenario: Handling errors
When I attempt to call the "DescribeInstances" API with JSON:
"""
{"InstanceIds": ["i-12345678"]}
"""
Then I expect the response error code to be "InvalidInstanceID.NotFound"
And I expect the response error message to include:
"""
The instance ID 'i-12345678' does not exist
"""
14 changes: 14 additions & 0 deletions features/smoke/ecs/ecs.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# language: en
@ecs
Feature: Amazon ECS

I want to use Amazon ECS

Scenario: Making a request
When I call the "ListClusters" API
Then the value at "clusterArns" should be a list

Scenario: Handling errors
When I attempt to call the "StopTask" API with:
| task | xxxxxxxxxxx-xxxxxxxxxxxx-xxxxxxxxxxx |
Then the error code should be "ClusterNotFoundException"
14 changes: 14 additions & 0 deletions features/smoke/efs/efs.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# language: en
@efs
Feature: Amazon Elastic File System

I want to use Amazon Elastic File System

Scenario: Making a request
When I call the "DescribeFileSystems" API
Then the value at "FileSystems" should be a list

Scenario: Handling errors
When I attempt to call the "DeleteFileSystem" API with:
| FileSystemId | fake-id |
Then the error code should be "ValidationException"
16 changes: 16 additions & 0 deletions features/smoke/elasticache/elasticache.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# language: en
@elasticache
Feature: ElastiCache

Scenario: Making a request
When I call the "DescribeEvents" API
Then the value at "Events" should be a list

Scenario: Handling errors
When I attempt to call the "DescribeCacheClusters" API with:
| CacheClusterId | fake_cluster |
Then I expect the response error code to be "InvalidParameterValue"
And I expect the response error message to include:
"""
The parameter CacheClusterIdentifier is not a valid identifier.
"""
Loading

0 comments on commit 3cccb2c

Please sign in to comment.