From dbe479f5830a6a32737410ce0dda6e0f5263787d Mon Sep 17 00:00:00 2001 From: George Arama <50641385+gearama@users.noreply.github.com> Date: Tue, 4 Oct 2022 15:24:31 -0700 Subject: [PATCH 01/15] core tests --- .../perf/test/inc/azure/perf/test/delay_test.hpp | 12 +++++++----- .../perf/test/inc/azure/perf/test/no_op_test.hpp | 16 +++++++++++++++- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/sdk/core/perf/test/inc/azure/perf/test/delay_test.hpp b/sdk/core/perf/test/inc/azure/perf/test/delay_test.hpp index 4d779f1106..02ec8ec918 100644 --- a/sdk/core/perf/test/inc/azure/perf/test/delay_test.hpp +++ b/sdk/core/perf/test/inc/azure/perf/test/delay_test.hpp @@ -56,7 +56,7 @@ namespace Azure { namespace Perf { namespace Test { { // Increment the counter and fetch the value, then remove 1 to get the previous-increment // value - auto instanceCount = _detail::DelayTestInstanceCount.fetch_add(1) - 1; + auto instanceCount = _detail::DelayTestInstanceCount.fetch_add(0); // default value if option is not parsed is 1000 auto initialDelay = m_options.GetOptionOrDefault("InitialDelayMs", 1000); auto instanceGrowFactor = m_options.GetOptionOrDefault("InstanceGrowthFactor", 1); @@ -67,7 +67,9 @@ namespace Azure { namespace Perf { namespace Test { * @brief The test definition * */ - void Run(Azure::Core::Context const&) override { std::this_thread::sleep_for(m_delay); } + void Run(Azure::Core::Context const&) override { + std::this_thread::sleep_for(m_delay); + } /** * @brief Define the test options for the test. @@ -78,16 +80,16 @@ namespace Azure { namespace Perf { namespace Test { { return { {"InitialDelayMs", - {"--delay"}, + {"-m"}, "Initial delay (in milliseconds). Default to 1000 (1sec)", 1}, {"InstanceGrowthFactor", - {"--infactor"}, + {"-n"}, "Instance growth factor. The delay of instance N will be (InitialDelayMS * " "(InstanceGrowthFactor ^ InstanceCount)). Default to 1", 1}, {"IterationGrowthFactor", - {"--itfactor"}, + {"-t"}, "Initial delay (in milliseconds). The delay of iteration N will be (InitialDelayMS * " "(IterationGrowthFactor ^ IterationCount)). Default to 1", 1}}; diff --git a/sdk/core/perf/test/inc/azure/perf/test/no_op_test.hpp b/sdk/core/perf/test/inc/azure/perf/test/no_op_test.hpp index 1910ec3cf2..adcc9e5cd2 100644 --- a/sdk/core/perf/test/inc/azure/perf/test/no_op_test.hpp +++ b/sdk/core/perf/test/inc/azure/perf/test/no_op_test.hpp @@ -32,7 +32,21 @@ namespace Azure { namespace Perf { namespace Test { * @brief Define an empty test. * */ - void Run(Azure::Core::Context const&) override {} + void Run(Azure::Core::Context const&) override + { // Get the option or a default value of 0 + auto myTestOption = m_options.GetOptionOrDefault("extraOption", 0); + (void)myTestOption; + } + + /** + * @brief Define the test options for the test. + * + * @return The list of test options. + */ + std::vector GetTestOptions() override + { + return {{"extraOption", {"-e"}, "Example for extended option for test.", 1}}; + } /** * @brief Get the static Test Metadata for the test. From 1da9b19e80801275bff9346fcf140656e28dc2d0 Mon Sep 17 00:00:00 2001 From: George Arama <50641385+gearama@users.noreply.github.com> Date: Fri, 7 Oct 2022 16:04:28 -0700 Subject: [PATCH 02/15] clang --- sdk/core/perf/test/inc/azure/perf/test/delay_test.hpp | 9 ++------- sdk/core/perf/test/inc/azure/perf/test/no_op_test.hpp | 2 +- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/sdk/core/perf/test/inc/azure/perf/test/delay_test.hpp b/sdk/core/perf/test/inc/azure/perf/test/delay_test.hpp index 02ec8ec918..9a21179cd8 100644 --- a/sdk/core/perf/test/inc/azure/perf/test/delay_test.hpp +++ b/sdk/core/perf/test/inc/azure/perf/test/delay_test.hpp @@ -67,9 +67,7 @@ namespace Azure { namespace Perf { namespace Test { * @brief The test definition * */ - void Run(Azure::Core::Context const&) override { - std::this_thread::sleep_for(m_delay); - } + void Run(Azure::Core::Context const&) override { std::this_thread::sleep_for(m_delay); } /** * @brief Define the test options for the test. @@ -79,10 +77,7 @@ namespace Azure { namespace Perf { namespace Test { std::vector GetTestOptions() override { return { - {"InitialDelayMs", - {"-m"}, - "Initial delay (in milliseconds). Default to 1000 (1sec)", - 1}, + {"InitialDelayMs", {"-m"}, "Initial delay (in milliseconds). Default to 1000 (1sec)", 1}, {"InstanceGrowthFactor", {"-n"}, "Instance growth factor. The delay of instance N will be (InitialDelayMS * " diff --git a/sdk/core/perf/test/inc/azure/perf/test/no_op_test.hpp b/sdk/core/perf/test/inc/azure/perf/test/no_op_test.hpp index adcc9e5cd2..f3875cda41 100644 --- a/sdk/core/perf/test/inc/azure/perf/test/no_op_test.hpp +++ b/sdk/core/perf/test/inc/azure/perf/test/no_op_test.hpp @@ -38,7 +38,7 @@ namespace Azure { namespace Perf { namespace Test { (void)myTestOption; } - /** + /** * @brief Define the test options for the test. * * @return The list of test options. From 0a916d58db528eb245a230001e63bb96959fb242 Mon Sep 17 00:00:00 2001 From: George Arama <50641385+gearama@users.noreply.github.com> Date: Sat, 8 Oct 2022 13:45:13 -0700 Subject: [PATCH 03/15] vcpkg test --- sdk/core/perf/test/CMakeLists.txt | 6 +++++- sdk/core/perf/test/vcpkg.json | 7 +++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 sdk/core/perf/test/vcpkg.json diff --git a/sdk/core/perf/test/CMakeLists.txt b/sdk/core/perf/test/CMakeLists.txt index 2e75b63adf..441b3b9ee1 100644 --- a/sdk/core/perf/test/CMakeLists.txt +++ b/sdk/core/perf/test/CMakeLists.txt @@ -7,6 +7,9 @@ project(azure-perf-test LANGUAGES CXX) set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED True) +include(AzureVcpkg) +az_vcpkg_integrate() + set( AZURE_PERF_TEST_HEADER inc/azure/perf/test/curl_http_client_get_test.hpp @@ -37,9 +40,10 @@ target_include_directories( PUBLIC $ ) +find_package(azure-core-cpp CONFIG REQUIRED) # link the `azure-perf` lib together with any other library which will be used for the tests. -target_link_libraries(azure-perf-test PRIVATE azure-core azure-perf) +target_link_libraries(azure-perf-test PRIVATE Azure::azure-core azure-perf) # Make sure the project will appear in the test folder for Visual Studio CMake view set_target_properties(azure-perf-test PROPERTIES FOLDER "Tests/Core") diff --git a/sdk/core/perf/test/vcpkg.json b/sdk/core/perf/test/vcpkg.json new file mode 100644 index 0000000000..92e21d452a --- /dev/null +++ b/sdk/core/perf/test/vcpkg.json @@ -0,0 +1,7 @@ +{ + "name": "azure-perf-test", + "version": "1.0.0", + "dependencies": [ + "azure-core-cpp" + ] +} \ No newline at end of file From 3517102a82bb9b689a06317cb00aa920bfb9a790 Mon Sep 17 00:00:00 2001 From: George Arama <50641385+gearama@users.noreply.github.com> Date: Sat, 8 Oct 2022 13:46:11 -0700 Subject: [PATCH 04/15] dswsw --- sdk/core/perf/test/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/core/perf/test/CMakeLists.txt b/sdk/core/perf/test/CMakeLists.txt index 441b3b9ee1..7d4a342c9d 100644 --- a/sdk/core/perf/test/CMakeLists.txt +++ b/sdk/core/perf/test/CMakeLists.txt @@ -42,6 +42,7 @@ target_include_directories( ) find_package(azure-core-cpp CONFIG REQUIRED) + # link the `azure-perf` lib together with any other library which will be used for the tests. target_link_libraries(azure-perf-test PRIVATE Azure::azure-core azure-perf) # Make sure the project will appear in the test folder for Visual Studio CMake view From fb7988b0b67780d516926d695ff16719b7875738 Mon Sep 17 00:00:00 2001 From: George Arama <50641385+gearama@users.noreply.github.com> Date: Mon, 10 Oct 2022 14:39:55 -0700 Subject: [PATCH 05/15] first take on the vcpkg --- sdk/core/perf/test/CMakeLists.txt | 7 +++---- sdk/core/perf/test/vcpkg.json | 7 ------- 2 files changed, 3 insertions(+), 11 deletions(-) delete mode 100644 sdk/core/perf/test/vcpkg.json diff --git a/sdk/core/perf/test/CMakeLists.txt b/sdk/core/perf/test/CMakeLists.txt index 7d4a342c9d..e7175b4a36 100644 --- a/sdk/core/perf/test/CMakeLists.txt +++ b/sdk/core/perf/test/CMakeLists.txt @@ -7,9 +7,6 @@ project(azure-perf-test LANGUAGES CXX) set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED True) -include(AzureVcpkg) -az_vcpkg_integrate() - set( AZURE_PERF_TEST_HEADER inc/azure/perf/test/curl_http_client_get_test.hpp @@ -40,8 +37,10 @@ target_include_directories( PUBLIC $ ) -find_package(azure-core-cpp CONFIG REQUIRED) +if(ENV{VCPKG-AZURE-CORE-CPP} STREQUAL "TRUE") + find_package(azure-core-cpp CONFIG REQUIRED) +endif() # link the `azure-perf` lib together with any other library which will be used for the tests. target_link_libraries(azure-perf-test PRIVATE Azure::azure-core azure-perf) diff --git a/sdk/core/perf/test/vcpkg.json b/sdk/core/perf/test/vcpkg.json deleted file mode 100644 index 92e21d452a..0000000000 --- a/sdk/core/perf/test/vcpkg.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "azure-perf-test", - "version": "1.0.0", - "dependencies": [ - "azure-core-cpp" - ] -} \ No newline at end of file From e0ef449e4a244a41a6f3a209300fe8e69eb74e88 Mon Sep 17 00:00:00 2001 From: George Arama <50641385+gearama@users.noreply.github.com> Date: Tue, 11 Oct 2022 13:05:49 -0700 Subject: [PATCH 06/15] vcpkg --- vcpkg.json | 5 ----- 1 file changed, 5 deletions(-) diff --git a/vcpkg.json b/vcpkg.json index 1e586685dd..6a1e8d28d1 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -13,11 +13,6 @@ { "name": "openssl" }, - { - "name": "opentelemetry-cpp", - "platform": "!uwp", - "version>=": "1.3.0" - }, { "name": "wil", "platform": "windows" From 8fcc05d0f73d4ffdcd4a5015dea296b0e32560f4 Mon Sep 17 00:00:00 2001 From: George Arama <50641385+gearama@users.noreply.github.com> Date: Wed, 12 Oct 2022 15:26:40 -0700 Subject: [PATCH 07/15] get vcpkg version --- sdk/core/perf/test/CMakeLists.txt | 8 ++++++-- sdk/core/perf/test/src/perf_test.cpp | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/sdk/core/perf/test/CMakeLists.txt b/sdk/core/perf/test/CMakeLists.txt index e7175b4a36..912abbc915 100644 --- a/sdk/core/perf/test/CMakeLists.txt +++ b/sdk/core/perf/test/CMakeLists.txt @@ -38,10 +38,14 @@ target_include_directories( $ ) -if(ENV{VCPKG-AZURE-CORE-CPP} STREQUAL "TRUE") - find_package(azure-core-cpp CONFIG REQUIRED) +if(DEFINED ENV{VCPKG-AZURE-CORE-CPP}) + find_package(azure-core-cpp $ENV{VCPKG-AZURE-CORE-CPP} EXACT) + add_compile_definitions(VCPKG_CORE_VERSION=$ENV{VCPKG-AZURE-CORE-CPP}) +else() + add_compile_definitions(VCPKG_CORE_VERSION="source") endif() + # link the `azure-perf` lib together with any other library which will be used for the tests. target_link_libraries(azure-perf-test PRIVATE Azure::azure-core azure-perf) # Make sure the project will appear in the test folder for Visual Studio CMake view diff --git a/sdk/core/perf/test/src/perf_test.cpp b/sdk/core/perf/test/src/perf_test.cpp index 9f827fcbc0..a90a704b8f 100644 --- a/sdk/core/perf/test/src/perf_test.cpp +++ b/sdk/core/perf/test/src/perf_test.cpp @@ -18,7 +18,7 @@ int main(int argc, char** argv) { - + std::cout << "AZURE_CORE_CPP VERSION " << VCPKG_CORE_VERSION << std::endl; // Create the test list std::vector tests{ Azure::Perf::Test::NoOp::GetTestMetadata(), From ce3528b4b60a3629d2c54c5d395fcc453410c18f Mon Sep 17 00:00:00 2001 From: George Arama <50641385+gearama@users.noreply.github.com> Date: Wed, 12 Oct 2022 15:37:40 -0700 Subject: [PATCH 08/15] fix cmake --- sdk/core/perf/test/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/core/perf/test/CMakeLists.txt b/sdk/core/perf/test/CMakeLists.txt index 912abbc915..b06bbb3133 100644 --- a/sdk/core/perf/test/CMakeLists.txt +++ b/sdk/core/perf/test/CMakeLists.txt @@ -40,7 +40,7 @@ target_include_directories( if(DEFINED ENV{VCPKG-AZURE-CORE-CPP}) find_package(azure-core-cpp $ENV{VCPKG-AZURE-CORE-CPP} EXACT) - add_compile_definitions(VCPKG_CORE_VERSION=$ENV{VCPKG-AZURE-CORE-CPP}) + add_compile_definitions(VCPKG_CORE_VERSION="$ENV{VCPKG-AZURE-CORE-CPP}") else() add_compile_definitions(VCPKG_CORE_VERSION="source") endif() From 11093ac43ec415aaeae3fad4d4e6c7d7bd986404 Mon Sep 17 00:00:00 2001 From: George Arama <50641385+gearama@users.noreply.github.com> Date: Wed, 12 Oct 2022 16:04:40 -0700 Subject: [PATCH 09/15] separators --- sdk/core/perf/test/src/perf_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/core/perf/test/src/perf_test.cpp b/sdk/core/perf/test/src/perf_test.cpp index a90a704b8f..cd56f1d8de 100644 --- a/sdk/core/perf/test/src/perf_test.cpp +++ b/sdk/core/perf/test/src/perf_test.cpp @@ -18,7 +18,7 @@ int main(int argc, char** argv) { - std::cout << "AZURE_CORE_CPP VERSION " << VCPKG_CORE_VERSION << std::endl; + std::cout << "AZURE-CORE-CPP VERSION " << VCPKG_CORE_VERSION << std::endl; // Create the test list std::vector tests{ Azure::Perf::Test::NoOp::GetTestMetadata(), From 8adbbda8e29b45ebb1a2b579acb8d198d67e69b3 Mon Sep 17 00:00:00 2001 From: George Arama <50641385+gearama@users.noreply.github.com> Date: Wed, 12 Oct 2022 16:30:53 -0700 Subject: [PATCH 10/15] vcpkg --- vcpkg.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/vcpkg.json b/vcpkg.json index 6a1e8d28d1..eadd505672 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -16,6 +16,11 @@ { "name": "wil", "platform": "windows" - } + }, + { + "name": "opentelemetry-cpp", + "platform": "!uwp", + "version>=": "1.3.0" + }, ] } From a70ed595ecbdc42fd636694ab4591b6e10dd8f2f Mon Sep 17 00:00:00 2001 From: George Arama <50641385+gearama@users.noreply.github.com> Date: Wed, 12 Oct 2022 16:32:00 -0700 Subject: [PATCH 11/15] vcpkg --- vcpkg.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vcpkg.json b/vcpkg.json index eadd505672..1e586685dd 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -13,14 +13,14 @@ { "name": "openssl" }, - { - "name": "wil", - "platform": "windows" - }, { "name": "opentelemetry-cpp", "platform": "!uwp", "version>=": "1.3.0" }, + { + "name": "wil", + "platform": "windows" + } ] } From b08c73967b2bfda7f3cb43ba64cf80ce38d19608 Mon Sep 17 00:00:00 2001 From: George Arama <50641385+gearama@users.noreply.github.com> Date: Thu, 13 Oct 2022 16:37:44 -0700 Subject: [PATCH 12/15] test1 --- eng/pipelines/templates/jobs/perf.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eng/pipelines/templates/jobs/perf.yml b/eng/pipelines/templates/jobs/perf.yml index 4e1d328449..a31dda892d 100644 --- a/eng/pipelines/templates/jobs/perf.yml +++ b/eng/pipelines/templates/jobs/perf.yml @@ -39,6 +39,7 @@ extends: AdditionalArguments: ${{ parameters.AdditionalArguments }} EnvVars: ${{ parameters.EnvVars}} InstallLanguageSteps: - - template: /eng/pipelines/templates/steps/vcpkg-clone.yml + - template: /eng/pipelines/templates/steps/vcpkg.yml + #/eng/pipelines/templates/steps/vcpkg-clone.yml parameters: RepoOwner: Microsoft From f8e3030b90938fe0ba3a72157280e5fc8fc8e482 Mon Sep 17 00:00:00 2001 From: George Arama <50641385+gearama@users.noreply.github.com> Date: Thu, 13 Oct 2022 16:46:55 -0700 Subject: [PATCH 13/15] disable verify agent od --- eng/common/pipelines/templates/jobs/perf.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/eng/common/pipelines/templates/jobs/perf.yml b/eng/common/pipelines/templates/jobs/perf.yml index ecd794a1f6..72992a36ad 100644 --- a/eng/common/pipelines/templates/jobs/perf.yml +++ b/eng/common/pipelines/templates/jobs/perf.yml @@ -98,10 +98,10 @@ jobs: Commitish: ${{ parameters.ToolsRepoCommitish }} WorkingDirectory: $(System.DefaultWorkingDirectory)/azure-sdk-tools - - template: /eng/common/pipelines/templates/steps/verify-agent-os.yml - parameters: - AgentImage: $(OSVmImage) - + #- template: /eng/common/pipelines/templates/steps/verify-agent-os.yml + # parameters: + # AgentImage: $(OSVmImage) + - ${{ parameters.InstallLanguageSteps }} - template: /eng/common/TestResources/deploy-test-resources.yml From 99a29636105b815c46d6ebf3cb3ec1ab8289d57c Mon Sep 17 00:00:00 2001 From: George Arama <50641385+gearama@users.noreply.github.com> Date: Thu, 13 Oct 2022 16:53:10 -0700 Subject: [PATCH 14/15] put back verify --- eng/common/pipelines/templates/jobs/perf.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/common/pipelines/templates/jobs/perf.yml b/eng/common/pipelines/templates/jobs/perf.yml index 72992a36ad..6e45b5dcb2 100644 --- a/eng/common/pipelines/templates/jobs/perf.yml +++ b/eng/common/pipelines/templates/jobs/perf.yml @@ -98,9 +98,9 @@ jobs: Commitish: ${{ parameters.ToolsRepoCommitish }} WorkingDirectory: $(System.DefaultWorkingDirectory)/azure-sdk-tools - #- template: /eng/common/pipelines/templates/steps/verify-agent-os.yml - # parameters: - # AgentImage: $(OSVmImage) + - template: /eng/common/pipelines/templates/steps/verify-agent-os.yml + parameters: + AgentImage: $(OSVmImage) - ${{ parameters.InstallLanguageSteps }} From ca1ee51f4275e13dfeb586080ae9133d05e6c91c Mon Sep 17 00:00:00 2001 From: George Arama <50641385+gearama@users.noreply.github.com> Date: Thu, 13 Oct 2022 16:58:27 -0700 Subject: [PATCH 15/15] put back yml --- eng/common/pipelines/templates/jobs/perf.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/common/pipelines/templates/jobs/perf.yml b/eng/common/pipelines/templates/jobs/perf.yml index 6e45b5dcb2..ecd794a1f6 100644 --- a/eng/common/pipelines/templates/jobs/perf.yml +++ b/eng/common/pipelines/templates/jobs/perf.yml @@ -101,7 +101,7 @@ jobs: - template: /eng/common/pipelines/templates/steps/verify-agent-os.yml parameters: AgentImage: $(OSVmImage) - + - ${{ parameters.InstallLanguageSteps }} - template: /eng/common/TestResources/deploy-test-resources.yml