From 77f0ecaf12e64a584cf5cba07d85fba77d84b54c Mon Sep 17 00:00:00 2001 From: Jonathan Eskew Date: Tue, 22 Sep 2015 14:06:22 -0700 Subject: [PATCH] Integrate performance tests with the `test-phar` make target --- Makefile | 2 +- features/bootstrap/Aws/Test/PerformanceContext.php | 1 + features/bootstrap/Aws/Test/UsesServiceTrait.php | 1 + features/performance/clients.feature | 8 ++++---- features/performance/streaming.feature | 4 ---- tests/PerformanceContext.php | 8 ++++++++ 6 files changed, 15 insertions(+), 9 deletions(-) create mode 120000 features/bootstrap/Aws/Test/PerformanceContext.php create mode 120000 features/bootstrap/Aws/Test/UsesServiceTrait.php diff --git a/Makefile b/Makefile index 72d8b84577..5d811f1120 100644 --- a/Makefile +++ b/Makefile @@ -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 \ diff --git a/features/bootstrap/Aws/Test/PerformanceContext.php b/features/bootstrap/Aws/Test/PerformanceContext.php new file mode 120000 index 0000000000..8db048f99c --- /dev/null +++ b/features/bootstrap/Aws/Test/PerformanceContext.php @@ -0,0 +1 @@ +../../../../tests/PerformanceContext.php \ No newline at end of file diff --git a/features/bootstrap/Aws/Test/UsesServiceTrait.php b/features/bootstrap/Aws/Test/UsesServiceTrait.php new file mode 120000 index 0000000000..d130929039 --- /dev/null +++ b/features/bootstrap/Aws/Test/UsesServiceTrait.php @@ -0,0 +1 @@ +../../../../tests/UsesServiceTrait.php \ No newline at end of file diff --git a/features/performance/clients.feature b/features/performance/clients.feature index 1e6c204ffd..c248329e09 100644 --- a/features/performance/clients.feature +++ b/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 diff --git a/features/performance/streaming.feature b/features/performance/streaming.feature index 515470e876..cd24cb7db8 100644 --- a/features/performance/streaming.feature +++ b/features/performance/streaming.feature @@ -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 @@ -24,7 +22,5 @@ Feature: Streaming transfers consume a fixed amount of memory Examples: | bytes | - | 2048 | | 2097152 | - | 20971520 | | 209715200 | diff --git a/tests/PerformanceContext.php b/tests/PerformanceContext.php index 1e5cd904f9..eedf939915 100644 --- a/tests/PerformanceContext.php +++ b/tests/PerformanceContext.php @@ -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 */