Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions cmake-modules/AzureBuildTargetForCI.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,20 @@ macro(create_per_service_target_build_for_sample service target)
if(CMAKE_GENERATOR MATCHES "Visual Studio.*")
SET(binary "Release/${binary}")
endif()
file(APPEND ${CMAKE_BINARY_DIR}/${service}-samples.txt "${CMAKE_CURRENT_BINARY_DIR}/${binary}\n")


set(RUN_SAMPLE TRUE)
if(${ARGC} GREATER 2)
set(extra_args "${ARGN}")
foreach(arg IN LISTS extra_args)
if (${arg} MATCHES "DISABLE_RUN")
set(RUN_SAMPLE FALSE)
message("Disabling sample execution for ${service}/${binary}")
else()
message(FATAL_ERROR "Unknown extra argument: ${arg}")
endif()
endforeach()
endif()
if (RUN_SAMPLE)
file(APPEND ${CMAKE_BINARY_DIR}/${service}-samples.txt "${CMAKE_CURRENT_BINARY_DIR}/${binary}\n")
endif()
endmacro()
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ add_executable (
attestation_collateral.cpp
attestation_collateral.hpp)

CREATE_PER_SERVICE_TARGET_BUILD_FOR_SAMPLE(attestation attestation-${samplename})
CREATE_PER_SERVICE_TARGET_BUILD_FOR_SAMPLE(attestation attestation-${samplename} DISABLE_RUN)

target_link_libraries(attestation-${samplename} PRIVATE azure-security-attestation get-env-helper)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ add_executable (
attestation-${samplename}
${samplename}.cpp)

CREATE_PER_SERVICE_TARGET_BUILD_FOR_SAMPLE(attestation attestation-${samplename})
CREATE_PER_SERVICE_TARGET_BUILD_FOR_SAMPLE(attestation attestation-${samplename} DISABLE_RUN)

target_link_libraries(attestation-${samplename} PRIVATE azure-security-attestation azure-identity get-env-helper)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ add_executable (
cryptohelpers.hpp
)

CREATE_PER_SERVICE_TARGET_BUILD_FOR_SAMPLE(attestation-${samplename} attestation)
CREATE_PER_SERVICE_TARGET_BUILD_FOR_SAMPLE(attestation-${samplename} attestation DISABLE_RUN)

target_link_libraries(attestation-${samplename} PRIVATE azure-security-attestation azure-identity OpenSSL::Crypto get-env-helper)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ add_executable (
cryptohelpers.hpp
)

CREATE_PER_SERVICE_TARGET_BUILD_FOR_SAMPLE(attestation attestation-${samplename})
CREATE_PER_SERVICE_TARGET_BUILD_FOR_SAMPLE(attestation attestation-${samplename} DISABLE_RUN)

target_link_libraries(attestation-${samplename} PRIVATE azure-security-attestation azure-identity get-env-helper)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ add_executable (
eventhubs-${samplename}
${samplename}.cpp)

CREATE_PER_SERVICE_TARGET_BUILD_FOR_SAMPLE(eventhubs eventhubs-${samplename})
CREATE_PER_SERVICE_TARGET_BUILD_FOR_SAMPLE(eventhubs eventhubs-${samplename} DISABLE_RUN)

target_link_libraries(eventhubs-${samplename} PRIVATE azure-messaging-eventhubs azure-identity)
endmacro()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ add_executable (
eventhubs-${samplename}
${samplename}.cpp)

CREATE_PER_SERVICE_TARGET_BUILD_FOR_SAMPLE(eventhubs eventhubs-${samplename})
CREATE_PER_SERVICE_TARGET_BUILD_FOR_SAMPLE(eventhubs eventhubs-${samplename} DISABLE_RUN)

target_link_libraries(eventhubs-${samplename} PRIVATE azure-messaging-eventhubs azure-identity)
endmacro()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ add_executable (
eventhubs-${samplename}
${samplename}.cpp)

CREATE_PER_SERVICE_TARGET_BUILD_FOR_SAMPLE(eventhubs eventhubs-${samplename})
CREATE_PER_SERVICE_TARGET_BUILD_FOR_SAMPLE(eventhubs eventhubs-${samplename} DISABLE_RUN)

target_link_libraries(eventhubs-${samplename} PRIVATE azure-messaging-eventhubs azure-identity)
endmacro()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,14 +303,16 @@ namespace Azure { namespace Messaging { namespace EventHubs { namespace Test {
return name;
}

TEST_P(ConsumerClientTest, RetrieveMultipleEvents)
TEST_P(ConsumerClientTest, DISABLED_RetrieveMultipleEvents)
{
// This test depends on being able to create a new eventhub instance, so skip it on the
// emulator.
if (GetParam() == AuthType::Emulator)
{
GTEST_SKIP();
}

// Disabled test for now.
Comment thread
LarryOsterman marked this conversation as resolved.
EventHubsManagement administrationClient;
auto eventhubNamespace{administrationClient.GetNamespace(GetEnv("EVENTHUBS_NAMESPACE"))};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include <azure/core/internal/json/json.hpp>
#include <azure/core/platform.hpp>
#include <azure/core/response.hpp>
#include <azure/identity/default_azure_credential.hpp>

#include <memory>
#include <sstream>
Expand All @@ -35,7 +34,7 @@ namespace Azure { namespace Messaging { namespace EventHubs { namespace Test {
tokenContext.Scopes = {"https://management.azure.com/.default"};
perRetrypolicies.emplace_back(
std::make_unique<Azure::Core::Http::Policies::_internal::BearerTokenAuthenticationPolicy>(
std::make_unique<Azure::Identity::DefaultAzureCredential>(), tokenContext));
GetTestCredential(), tokenContext));
}
std::vector<std::unique_ptr<Azure::Core::Http::Policies::HttpPolicy>> perCallpolicies;
options.Telemetry.ApplicationId = "eventhubs.test";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@
#include <azure/core/internal/http/pipeline.hpp>
#include <azure/core/internal/json/json.hpp>
#include <azure/core/operation.hpp>
#include <azure/core/test/test_base.hpp>

#include <string>
#include <vector>

namespace Azure { namespace Messaging { namespace EventHubs { namespace Test {

class EventHubsManagement {
// Derived from Azure::Core::Test::TestBase to get access to GetTestCredential, which has logic to
// add the pipeline credential when run in CI.
class EventHubsManagement : Azure::Core::Test::TestBase {
public:
enum class EventHubsPricingTier
{
Expand Down Expand Up @@ -259,6 +262,8 @@ namespace Azure { namespace Messaging { namespace EventHubs { namespace Test {
Azure::Core::Context const& context = {});

private:
// Dummy test body to satisfy Azure::Core::Test::TestBase.
void TestBody() {}
std::string m_resourceGroup;
std::string m_location;
std::string m_subscriptionId;
Expand Down
38 changes: 19 additions & 19 deletions sdk/identity/azure-identity/samples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,22 @@ target_link_libraries(workload_identity_credential_sample PRIVATE azure-identity
target_include_directories(workload_identity_credential_sample PRIVATE .)
create_per_service_target_build_for_sample(identity workload_identity_credential_sample)

#add_executable(client_secret_credential_sample client_secret_credential.cpp)
#target_link_libraries(client_secret_credential_sample PRIVATE azure-identity service get-env-helper)
#target_include_directories(client_secret_credential_sample PRIVATE .)
#create_per_service_target_build_for_sample(identity client_secret_credential_sample)

#add_executable(default_azure_credential_sample default_azure_credential.cpp)
#target_link_libraries(default_azure_credential_sample PRIVATE azure-identity service)
#target_include_directories(default_azure_credential_sample PRIVATE .)
#create_per_service_target_build_for_sample(identity default_azure_credential_sample)

#add_executable(environment_credential_sample environment_credential.cpp)
#target_link_libraries(environment_credential_sample PRIVATE azure-identity service)
#target_include_directories(environment_credential_sample PRIVATE .)
#create_per_service_target_build_for_sample(identity environment_credential_sample)

#add_executable(managed_identity_credential_sample managed_identity_credential.cpp)
#target_link_libraries(managed_identity_credential_sample PRIVATE azure-identity service)
#target_include_directories(managed_identity_credential_sample PRIVATE .)
#create_per_service_target_build_for_sample(identity managed_identity_credential_sample)
add_executable(client_secret_credential_sample client_secret_credential.cpp)
target_link_libraries(client_secret_credential_sample PRIVATE azure-identity service get-env-helper)
target_include_directories(client_secret_credential_sample PRIVATE .)
create_per_service_target_build_for_sample(identity client_secret_credential_sample DISABLE_RUN)

add_executable(default_azure_credential_sample default_azure_credential.cpp)
target_link_libraries(default_azure_credential_sample PRIVATE azure-identity service)
target_include_directories(default_azure_credential_sample PRIVATE .)
create_per_service_target_build_for_sample(identity default_azure_credential_sample DISABLE_RUN)

add_executable(environment_credential_sample environment_credential.cpp)
target_link_libraries(environment_credential_sample PRIVATE azure-identity service)
target_include_directories(environment_credential_sample PRIVATE .)
create_per_service_target_build_for_sample(identity environment_credential_sample DISABLE_RUN)

add_executable(managed_identity_credential_sample managed_identity_credential.cpp)
target_link_libraries(managed_identity_credential_sample PRIVATE azure-identity service)
target_include_directories(managed_identity_credential_sample PRIVATE .)
create_per_service_target_build_for_sample(identity managed_identity_credential_sample DISABLE_RUN)
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ if (BUILD_PERFORMANCE_TESTS)
add_subdirectory(test/perf)
endif()

if(BUILD_SAMPLES_DISABLED)
if(BUILD_SAMPLES)
Comment thread
gearama marked this conversation as resolved.
add_subdirectory(samples)
endif()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ add_executable (
certificate_basic_operations.cpp
)

create_per_service_target_build_for_sample(keyvault certificate-basic-operations)
create_per_service_target_build_for_sample(keyvault certificate-basic-operations DISABLE_RUN)

target_link_libraries(certificate-basic-operations PRIVATE azure-security-keyvault-certificates azure-identity get-env-helper)
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ add_executable (
certificate-get-certificates
certificate_get_certificates.cpp
)
create_per_service_target_build_for_sample(keyvault certificate-get-certificates)
create_per_service_target_build_for_sample(keyvault certificate-get-certificates DISABLE_RUN)

target_link_libraries(certificate-get-certificates PRIVATE azure-security-keyvault-certificates azure-identity get-env-helper)
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ add_executable (
certificate-import-certificate
certificate_import_certificate.cpp
)
create_per_service_target_build_for_sample(keyvault certificate-import-certificate)
create_per_service_target_build_for_sample(keyvault certificate-import-certificate DISABLE_RUN)

target_link_libraries(certificate-import-certificate PRIVATE azure-security-keyvault-certificates azure-identity get-env-helper)
2 changes: 1 addition & 1 deletion sdk/keyvault/azure-security-keyvault-keys/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ if (BUILD_PERFORMANCE_TESTS)
add_subdirectory(test/perf)
endif()

if(BUILD_SAMPLES_DISABLED)
if(BUILD_SAMPLES)
add_subdirectory(samples)
endif()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ add_executable (
sample1_hello_world.cpp
)

create_per_service_target_build_for_sample(keyvault sample1-hello-world)
create_per_service_target_build_for_sample(keyvault sample1-hello-world DISABLE_RUN)

target_link_libraries(sample1-hello-world PRIVATE azure-security-keyvault-keys azure-identity get-env-helper)
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ add_executable (
sample2-backup-and-restore
sample2_backup_and_restore.cpp
)
create_per_service_target_build_for_sample(keyvault sample2-backup-and-restore)
create_per_service_target_build_for_sample(keyvault sample2-backup-and-restore DISABLE_RUN)

target_link_libraries(sample2-backup-and-restore PRIVATE azure-security-keyvault-keys azure-identity get-env-helper)
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ add_executable (
sample3-get-keys
sample3_get_keys.cpp
)
create_per_service_target_build_for_sample(keyvault sample3-get-keys)
create_per_service_target_build_for_sample(keyvault sample3-get-keys DISABLE_RUN)

target_link_libraries(sample3-get-keys PRIVATE azure-security-keyvault-keys azure-identity get-env-helper)
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ add_executable (
sample4-encrypt-decrypt
sample4_encrypt_decrypt.cpp
)
create_per_service_target_build_for_sample(keyvault sample4-encrypt-decrypt)
create_per_service_target_build_for_sample(keyvault sample4-encrypt-decrypt DISABLE_RUN)

target_link_libraries(sample4-encrypt-decrypt PRIVATE azure-security-keyvault-keys azure-identity get-env-helper)
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ add_executable (
sample5-sign-verify
sample5_sign_verify.cpp
)
create_per_service_target_build_for_sample(keyvault sample5-sign-verify)
create_per_service_target_build_for_sample(keyvault sample5-sign-verify DISABLE_RUN)

target_link_libraries(sample5-sign-verify PRIVATE azure-security-keyvault-keys azure-identity get-env-helper)
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ add_executable (
sample6-wrap-unwrap
sample6_wrap_unwrap.cpp
)
create_per_service_target_build_for_sample(keyvault sample6-wrap-unwrap)
create_per_service_target_build_for_sample(keyvault sample6-wrap-unwrap DISABLE_RUN)

target_link_libraries(sample6-wrap-unwrap PRIVATE azure-security-keyvault-keys azure-identity get-env-helper)
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ add_executable (
sample7-key-rotation
sample7_key_rotation.cpp
)
create_per_service_target_build_for_sample(keyvault sample7-key-rotation)
create_per_service_target_build_for_sample(keyvault sample7-key-rotation DISABLE_RUN)

target_link_libraries(sample7-key-rotation PRIVATE azure-security-keyvault-keys azure-identity get-env-helper)
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ if (BUILD_PERFORMANCE_TESTS)
add_subdirectory(test/perf)
endif()

if(BUILD_SAMPLES_DISABLED)
if(BUILD_SAMPLES)
add_subdirectory(samples)
endif()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ add_executable (
sample1-basic-operations
sample1_basic_operations.cpp
)
create_per_service_target_build_for_sample(keyvault sample1-basic-operations)
create_per_service_target_build_for_sample(keyvault sample1-basic-operations DISABLE_RUN)

target_link_libraries(sample1-basic-operations PRIVATE azure-security-keyvault-secrets azure-identity get-env-helper)
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ add_executable (
sample2_backup_restore.cpp
)

create_per_service_target_build_for_sample(keyvault sample2-backup-restore)
create_per_service_target_build_for_sample(keyvault sample2-backup-restore DISABLE_RUN)

target_link_libraries(sample2-backup-restore PRIVATE azure-security-keyvault-secrets azure-identity get-env-helper)
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ add_executable (
sample3_delete_recover.cpp
)

create_per_service_target_build_for_sample(keyvault sample3-delete-recover)
create_per_service_target_build_for_sample(keyvault sample3-delete-recover DISABLE_RUN)

target_link_libraries(sample3-delete-recover PRIVATE azure-security-keyvault-secrets azure-identity get-env-helper)
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ add_executable (
sample4_get_secrets_deleted.cpp
)

create_per_service_target_build_for_sample(keyvault sample4-get-secrets-deleted)
create_per_service_target_build_for_sample(keyvault sample4-get-secrets-deleted DISABLE_RUN)

target_link_libraries(sample4-get-secrets-deleted PRIVATE azure-security-keyvault-secrets azure-identity get-env-helper)