Skip to content

Commit

Permalink
Integrate performance tests with the test-phar make target
Browse files Browse the repository at this point in the history
  • Loading branch information
jeskew committed Sep 22, 2015
1 parent 7ebdee7 commit 77f0eca
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -35,7 +35,7 @@ test-phar: package
wget https://github.com/Behat/Behat/releases/download/v3.0.15/behat.phar)
[ -f build/artifacts/phpunit.phar ] || (cd build/artifacts && \
wget https://phar.phpunit.de/phpunit.phar)
./build/phar-test-runner.php --format=progress
php -dopcache.enable_cli=1 build/phar-test-runner.php --format=progress

coverage:
@AWS_ACCESS_KEY_ID=foo AWS_SECRET_ACCESS_KEY=bar \
Expand Down
1 change: 1 addition & 0 deletions features/bootstrap/Aws/Test/PerformanceContext.php
1 change: 1 addition & 0 deletions features/bootstrap/Aws/Test/UsesServiceTrait.php
8 changes: 4 additions & 4 deletions features/performance/clients.feature
@@ -1,16 +1,16 @@
# language: en
@performance @clients
Feature: Client Performance
Background:
Given I have loaded my SDK and its dependencies
And I have a list of services
And I take a snapshot of my resources

Scenario: Creating and then cleaning up clients doesn't leak resources
Given I have a list of services
And I take a snapshot of my resources
When I create and discard 100 clients for each service
Then I should not have leaked any resources

Scenario: Sending requests doesn't leak resources
Given I take a snapshot of my resources
And I have a list of services
When I create a client for each service
And I execute 100 command(s) on each client
And I destroy all the clients
Expand Down
4 changes: 0 additions & 4 deletions features/performance/streaming.feature
Expand Up @@ -10,9 +10,7 @@ Feature: Streaming transfers consume a fixed amount of memory

Examples:
| bytes |
| 2048 |
| 2097152 |
| 20971520 |
| 209715200 |

Scenario Outline: Streaming download are O(1) in memory usage
Expand All @@ -24,7 +22,5 @@ Feature: Streaming transfers consume a fixed amount of memory

Examples:
| bytes |
| 2048 |
| 2097152 |
| 20971520 |
| 209715200 |
8 changes: 8 additions & 0 deletions tests/PerformanceContext.php
Expand Up @@ -55,6 +55,14 @@ public function cleanUpFile(AfterScenarioScope $scope)
}
}

/**
* @Given I have loaded my SDK and its dependencies
*/
public function iHaveLoadedMySdkAndItsDependencies()
{
$this->iCreateAndDiscardClientSForEachService(1);
}

/**
* @Given I take a snapshot of my resources
*/
Expand Down

0 comments on commit 77f0eca

Please sign in to comment.